diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-03-06 15:48:11 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-03-06 15:48:11 +0100 |
commit | 306bf67660da4f1adacaedf9066925240abf4ea9 (patch) | |
tree | 6f94fcd0d394e9874eaa24e637b7c56e0b2c8e0d /src/kernels | |
parent | 60da54da5d8cb8dc763c13ba48ec6d8e557a609d (diff) |
Added preliminary support for xHPR2 and xSPR2 routines
Diffstat (limited to 'src/kernels')
-rw-r--r-- | src/kernels/level2/level2.opencl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/kernels/level2/level2.opencl b/src/kernels/level2/level2.opencl index 1b0efeab..be979766 100644 --- a/src/kernels/level2/level2.opencl +++ b/src/kernels/level2/level2.opencl @@ -109,7 +109,18 @@ inline void MatrixUpdate2(const int id1, const int id2, const int max1, const in // Bounds of a regular matrix if (id1 < max1 && id2 < max2) { - const int a_index = id2*a_ld + id1 + a_offset; + #if defined(ROUTINE_SPR2) || defined(ROUTINE_HPR2) + int a_index; + if (is_upper) { + a_index = (id1 <= id2) ? ((id2+1)*id2)/2 + id1 : ((id1+1)*id1)/2 + id2; + } + else { + a_index = (id1 >= id2) ? ((2*a_ld-(id2+1))*id2)/2 + id1 : ((2*a_ld-(id1+1))*id1)/2 + id2; + } + a_index += a_offset; + #else + const int a_index = id2*a_ld + id1 + a_offset; + #endif // Loads the current value of the A matrix const real avalue = agm[a_index]; |