Skip to content

Commit 8afdc29

Browse files
committed
Replacing the random number generator with a one that has 64-bit key
1 parent 8f8eedb commit 8afdc29

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎cpp/include/raft/random/detail/permute.cuh‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <cooperative_groups.h>
1414
#include <cuda/iterator>
1515
#include <cuda/std/random>
16+
#include <thrust/random.h>
1617

1718
namespace raft {
1819
namespace random {
@@ -211,8 +212,11 @@ void permute(IntType* perms,
211212
uint64_t key)
212213
{
213214
if (N <= 0 || (perms == nullptr && out == nullptr)) { return; }
214-
215-
cuda::shuffle_iterator shuffled_indices{cuda::random_bijection{N, cuda::std::minstd_rand{key}}};
215+
thrust::random::ranlux48 rng(key);
216+
cuda::shuffle_iterator shuffled_indices
217+
{
218+
cuda::random_bijection { N, rng }
219+
}
216220

217221
if (out == nullptr) {
218222
constexpr int ITEMS_PER_THREAD = 8;

0 commit comments

Comments
 (0)