summaryrefslogtreecommitdiff
path: root/test/correctness/testblas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/correctness/testblas.cpp')
-rw-r--r--test/correctness/testblas.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/correctness/testblas.cpp b/test/correctness/testblas.cpp
index d28aba40..0d0ce7c6 100644
--- a/test/correctness/testblas.cpp
+++ b/test/correctness/testblas.cpp
@@ -124,6 +124,7 @@ void TestBlas<T,U>::TestRegular(std::vector<Arguments<U>> &test_vector, const st
auto c_mat2 = Buffer<T>(context_, args.c_size);
auto ap_mat2 = Buffer<T>(context_, args.ap_size);
auto scalar2 = Buffer<T>(context_, args.scalar_size);
+ auto scalar_uint2 = Buffer<unsigned int>(context_, args.scalar_size);
x_vec2.Write(queue_, args.x_size, x_source_);
y_vec2.Write(queue_, args.y_size, y_source_);
a_mat2.Write(queue_, args.a_size, a_source_);
@@ -131,7 +132,7 @@ void TestBlas<T,U>::TestRegular(std::vector<Arguments<U>> &test_vector, const st
c_mat2.Write(queue_, args.c_size, c_source_);
ap_mat2.Write(queue_, args.ap_size, ap_source_);
scalar2.Write(queue_, args.scalar_size, scalar_source_);
- auto buffers2 = Buffers<T>{x_vec2, y_vec2, a_mat2, b_mat2, c_mat2, ap_mat2, scalar2};
+ auto buffers2 = Buffers<T>{x_vec2, y_vec2, a_mat2, b_mat2, c_mat2, ap_mat2, scalar2, scalar_uint2};
// Runs CLBlast
if (verbose_) {
@@ -158,6 +159,7 @@ void TestBlas<T,U>::TestRegular(std::vector<Arguments<U>> &test_vector, const st
auto c_mat1 = Buffer<T>(context_, args.c_size);
auto ap_mat1 = Buffer<T>(context_, args.ap_size);
auto scalar1 = Buffer<T>(context_, args.scalar_size);
+ auto scalar_uint1 = Buffer<unsigned int>(context_, args.scalar_size);
x_vec1.Write(queue_, args.x_size, x_source_);
y_vec1.Write(queue_, args.y_size, y_source_);
a_mat1.Write(queue_, args.a_size, a_source_);
@@ -165,7 +167,7 @@ void TestBlas<T,U>::TestRegular(std::vector<Arguments<U>> &test_vector, const st
c_mat1.Write(queue_, args.c_size, c_source_);
ap_mat1.Write(queue_, args.ap_size, ap_source_);
scalar1.Write(queue_, args.scalar_size, scalar_source_);
- auto buffers1 = Buffers<T>{x_vec1, y_vec1, a_mat1, b_mat1, c_mat1, ap_mat1, scalar1};
+ auto buffers1 = Buffers<T>{x_vec1, y_vec1, a_mat1, b_mat1, c_mat1, ap_mat1, scalar1, scalar_uint1};
// Runs the reference code
if (verbose_) {
@@ -221,6 +223,9 @@ void TestBlas<T,U>::TestRegular(std::vector<Arguments<U>> &test_vector, const st
// Checks for differences in the 'canary' region to detect buffer overflows
for (auto canary_id=size_t{0}; canary_id<kCanarySize; ++canary_id) {
auto index = get_index_(args, get_id1_(args) - 1, get_id2_(args) - 1) + canary_id;
+ if (index >= result1.size() || index >= result2.size()) {
+ continue;
+ }
if (!TestSimilarity(result1[index], result2[index])) {
errors++;
if (verbose_) {
@@ -273,6 +278,7 @@ void TestBlas<T,U>::TestInvalid(std::vector<Arguments<U>> &test_vector, const st
auto c_mat1 = CreateInvalidBuffer<T>(context_, args.c_size);
auto ap_mat1 = CreateInvalidBuffer<T>(context_, args.ap_size);
auto scalar1 = CreateInvalidBuffer<T>(context_, args.scalar_size);
+ auto scalar_uint1 = CreateInvalidBuffer<unsigned int>(context_, args.scalar_size);
auto x_vec2 = CreateInvalidBuffer<T>(context_, args.x_size);
auto y_vec2 = CreateInvalidBuffer<T>(context_, args.y_size);
auto a_mat2 = CreateInvalidBuffer<T>(context_, args.a_size);
@@ -280,8 +286,9 @@ void TestBlas<T,U>::TestInvalid(std::vector<Arguments<U>> &test_vector, const st
auto c_mat2 = CreateInvalidBuffer<T>(context_, args.c_size);
auto ap_mat2 = CreateInvalidBuffer<T>(context_, args.ap_size);
auto scalar2 = CreateInvalidBuffer<T>(context_, args.scalar_size);
- auto buffers1 = Buffers<T>{x_vec1, y_vec1, a_mat1, b_mat1, c_mat1, ap_mat1, scalar1};
- auto buffers2 = Buffers<T>{x_vec2, y_vec2, a_mat2, b_mat2, c_mat2, ap_mat2, scalar2};
+ auto scalar_uint2 = CreateInvalidBuffer<unsigned int>(context_, args.scalar_size);
+ auto buffers1 = Buffers<T>{x_vec1, y_vec1, a_mat1, b_mat1, c_mat1, ap_mat1, scalar1, scalar_uint1};
+ auto buffers2 = Buffers<T>{x_vec2, y_vec2, a_mat2, b_mat2, c_mat2, ap_mat2, scalar2, scalar_uint2};
// Runs CLBlast
if (verbose_) {