| 8 | |
| 9 | template<typename B> |
| 10 | Source_random_fast<B>::Source_random_fast(const int K, const int seed) |
| 11 | : spu::module::Source<B>(K) |
| 12 | , mt19937(seed) |
| 13 | , mt19937_simd() |
| 14 | { |
| 15 | const std::string name = "Source_random_fast"; |
| 16 | this->set_name(name); |
| 17 | for (auto& t : this->tasks) |
| 18 | t->set_replicability(true); |
| 19 | |
| 20 | mipp::vector<int> seeds(mipp::nElReg<int>()); |
| 21 | for (auto i = 0; i < mipp::nElReg<int>(); i++) |
| 22 | seeds[i] = mt19937.rand(); |
| 23 | mt19937_simd.seed(seeds.data()); |
| 24 | } |
| 25 | |
| 26 | template<typename B> |
| 27 | Source_random_fast<B>* |