With -Wconversion I get a warning:
../thirdparty/alpaka-0.4.1/include/alpaka/rand/TinyMT/tinymt32.h:216:33: warning: conversion to ‘float’ from ‘uint32_t {aka unsigned int}’ may alter its value [-Wconversion]
return (tinymt32_temper(random) >> 8) * TINYMT32_MUL;
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
I fixed it by explicitly stating the conversion:
return float(tinymt32_temper(random) >> 8) * TINYMT32_MUL;
I can not find a place where alpaka is ever calling the tinymt32_generate_float method which contains this code. Did you directly call this method or what am I mising?
Or did the compiler generate this error while parsing the code without ever calling it?
No, we don't call it. I don't know what TinyMT is for.
I guess the compiler generate this error while parsing the code, since there is no template involved.
TinyMT is our CPU-side RNG backend #579 that does not occupy all RAM with RNG states alone #575 in production scenarios.
We use it from
https://github.com/MersenneTwister-Lab/TinyMT
and I applied already quite a bunch of fixes to mitigate warnings. We cropped it together in a single header, which might cause the warning even when not called explicitly.
Your proposed fix looks valid, do you want to propose it as a PR? :)
Upstream refs.:
I merged a fix into the develop branch.
Thanks!
Most helpful comment
TinyMT is our CPU-side RNG backend #579 that does not occupy all RAM with RNG states alone #575 in production scenarios.
We use it from
https://github.com/MersenneTwister-Lab/TinyMT
and I applied already quite a bunch of fixes to mitigate warnings. We cropped it together in a single header, which might cause the warning even when not called explicitly.
Your proposed fix looks valid, do you want to propose it as a PR? :)
Upstream refs.: