alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::rand::engine::internal::PhiloxStateless< T_Params > Class Template Reference

Class basic Philox family counter-based PRNG. More...

#include <PhiloxStateless.hpp>

Inheritance diagram for alpaka::rand::engine::internal::PhiloxStateless< T_Params >:

Public Types

using Counter = alpaka::Vec<std::uint32_t, T_Params::counterSize>
using Key = alpaka::Vec<std::uint32_t, T_Params::counterSize / 2>

Static Public Member Functions

static constexpr auto generate (Counter const &counter, Key const &key) -> Counter
 Generates a random number (TCounterSize x32-bit).

Static Protected Member Functions

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.

Static Private Member Functions

static constexpr unsigned numberWidth ()
static constexpr unsigned numRounds ()
static constexpr unsigned vectorSize ()

Detailed Description

template<typename T_Params>
class alpaka::rand::engine::internal::PhiloxStateless< T_Params >

Class basic Philox family counter-based PRNG.

Checks the validity of passed-in parameters and calls the backend methods to perform N rounds of the Philox shuffle.

Template Parameters
T_ParamsPhilox algorithm parameters
See also
PhiloxParams

Definition at line 38 of file PhiloxStateless.hpp.

Member Typedef Documentation

◆ Counter

template<typename T_Params>
using alpaka::rand::engine::internal::PhiloxStateless< T_Params >::Counter = alpaka::Vec<std::uint32_t, T_Params::counterSize>

Definition at line 63 of file PhiloxStateless.hpp.

◆ Key

template<typename T_Params>
using alpaka::rand::engine::internal::PhiloxStateless< T_Params >::Key = alpaka::Vec<std::uint32_t, T_Params::counterSize / 2>

Definition at line 64 of file PhiloxStateless.hpp.

Member Function Documentation

◆ bumpKey()

template<typename T_Params>
constexpr auto alpaka::rand::engine::internal::PhiloxStateless< T_Params >::bumpKey ( Key const & key)
inlinestaticconstexprprotected

Bump the key by the Weyl sequence step parameter.

Parameters
keythe key to be bumped
Returns
the bumped key

Definition at line 86 of file PhiloxStateless.hpp.

◆ generate()

template<typename T_Params>
constexpr auto alpaka::rand::engine::internal::PhiloxStateless< T_Params >::generate ( Counter const & counter,
Key const & key ) -> Counter
inlinestaticconstexpr

Generates a random number (TCounterSize x32-bit).

Parameters
counterinitial state of the counter
keyinitial state of the key
Returns
result of the PRNG shuffle; has the same size as the counter

Definition at line 121 of file PhiloxStateless.hpp.

◆ nRounds()

template<typename T_Params>
constexpr auto alpaka::rand::engine::internal::PhiloxStateless< T_Params >::nRounds ( Counter const & counter_in,
Key const & key_in ) -> Counter
inlinestaticconstexprprotected

Performs N rounds of the Philox shuffle.

Parameters
counter_ininitial state of the counter
key_ininitial state of the key
Returns
result of the PRNG shuffle; has the same size as the counter

Definition at line 97 of file PhiloxStateless.hpp.

◆ numberWidth()

template<typename T_Params>
constexpr unsigned alpaka::rand::engine::internal::PhiloxStateless< T_Params >::numberWidth ( )
inlinestaticconstexprprivate

Definition at line 50 of file PhiloxStateless.hpp.

◆ numRounds()

template<typename T_Params>
constexpr unsigned alpaka::rand::engine::internal::PhiloxStateless< T_Params >::numRounds ( )
inlinestaticconstexprprivate

Definition at line 40 of file PhiloxStateless.hpp.

◆ singleRound()

template<typename T_Params>
constexpr auto alpaka::rand::engine::internal::PhiloxStateless< T_Params >::singleRound ( Counter const & counter,
Key const & key )
inlinestaticconstexprprotected

Single round of the Philox shuffle.

Parameters
counterstate of the counter
keyvalue of the key
Returns
shuffled counter

Definition at line 73 of file PhiloxStateless.hpp.

◆ vectorSize()

template<typename T_Params>
constexpr unsigned alpaka::rand::engine::internal::PhiloxStateless< T_Params >::vectorSize ( )
inlinestaticconstexprprivate

Definition at line 45 of file PhiloxStateless.hpp.


The documentation for this class was generated from the following file: