diff options
author | CNugteren <web@cedricnugteren.nl> | 2015-09-14 12:28:50 +0200 |
---|---|---|
committer | CNugteren <web@cedricnugteren.nl> | 2015-09-14 12:28:50 +0200 |
commit | e0c5312abb6f5b1c0e413fe69a8c7c46215cd3ae (patch) | |
tree | a0254f98b780e117a73b9aa7f38d2eb9e4c131ab /src | |
parent | b0b81deae1b159fe625924a2722e9940a0128152 (diff) |
Added support for the dot buffer and offset argument
Diffstat (limited to 'src')
-rw-r--r-- | src/routine.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/routine.cc b/src/routine.cc index 31476c42..05a03683 100644 --- a/src/routine.cc +++ b/src/routine.cc @@ -223,6 +223,21 @@ StatusCode Routine<T>::TestVectorY(const size_t n, const Buffer<T> &buffer, cons // ================================================================================================= +// Tests vector dot for validity: checks for a valid increment, a valid OpenCL buffer, and for a +// sufficient buffer size. +template <typename T> +StatusCode Routine<T>::TestVectorDot(const size_t n, const Buffer<T> &buffer, const size_t offset, + const size_t data_size) { + try { + auto required_size = (n + offset)*data_size; + auto buffer_size = buffer.GetSize(); + if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryDot; } + } catch (...) { return StatusCode::kInvalidVectorDot; } + return StatusCode::kSuccess; +} + +// ================================================================================================= + // Copies or transposes a matrix and pads/unpads it with zeros template <typename T> StatusCode Routine<T>::PadCopyTransposeMatrix(const size_t src_one, const size_t src_two, |