From f151e56daa617e3327826f06f0765d1673fa8cfd Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Fri, 12 May 2017 20:01:33 -0700 Subject: Added the IxAMIN routines: absolute minimum version of IxAMAX --- src/kernels/level1/xamax.opencl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/kernels') 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 // -// 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 -- cgit v1.2.3