From 7db5188eb79c66834aa35210661dc98f7e2f3a41 Mon Sep 17 00:00:00 2001
From: Tobias Winchen <tobias.winchen@rwth-aachen.de>
Date: Fri, 3 Sep 2021 06:05:55 +0000
Subject: [PATCH] Fix integration over multiple blocks

---
 psrdada_cpp/effelsberg/edd/detail/GatedSpectrometer.cu | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/psrdada_cpp/effelsberg/edd/detail/GatedSpectrometer.cu b/psrdada_cpp/effelsberg/edd/detail/GatedSpectrometer.cu
index 1540b1af..f3232609 100644
--- a/psrdada_cpp/effelsberg/edd/detail/GatedSpectrometer.cu
+++ b/psrdada_cpp/effelsberg/edd/detail/GatedSpectrometer.cu
@@ -372,7 +372,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(SinglePolari
             thrust::raw_pointer_cast(outputDataStream->G0.data.a().data()),
             _nchans,
             inputDataStream->_channelised_voltage_G0.size(),
-            _naccumulate,
+            _naccumulate / _nBlocks,
             1, 0., 1, 0);
 
   kernels::detect_and_accumulate<IntegratedPowerType> <<<1024, 1024, 0, _proc_stream>>>(
@@ -380,7 +380,7 @@ void GatedSpectrometer<HandlerType, InputType, OutputType>::process(SinglePolari
             thrust::raw_pointer_cast(outputDataStream->G1.data.a().data()),
             _nchans,
             inputDataStream->_channelised_voltage_G1.size(),
-            _naccumulate,
+            _naccumulate / _nBlocks,
             1, 0., 1, 0);
 
     // count saturated samples
-- 
GitLab