summaryrefslogtreecommitdiff
path: root/src/utilities/buffer_test.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilities/buffer_test.hpp')
-rw-r--r--src/utilities/buffer_test.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/utilities/buffer_test.hpp b/src/utilities/buffer_test.hpp
index fd071434..9cecce97 100644
--- a/src/utilities/buffer_test.hpp
+++ b/src/utilities/buffer_test.hpp
@@ -15,6 +15,9 @@
#ifndef CLBLAST_BUFFER_TEST_H_
#define CLBLAST_BUFFER_TEST_H_
+#include <algorithm>
+#include <vector>
+
#include "utilities/utilities.hpp"
namespace clblast {
@@ -105,6 +108,32 @@ void TestVectorIndex(const size_t n, const Buffer<T> &buffer, const size_t offse
}
// =================================================================================================
+
+// Tests matrix 'A' for validity in a batched setting
+template <typename T>
+void TestBatchedMatrixA(const size_t one, const size_t two, const Buffer<T>& buffer,
+ const std::vector<size_t> &offsets, const size_t ld, const bool test_lead_dim = true) {
+ const auto max_offset = *std::max_element(offsets.begin(), offsets.end());
+ TestMatrixA(one, two, buffer, max_offset, ld, test_lead_dim);
+}
+
+// Tests matrix 'B' for validity in a batched setting
+template <typename T>
+void TestBatchedMatrixB(const size_t one, const size_t two, const Buffer<T>& buffer,
+ const std::vector<size_t>& offsets, const size_t ld, const bool test_lead_dim = true) {
+ const auto max_offset = *std::max_element(offsets.begin(), offsets.end());
+ TestMatrixB(one, two, buffer, max_offset, ld, test_lead_dim);
+}
+
+// Tests matrix 'C' for validity in a batched setting
+template <typename T>
+void TestBatchedMatrixC(const size_t one, const size_t two, const Buffer<T>& buffer,
+ const std::vector<size_t>& offsets, const size_t ld) {
+ const auto max_offset = *std::max_element(offsets.begin(), offsets.end());
+ TestMatrixC(one, two, buffer, max_offset, ld);
+}
+
+// =================================================================================================
} // namespace clblast
// CLBLAST_BUFFER_TEST_H_