mem-ruby,misc: Fix RNG range (#1842)

This upper range must be `UINT_MAX - 1`. This was previously fixed but
reverted back. Without this the RNG crashes.
This commit is contained in:
Bobby R. Bruce
2024-12-06 21:53:48 -08:00
parent 26ba6dad80
commit ae60062a9e

View File

@@ -64,9 +64,10 @@ AddressManager::AddressManager(int n_atomic_locs, int n_normal_locs_per_atomic)
randAddressMap.begin(),
randAddressMap.end(),
// TODO: This is a bug unrelated to this draft PR but the GPU tester is
// useful for testing this PR.
std::default_random_engine(rng->random<unsigned>(0,UINT_MAX))
// Note: This RNG has an upper bound of UINT_MAX - 1. This will fail
// if the number of locations exceeds this value. Please do not
// change this.
std::default_random_engine(rng->random<unsigned>(0,UINT_MAX - 1))
);
// initialize atomic locations