diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2020-03-08 11:26:49 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2020-03-08 11:26:49 +0100 |
commit | b46853660e6c90e65bda51287ff0b17899305f1c (patch) | |
tree | 5cdabad7822630efd9e21b2e232fdba119625edc /src/kernels | |
parent | 7fab29304c682ea7f341b3338ddfbdd2d5b08cbf (diff) |
Made it more likely (but no guarantees) for amax/amin to return the first index
Diffstat (limited to 'src/kernels')
-rw-r--r-- | src/kernels/level1/xamax.opencl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernels/level1/xamax.opencl b/src/kernels/level1/xamax.opencl index e65acf17..85cbdc86 100644 --- a/src/kernels/level1/xamax.opencl +++ b/src/kernels/level1/xamax.opencl @@ -64,7 +64,7 @@ void Xamax(const int n, #else x = fabs(x); #endif - if (x >= max) { + if (x > max) { max = x; imax = id*x_inc + x_offset; } @@ -77,7 +77,7 @@ void Xamax(const int n, // Performs reduction in local memory for (int s=WGS1/2; s>0; s=s>>1) { if (lid < s) { - if (maxlm[lid + s] >= maxlm[lid]) { + if (maxlm[lid + s] > maxlm[lid]) { maxlm[lid] = maxlm[lid + s]; imaxlm[lid] = imaxlm[lid + s]; } @@ -105,7 +105,7 @@ void XamaxEpilogue(const __global singlereal* restrict maxgm, const int lid = get_local_id(0); // Performs the first step of the reduction while loading the data - if (maxgm[lid + WGS2] >= maxgm[lid]) { + if (maxgm[lid + WGS2] > maxgm[lid]) { maxlm[lid] = maxgm[lid + WGS2]; imaxlm[lid] = imaxgm[lid + WGS2]; } @@ -118,7 +118,7 @@ void XamaxEpilogue(const __global singlereal* restrict maxgm, // Performs reduction in local memory for (int s=WGS2/2; s>0; s=s>>1) { if (lid < s) { - if (maxlm[lid + s] >= maxlm[lid]) { + if (maxlm[lid + s] > maxlm[lid]) { maxlm[lid] = maxlm[lid + s]; imaxlm[lid] = imaxlm[lid + s]; } |