From d3d5d22ca18fbf78ec2574fc6f917bc082da5c5f Mon Sep 17 00:00:00 2001
From: Sarod Yatawatta <yatawatta@astron.nl>
Date: Sun, 15 Nov 2020 22:32:16 +0000
Subject: [PATCH] COB-153: use pol instead of ri

---
 RTCP/Cobalt/GPUProc/share/gpu/kernels/FIR_Filter.cu | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/RTCP/Cobalt/GPUProc/share/gpu/kernels/FIR_Filter.cu b/RTCP/Cobalt/GPUProc/share/gpu/kernels/FIR_Filter.cu
index e4c69c92ea4..5943836756d 100644
--- a/RTCP/Cobalt/GPUProc/share/gpu/kernels/FIR_Filter.cu
+++ b/RTCP/Cobalt/GPUProc/share/gpu/kernels/FIR_Filter.cu
@@ -117,7 +117,7 @@ inline __device__ float sincos_f2f_select(float phi, int pol)
 typedef  const double(*DelaysType)[1][NR_STABS][NR_POLARIZATIONS]; // 2 Polarizations; in seconds
 typedef  const double(*Phase0sType)[NR_STABS][NR_POLARIZATIONS]; // 2 Polarizations; in radians
 
-inline __device__ float correction_factor(double phiGradient, int ri, unsigned channel)
+inline __device__ float correction_factor(double phiGradient, int pol, unsigned channel)
 {
     // Offset of this sample between begin and end. = t/T fraction, within one FFT block of NR_CHANNELS
     const double blockOffset = double(channel) / NR_CHANNELS;
@@ -128,9 +128,10 @@ inline __device__ float correction_factor(double phiGradient, int ri, unsigned c
     // We can afford to if we keep this kernel memory bound.
     const float phi = phiGradient  * blockOffset;
     // Note: both X and Y polarizations will have same correction
-    return sincos_f2f_select(phi, ri);
+    // But pol used here because input is ordered accordingly
+    return sincos_f2f_select(phi, pol);
 }
-#define FACTOR correction_factor(phiGradient, ri, channel)
+#define FACTOR correction_factor(phiGradient, pol, channel)
 #endif /* DOPPLER_CORRECTION */
 
 /*!
-- 
GitLab