summaryrefslogtreecommitdiff
path: root/test/correctness/testblas.cpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-03-05 11:13:47 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2017-03-05 11:13:47 +0100
commit7f14b11f1e240f12f5f6bf93cbbeab26001e9a5c (patch)
tree1ef26380cac190c11a8eea68b90d05f0593c2738 /test/correctness/testblas.cpp
parentf9a520b3aff7b4eec99d9e11a03f9467e7ab351c (diff)
Changed the way the test-data is generated: now using a single MT generator and distribution for all data
Diffstat (limited to 'test/correctness/testblas.cpp')
-rw-r--r--test/correctness/testblas.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/correctness/testblas.cpp b/test/correctness/testblas.cpp
index d959ce18..505b3b36 100644
--- a/test/correctness/testblas.cpp
+++ b/test/correctness/testblas.cpp
@@ -13,7 +13,9 @@
#include <algorithm>
#include <iostream>
+#include <random>
+#include "utilities/utilities.hpp"
#include "test/correctness/testblas.hpp"
namespace clblast {
@@ -88,13 +90,15 @@ TestBlas<T,U>::TestBlas(const std::vector<std::string> &arguments, const bool si
c_source_.resize(std::max(max_mat, max_matvec)*std::max(max_ld, max_matvec) + max_offset);
ap_source_.resize(std::max(max_mat, max_matvec)*std::max(max_mat, max_matvec) + max_offset);
scalar_source_.resize(std::max(max_mat, max_matvec) + max_offset);
- PopulateVector(x_source_, kSeed);
- PopulateVector(y_source_, kSeed);
- PopulateVector(a_source_, kSeed);
- PopulateVector(b_source_, kSeed);
- PopulateVector(c_source_, kSeed);
- PopulateVector(ap_source_, kSeed);
- PopulateVector(scalar_source_, kSeed);
+ std::mt19937 mt(kSeed);
+ std::uniform_real_distribution<double> dist(kTestDataLowerLimit, kTestDataUpperLimit);
+ PopulateVector(x_source_, mt, dist);
+ PopulateVector(y_source_, mt, dist);
+ PopulateVector(a_source_, mt, dist);
+ PopulateVector(b_source_, mt, dist);
+ PopulateVector(c_source_, mt, dist);
+ PopulateVector(ap_source_, mt, dist);
+ PopulateVector(scalar_source_, mt, dist);
}
// ===============================================================================================