summaryrefslogtreecommitdiff
path: root/src/routine.cc
diff options
context:
space:
mode:
authorCNugteren <web@cedricnugteren.nl>2015-09-19 17:37:42 +0200
committerCNugteren <web@cedricnugteren.nl>2015-09-19 17:37:42 +0200
commitc32c4a973928536850aab594239000ce6ddc2c5a (patch)
tree84201b770ea6ae84c902ff94e7154cb5bb1cbe90 /src/routine.cc
parentaebd156869738f88c21a78a8df27e391e67da39b (diff)
Added infrastructure for packed matrices
Diffstat (limited to 'src/routine.cc')
-rw-r--r--src/routine.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/routine.cc b/src/routine.cc
index 05a03683..2978c94a 100644
--- a/src/routine.cc
+++ b/src/routine.cc
@@ -191,6 +191,18 @@ StatusCode Routine<T>::TestMatrixC(const size_t one, const size_t two, const Buf
return StatusCode::kSuccess;
}
+// Tests matrix AP for validity: checks for a valid OpenCL buffer and for a sufficient buffer size
+template <typename T>
+StatusCode Routine<T>::TestMatrixAP(const size_t n, const Buffer<T> &buffer,
+ const size_t offset, const size_t data_size) {
+ try {
+ auto required_size = (((n*(n+1))/2) + offset)*data_size;
+ auto buffer_size = buffer.GetSize();
+ if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryA; }
+ } catch (...) { return StatusCode::kInvalidMatrixA; }
+ return StatusCode::kSuccess;
+}
+
// =================================================================================================
// Tests vector X for validity: checks for a valid increment, a valid OpenCL buffer, and for a