From 024a47eef822ac675b7ecd121c5c7857354f4067 Mon Sep 17 00:00:00 2001 From: Tobias Reiter Date: Thu, 11 Apr 2024 20:35:54 +0200 Subject: [PATCH] Fix: always resize hit counter --- include/viennaray/rayTraceKernel.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/viennaray/rayTraceKernel.hpp b/include/viennaray/rayTraceKernel.hpp index ce99a7a..eb1a535 100644 --- a/include/viennaray/rayTraceKernel.hpp +++ b/include/viennaray/rayTraceKernel.hpp @@ -75,9 +75,9 @@ class rayTraceKernel { // hit counters std::vector> threadLocalHitCounter(numThreads); + hitCounter_.clear(); + hitCounter_.resize(geometry_.getNumPoints(), calcFlux_); if (calcFlux_) { - hitCounter_.clear(); - hitCounter_.resize(geometry_.getNumPoints(), calcFlux_); for (auto &hitC : threadLocalHitCounter) { hitC = hitCounter_; }