diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-04-27 18:07:30 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-04-27 18:07:30 +0200 |
commit | d7ddbdeb1f416f56bc469d16c051551207274703 (patch) | |
tree | 2f5ba3abc5a97509b84ecdd1fdf5b449ab543eec /src/kernels/level1/xamax.opencl | |
parent | 13eed1a0f973ff2090062a1ad4485896b22949b0 (diff) |
Added non-absolute counter-parts xSUM and IxMAX of the BLAS routines xASUM and IxAMAX
Diffstat (limited to 'src/kernels/level1/xamax.opencl')
-rw-r--r-- | src/kernels/level1/xamax.opencl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/kernels/level1/xamax.opencl b/src/kernels/level1/xamax.opencl index 03dd05e5..58b75ce2 100644 --- a/src/kernels/level1/xamax.opencl +++ b/src/kernels/level1/xamax.opencl @@ -41,14 +41,23 @@ __kernel void Xamax(const int n, const int num_groups = get_num_groups(0); // Performs loading and the first steps of the reduction - singlereal max = ZERO; + #if defined(ROUTINE_MAX) // non-absolute version + singlereal max = SMALLEST; + #else + singlereal max = ZERO; + #endif unsigned int imax = 0; int id = wgid*WGS1 + lid; while (id < n) { + const int x_index = id*x_inc + x_offset; #if PRECISION == 3232 || PRECISION == 6464 - singlereal x = fabs(xgm[id*x_inc + x_offset].x); + singlereal x = xgm[x_index].x; #else - singlereal x = fabs(xgm[id*x_inc + x_offset]); + singlereal x = xgm[x_index]; + #endif + #if defined(ROUTINE_MAX) // non-absolute version + #else + x = fabs(x); #endif if (x >= max) { max = x; |