alpaka
Abstraction Library for Parallel Kernel Acceleration
|
#include <RandPhilox.hpp>
Public Types | |
using | EngineParams = engine::PhiloxParams< 4, 32, 10 > |
Philox algorithm: 10 rounds, 4 numbers of size 32. More... | |
using | EngineVariant = engine::PhiloxSingle< EngineParams > |
Engine outputs a single number. More... | |
using | result_type = std::uint32_t |
Public Member Functions | |
ALPAKA_FN_HOST_ACC | Philox4x32x10 (std::uint64_t const seed=0, std::uint64_t const subsequence=0, std::uint64_t const offset=0) |
constexpr ALPAKA_FN_HOST_ACC auto | max () -> result_type |
constexpr ALPAKA_FN_HOST_ACC auto | min () -> result_type |
ALPAKA_FN_HOST_ACC auto | operator() () -> result_type |
Most common Philox engine variant, outputs single number
This is a variant of the Philox engine generator which outputs a single float. The counter size is bits. Since the engine returns a single number, the generated result, which has the same size as the counter, has to be stored between invocations. Additionally a 32 bit pointer is stored. The total size of the state is 352 bits = 44 bytes.
Ref.: J. K. Salmon, M. A. Moraes, R. O. Dror and D. E. Shaw, "Parallel random numbers: As easy as 1, 2, 3," SC '11: Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis, 2011, pp. 1-12, doi: 10.1145/2063384.2063405.
Definition at line 31 of file RandPhilox.hpp.
using alpaka::rand::Philox4x32x10::EngineParams = engine::PhiloxParams<4, 32, 10> |
Philox algorithm: 10 rounds, 4 numbers of size 32.
Definition at line 35 of file RandPhilox.hpp.
Engine outputs a single number.
Definition at line 37 of file RandPhilox.hpp.
using alpaka::rand::Philox4x32x10::result_type = std::uint32_t |
Definition at line 55 of file RandPhilox.hpp.
|
inline |
Initialize a new Philox engine
seed | Set the Philox generator key |
subsequence | Select a subsequence of size 2^64 |
offset | Skip offset numbers form the start of the subsequence |
Definition at line 45 of file RandPhilox.hpp.
|
inlineconstexpr |
Definition at line 62 of file RandPhilox.hpp.
|
inlineconstexpr |
Definition at line 57 of file RandPhilox.hpp.
|
inline |
Definition at line 67 of file RandPhilox.hpp.