diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2020-03-15 11:34:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-15 11:34:31 +0100 |
commit | 78300ccbeacdfe9688f04639b2e15fb2f24e2a16 (patch) | |
tree | 6341a093b6026cf8b8732efb324600658121a3a1 /src | |
parent | e3ce88154ab4a6f9a8efe77f551a4b3d0710bcfb (diff) | |
parent | 5f97d645053948df6f54bddb11c3fb3bf5486408 (diff) |
Merge pull request #378 from CNugteren/CLBlast-377-fix-amax-amin
Change amax/amin behaviour
Diffstat (limited to 'src')
-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]; } |