Closed jeffhammond closed 6 years ago
There is a straightforward fix involving the use of std::shuffle, which was introduced in C++11. If this change is made, should it be guarded by BOOST_COMPUTE_USE_CPP11 or should it use something associated with C++14/17 so as to avoid breaking backwards-compatibility (of the pseudo-randomization) for C++11 (and possibly C++14) users?
I think your change is good. Thanks for it!
Also, do you have a preference on which PRNG to use? I used std::default_random_engine in my local modification, but that is the least reproducible, given that it is implementation-defined.
IMHO, it's a good choice.
Fixed in #761
LLVM's libc++ has implemented the deprecation and removal of
std::random_shuffle( RandomIt first, RandomIt last );
, which is used unconditionally in compute/algorithm/random_shuffle.hpp. https://github.com/llvm-mirror/libcxx/blob/master/include/algorithm#L3043 has details.There is a straightforward fix involving the use of
std::shuffle
, which was introduced in C++11. If this change is made, should it be guarded by BOOST_COMPUTE_USE_CPP11 or should it use something associated with C++14/17 so as to avoid breaking backwards-compatibility (of the pseudo-randomization) for C++11 (and possibly C++14) users?Also, do you have a preference on which PRNG to use? I used
std::default_random_engine
in my local modification, but that is the least reproducible, given that it is implementation-defined.I'll work on the fix once I know in which direction to go.
Details
It works fine with
-std=c++14
.