Open orralus opened 6 years ago
Can you try using boost::compute::threefry_engine
instead of default_random_engine
?
Same as in https://github.com/boostorg/compute/issues/745
GPUdistribution.generate(vec2.begin(), vec2.end(), engine ,queue); does not compile
Which version of boost are you using?
1.61
Can you try the newest boost? I think this got fixed in #747
Upgraded to 1.67 and problem is persistent
Apparently the threefry.hpp here is not the same as the one which comes with 1.67
That's possible. I don't know when @kylelutz merged those changes into master
.
I think it settles the randomness issue but apparently it fills the device memory from some reason after several iterations.
"terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector
does threefry allocate memory somewhere? I think it is because it builds new kernels and program in every generation (in the private function load_program).
all program generation is cached and the cache size is limited (i think 32 or 64 programs). load_program is also called only in the constructor.
I try to generate vector of random number multiple times and it seems to generate the same vector
for example
... auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count(); compute::default_random_engine engine(queue,seed); compute::uniform_real_distribution GPUdistribution(0.0, 1.0);
for (int t=0; t<T;t++) {
...
GPUdistribution.generate(vec2.begin(), vec2.end(),engine,queue);
...
}
Is it necessary to destroy and regenerate engine with new seed at each iteration to get proper results? Thanks