From 7f14b11f1e240f12f5f6bf93cbbeab26001e9a5c Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Sun, 5 Mar 2017 11:13:47 +0100 Subject: Changed the way the test-data is generated: now using a single MT generator and distribution for all data --- test/correctness/testblas.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'test/correctness/testblas.cpp') 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 #include +#include +#include "utilities/utilities.hpp" #include "test/correctness/testblas.hpp" namespace clblast { @@ -88,13 +90,15 @@ TestBlas::TestBlas(const std::vector &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 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); } // =============================================================================================== -- cgit v1.2.3