-
Notifications
You must be signed in to change notification settings - Fork 113
[oneMath][RNG] Add PCG64 DXSM generator to Device API #621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[oneMath][RNG] Add PCG64 DXSM generator to Device API #621
Conversation
66c8015
to
b861466
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
- Description | ||
* - `pcg64_dxsm()`_ | ||
- Default constructor | ||
* - `pcg64_dxsm(std::uint64_t seed, std::uint64_t offset = 0)`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a question about constructors: how big pcg64_dxsm state is? Two questions:
- whether initial seed should be 32 or 64 bits (other oneMKL engines may have different once)
- do we need initializer_list versions at all? (e.g. mcg59 https://github.com/uxlfoundation/oneAPI-spec/blob/main/source/elements/oneMath/source/domains/rng/device_api/device-rng-mcg59.rst has only 64-bit uint state, thus it doesn't need to have extra constructors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The state of the engine has 128 bits. This way initializer_list
is needed to fully occupy the state. Same applies to offset as period is 2^128.
About the seed, I suggest to keep it 64 bits, as it will populate half of the state.
The PCG is a family of random number generators based on linear congruential generator (LCG). The algorithm applies permutation function to improve statistical properties of LCG.
PCG64 DXSM uses
double xorshift multiply
output function and has a period of 2^128.Added new page for the engine, modified bibliography and engines overview.