summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-05-01 14:03:37 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-05-01 14:03:37 +0200
commitbee2f943ec51a3482e89cf635a2d12b6b6d96b04 (patch)
treefc93c1bef6fa19846959e55685129f439e6cfce9 /include
parent9602c150aa3b7f0a392207bef8cbb6048b1da891 (diff)
Changed the index buffer of IxAMAX routines to unsigned int for proper buffersize checking
Diffstat (limited to 'include')
-rw-r--r--include/internal/routine.h6
-rw-r--r--include/internal/routines/level1/xamax.h4
-rw-r--r--include/internal/routines/level1/xmax.h2
-rw-r--r--include/internal/routines/level1/xmin.h2
4 files changed, 9 insertions, 5 deletions
diff --git a/include/internal/routine.h b/include/internal/routine.h
index f2f236ac..6df186c5 100644
--- a/include/internal/routine.h
+++ b/include/internal/routine.h
@@ -62,13 +62,17 @@ class Routine {
StatusCode TestMatrixAP(const size_t n, const Buffer<T> &buffer,
const size_t offset, const size_t data_size);
- // Tests for valid inputs of vectors X and Y
+ // Tests for valid inputs of vector X and Y
StatusCode TestVectorX(const size_t n, const Buffer<T> &buffer, const size_t offset,
const size_t inc, const size_t data_size);
StatusCode TestVectorY(const size_t n, const Buffer<T> &buffer, const size_t offset,
const size_t inc, const size_t data_size);
+
+ // Tests for valid inputs of other vectors
StatusCode TestVectorDot(const size_t n, const Buffer<T> &buffer, const size_t offset,
const size_t data_size);
+ StatusCode TestVectorIndex(const size_t n, const Buffer<unsigned int> &buffer,
+ const size_t offset, const size_t data_size);
// Copies/transposes a matrix and padds/unpads it with zeroes. This method is also able to write
// to symmetric and triangular matrices through optional arguments.
diff --git a/include/internal/routines/level1/xamax.h b/include/internal/routines/level1/xamax.h
index b815e8d2..c318115e 100644
--- a/include/internal/routines/level1/xamax.h
+++ b/include/internal/routines/level1/xamax.h
@@ -32,7 +32,7 @@ class Xamax: public Routine<T> {
using Routine<T>::context_;
using Routine<T>::GetProgramFromCache;
using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorDot;
+ using Routine<T>::TestVectorIndex;
using Routine<T>::RunKernel;
using Routine<T>::ErrorIn;
@@ -41,7 +41,7 @@ class Xamax: public Routine<T> {
// Templated-precision implementation of the routine
StatusCode DoAmax(const size_t n,
- const Buffer<T> &imax_buffer, const size_t imax_offset,
+ const Buffer<unsigned int> &imax_buffer, const size_t imax_offset,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc);
private:
diff --git a/include/internal/routines/level1/xmax.h b/include/internal/routines/level1/xmax.h
index 860a043b..a872cede 100644
--- a/include/internal/routines/level1/xmax.h
+++ b/include/internal/routines/level1/xmax.h
@@ -36,7 +36,7 @@ class Xmax: public Xamax<T> {
// Forwards to the regular absolute version. The implementation difference is realised in the
// kernel through a pre-processor macro based on the name of the routine.
StatusCode DoMax(const size_t n,
- const Buffer<T> &imax_buffer, const size_t imax_offset,
+ const Buffer<unsigned int> &imax_buffer, const size_t imax_offset,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc) {
return DoAmax(n, imax_buffer, imax_offset, x_buffer, x_offset, x_inc);
}
diff --git a/include/internal/routines/level1/xmin.h b/include/internal/routines/level1/xmin.h
index 4c99a5ad..700c81cc 100644
--- a/include/internal/routines/level1/xmin.h
+++ b/include/internal/routines/level1/xmin.h
@@ -36,7 +36,7 @@ class Xmin: public Xamax<T> {
// Forwards to the regular max-absolute version. The implementation difference is realised in the
// kernel through a pre-processor macro based on the name of the routine.
StatusCode DoMin(const size_t n,
- const Buffer<T> &imin_buffer, const size_t imin_offset,
+ const Buffer<unsigned int> &imin_buffer, const size_t imin_offset,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc) {
return DoAmax(n, imin_buffer, imin_offset, x_buffer, x_offset, x_inc);
}