[BUG]: CUB's c2h::gen(...) RNG utility only outputs positive non-zero floating point numbers. #617
Closed
1 task done
Labels
bug
Something isn't working right.
Is this a duplicate?
Type of Bug
Something else
Component
CUB
Describe the bug
The catch2 testing utilities provide a random number generator that, by default, produces random numbers in the range
[numeric_limits<T>::min(), numeric_limits<T>::max()]
.For floats,
numeric_limits<T>::min()
does not return the most negative value, but rather the smallest representable positive finite value. To cover the entire range, we should be usinglowest()
.However, the quick fix of changing the definition to use
lowest()
causes all output values to beinf
, since computing random numbers with(max - lowest) * rand + lowest
.How to Reproduce
c2h::gen
for double types. No negative or zero values appear.lowest()
instead ofmin()
. All values areinf
.Expected behavior
The entire range of possible values should be sampled in the output.
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: