diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/correctness/testblas.cpp | 14 | ||||
-rw-r--r-- | test/correctness/testblas.hpp | 1 | ||||
-rw-r--r-- | test/performance/client.cpp | 14 | ||||
-rw-r--r-- | test/performance/client.hpp | 1 |
4 files changed, 16 insertions, 14 deletions
diff --git a/test/correctness/testblas.cpp b/test/correctness/testblas.cpp index 2e751255..fc908b9e 100644 --- a/test/correctness/testblas.cpp +++ b/test/correctness/testblas.cpp @@ -66,13 +66,13 @@ TestBlas<T,U>::TestBlas(int argc, char *argv[], const bool silent, 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_); - PopulateVector(y_source_); - PopulateVector(a_source_); - PopulateVector(b_source_); - PopulateVector(c_source_); - PopulateVector(ap_source_); - PopulateVector(scalar_source_); + 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); } // =============================================================================================== diff --git a/test/correctness/testblas.hpp b/test/correctness/testblas.hpp index d01cd06c..4b773801 100644 --- a/test/correctness/testblas.hpp +++ b/test/correctness/testblas.hpp @@ -30,6 +30,7 @@ namespace clblast { template <typename T, typename U> class TestBlas: public Tester<T,U> { public: + static constexpr auto kSeed = 42; // fixed seed for reproducibility // Uses several variables from the Tester class using Tester<T,U>::context_; diff --git a/test/performance/client.cpp b/test/performance/client.cpp index aaaab22e..cbb10d10 100644 --- a/test/performance/client.cpp +++ b/test/performance/client.cpp @@ -178,13 +178,13 @@ void Client<T,U>::PerformanceTest(Arguments<U> &args, const SetMetric set_sizes) std::vector<T> c_source(args.c_size); std::vector<T> ap_source(args.ap_size); std::vector<T> scalar_source(args.scalar_size); - PopulateVector(x_source); - PopulateVector(y_source); - PopulateVector(a_source); - PopulateVector(b_source); - PopulateVector(c_source); - PopulateVector(ap_source); - PopulateVector(scalar_source); + 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); // Creates the matrices on the device auto x_vec = Buffer<T>(context, args.x_size); diff --git a/test/performance/client.hpp b/test/performance/client.hpp index 6d35fced..381ba158 100644 --- a/test/performance/client.hpp +++ b/test/performance/client.hpp @@ -40,6 +40,7 @@ namespace clblast { template <typename T, typename U> class Client { public: + static constexpr auto kSeed = 42; // fixed seed for reproducibility // Shorthand for the routine-specific functions passed to the tester using Routine = std::function<StatusCode(const Arguments<U>&, Buffers<T>&, Queue&)>; |