summaryrefslogtreecommitdiff
path: root/src/kernels
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-05-12 20:01:33 -0700
committerCedric Nugteren <web@cedricnugteren.nl>2017-05-12 20:01:33 -0700
commitf151e56daa617e3327826f06f0765d1673fa8cfd (patch)
tree66396978988720155adf4f6eb21b921758ccd8aa /src/kernels
parent86e8df60f1598760511b059b42a9e4f9dddfa150 (diff)
Added the IxAMIN routines: absolute minimum version of IxAMAX
Diffstat (limited to 'src/kernels')
-rw-r--r--src/kernels/level1/xamax.opencl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kernels/level1/xamax.opencl b/src/kernels/level1/xamax.opencl
index 48ad2e75..2bd2f714 100644
--- a/src/kernels/level1/xamax.opencl
+++ b/src/kernels/level1/xamax.opencl
@@ -7,7 +7,7 @@
// Author(s):
// Cedric Nugteren <www.cedricnugteren.nl>
//
-// This file contains the Xamax kernel. It implements an index of absolute max computation using
+// This file contains the Xamax kernel. It implements index of (absolute) min/max computation using
// reduction kernels. Reduction is split in two parts. In the first (main) kernel the X vector is
// loaded, followed by a per-thread and a per-workgroup reduction. The second (epilogue) kernel
// is executed with a single workgroup only, computing the final result.
@@ -59,6 +59,8 @@ void Xamax(const int n,
// nothing special here
#elif defined(ROUTINE_MIN) // non-absolute minimum version
x = -x;
+ #elif defined(ROUTINE_AMIN) // absolute minimum version
+ x = -fabs(x);
#else
x = fabs(x);
#endif