diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-03-05 11:13:47 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-03-05 11:13:47 +0100 |
commit | 7f14b11f1e240f12f5f6bf93cbbeab26001e9a5c (patch) | |
tree | 1ef26380cac190c11a8eea68b90d05f0593c2738 /src/tuning/tuning.hpp | |
parent | f9a520b3aff7b4eec99d9e11a03f9467e7ab351c (diff) |
Changed the way the test-data is generated: now using a single MT generator and distribution for all data
Diffstat (limited to 'src/tuning/tuning.hpp')
-rw-r--r-- | src/tuning/tuning.hpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/tuning/tuning.hpp b/src/tuning/tuning.hpp index 1dd76894..7060fc9f 100644 --- a/src/tuning/tuning.hpp +++ b/src/tuning/tuning.hpp @@ -17,6 +17,7 @@ #include <vector> #include <string> +#include <random> #include <cltune.h> @@ -77,12 +78,14 @@ void Tuner(int argc, char* argv[]) { auto b_mat = std::vector<T>(C::GetSizeB(args)); auto c_mat = std::vector<T>(C::GetSizeC(args)); auto temp = std::vector<T>(C::GetSizeTemp(args)); - PopulateVector(x_vec, kSeed); - PopulateVector(y_vec, kSeed); - PopulateVector(a_mat, kSeed); - PopulateVector(b_mat, kSeed); - PopulateVector(c_mat, kSeed); - PopulateVector(temp, kSeed); + std::mt19937 mt(kSeed); + std::uniform_real_distribution<double> dist(kTestDataLowerLimit, kTestDataUpperLimit); + PopulateVector(x_vec, mt, dist); + PopulateVector(y_vec, mt, dist); + PopulateVector(a_mat, mt, dist); + PopulateVector(b_mat, mt, dist); + PopulateVector(c_mat, mt, dist); + PopulateVector(temp, mt, dist); // Initializes the tuner for the chosen device cltune::Tuner tuner(args.platform_id, args.device_id); |