![]() |
alpaka
Abstraction Library for Parallel Kernel Acceleration
|
Common class for Philox family engines. More...
#include <PhiloxBaseCommon.hpp>
Public Types | |
| using | Counter = typename PhiloxStateless<T_Params>::Counter |
| using | Key = typename PhiloxStateless<T_Params>::Key |
| template<typename TDistributionResultScalar> | |
| using | ResultContainer = Vec<TDistributionResultScalar, T_Params::counterSize> |
| Distribution container type. | |
| using | State = PhiloxState<Counter, Key, T_Impl> |
| State type. | |
| Public Types inherited from alpaka::rand::engine::internal::PhiloxStateless< T_Params > | |
| using | Counter = alpaka::Vec<std::uint32_t, T_Params::counterSize> |
| using | Key = alpaka::Vec<std::uint32_t, T_Params::counterSize / 2> |
Public Member Functions | |
| constexpr | PhiloxBaseCommon (State &&state) |
Public Attributes | |
| State | state |
| Internal engine state. | |
Protected Member Functions | |
| constexpr void | skip4 (uint64_t offset) |
| Advance the internal state counter by offset N-vectors (N = counter size). | |
| constexpr void | skipSubsequence (uint64_t subsequence) |
| Advance the counter by the length of subsequence. | |
Static Protected Member Functions | |
| template<typename T, auto N> | |
| static constexpr void | advanceCounter (alpaka::Vec< T, N > &counter) |
| Advance the counter to the next state. | |
| Static Protected Member Functions inherited from alpaka::rand::engine::internal::PhiloxStateless< T_Params > | |
| static constexpr auto | bumpKey (Key const &key) |
| Bump the key by the Weyl sequence step parameter. | |
| static constexpr auto | nRounds (Counter const &counter_in, Key const &key_in) -> Counter |
| Performs N rounds of the Philox shuffle. | |
| static constexpr auto | singleRound (Counter const &counter, Key const &key) |
| Single round of the Philox shuffle. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from alpaka::rand::engine::internal::PhiloxStateless< T_Params > | |
| static constexpr auto | generate (Counter const &counter, Key const &key) -> Counter |
Generates a random number (TCounterSize x32-bit). | |
Common class for Philox family engines.
Relies on PhiloxStateless to provide the PRNG and adds state to handling the counting.
| T_Params | Philox algorithm parameters |
| T_Impl | engine type implementation (CRTP) |
static const data members are transformed into functions, because GCC assumes types with static data members to be not mappable and makes not exception for constexpr ones. This is a valid interpretation of the OpenMP <= 4.5 standard. In OpenMP >= 5.0 types with any kind of static data member are mappable.
Definition at line 26 of file PhiloxBaseCommon.hpp.
| using alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, T_Impl >::Counter = typename PhiloxStateless<T_Params>::Counter |
Definition at line 29 of file PhiloxBaseCommon.hpp.
| using alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, T_Impl >::Key = typename PhiloxStateless<T_Params>::Key |
Definition at line 30 of file PhiloxBaseCommon.hpp.
| using alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, T_Impl >::ResultContainer = Vec<TDistributionResultScalar, T_Params::counterSize> |
Distribution container type.
Definition at line 38 of file PhiloxBaseCommon.hpp.
| using alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, T_Impl >::State = PhiloxState<Counter, Key, T_Impl> |
State type.
Definition at line 32 of file PhiloxBaseCommon.hpp.
|
inlineexplicitconstexpr |
Definition at line 40 of file PhiloxBaseCommon.hpp.
|
inlinestaticconstexprprotected |
Advance the counter to the next state.
Increments the passed-in counter by one with a 128-bit carry.
| counter | reference to the counter which is to be advanced |
Definition at line 52 of file PhiloxBaseCommon.hpp.
|
inlineconstexprprotected |
Advance the internal state counter by offset N-vectors (N = counter size).
Advances the internal value of this->state.counter
| offset | number of N-vectors to skip |
Definition at line 77 of file PhiloxBaseCommon.hpp.
|
inlineconstexprprotected |
Advance the counter by the length of subsequence.
Advances the internal value of this->state.counter
| subsequence | number of subsequences to skip |
Definition at line 93 of file PhiloxBaseCommon.hpp.
| State alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, T_Impl >::state |
Internal engine state.
Definition at line 35 of file PhiloxBaseCommon.hpp.