![]() |
alpaka
Abstraction Library for Parallel Kernel Acceleration
|
Philox engine generating a vector of numbers. More...
#include <PhiloxVector.hpp>
Public Types | |
| using | Base = PhiloxBaseCommon<T_Params, PhiloxVector<T_Params>> |
| using | Counter = typename Base::Counter |
| Counter type. | |
| using | Key = typename Base::Key |
| Key type. | |
| template<typename TDistributionResultScalar> | |
| using | ResultContainer = typename Base::template ResultContainer<TDistributionResultScalar> |
| using | State = PhiloxState<Counter, Key, PhiloxVector<T_Params>> |
| Public Types inherited from alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, PhiloxVector< T_Params > > | |
| using | Counter |
| using | Key |
| using | ResultContainer |
| Distribution container type. | |
| using | State |
| 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 | PhiloxVector (uint64_t seed=0, uint64_t subsequence=0, uint64_t offset=0) |
| Construct a new Philox engine with vector output. | |
| constexpr auto | operator() () |
| Get the next vector of random numbers. | |
| Public Member Functions inherited from alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, PhiloxVector< T_Params > > | |
| constexpr | PhiloxBaseCommon (State &&state) |
Protected Member Functions | |
| constexpr auto | nextVector () |
| Get the next array of random numbers and advance internal state. | |
| constexpr void | skip (uint64_t offset) |
| Skips the next offset vectors. | |
| Protected Member Functions inherited from alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, PhiloxVector< T_Params > > | |
| 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. | |
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). | |
| Public Attributes inherited from alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, PhiloxVector< T_Params > > | |
| State | state |
| Internal engine state. | |
| Static Protected Member Functions inherited from alpaka::rand::engine::internal::PhiloxBaseCommon< T_Params, PhiloxVector< T_Params > > | |
| 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. | |
Philox engine generating a vector of numbers.
This engine's operator() will return a vector of numbers corresponding to the full size of its counter. This is a convenience vs. memory size tradeoff since the user has to deal with the output array themselves, but the internal state comprises only of a single counter and a key.
| T_Params | Basic parameters for the Philox algorithm |
Definition at line 21 of file PhiloxVector.hpp.
| using alpaka::rand::engine::internal::PhiloxVector< T_Params >::Base = PhiloxBaseCommon<T_Params, PhiloxVector<T_Params>> |
Definition at line 24 of file PhiloxVector.hpp.
| using alpaka::rand::engine::internal::PhiloxVector< T_Params >::Counter = typename Base::Counter |
Counter type.
Definition at line 27 of file PhiloxVector.hpp.
| using alpaka::rand::engine::internal::PhiloxVector< T_Params >::Key = typename Base::Key |
Key type.
Definition at line 29 of file PhiloxVector.hpp.
| using alpaka::rand::engine::internal::PhiloxVector< T_Params >::ResultContainer = typename Base::template ResultContainer<TDistributionResultScalar> |
Definition at line 32 of file PhiloxVector.hpp.
| using alpaka::rand::engine::internal::PhiloxVector< T_Params >::State = PhiloxState<Counter, Key, PhiloxVector<T_Params>> |
Definition at line 30 of file PhiloxVector.hpp.
|
inlineexplicitconstexpr |
Construct a new Philox engine with vector output.
| seed | Set the Philox generator key |
| subsequence | Select a subsequence of size 2^64 |
| offset | Skip offset numbers from the start of the subsequence |
Definition at line 62 of file PhiloxVector.hpp.
|
inlineconstexprprotected |
Get the next array of random numbers and advance internal state.
Definition at line 39 of file PhiloxVector.hpp.
|
inlineconstexpr |
Get the next vector of random numbers.
Definition at line 74 of file PhiloxVector.hpp.
|
inlineconstexprprotected |
Skips the next offset vectors.
Unlike its counterpart in PhiloxSingle, this function advances the state in multiples of the counter size thus skipping the entire array of numbers.
Definition at line 50 of file PhiloxVector.hpp.