alpaka
Abstraction Library for Parallel Kernel Acceleration
alpaka::rand::engine::PhiloxStateless< TParams > Class Template Reference

#include <PhiloxStateless.hpp>

+ Inheritance diagram for alpaka::rand::engine::PhiloxStateless< TParams >:

Public Types

using Constants = PhiloxConstants< TParams >
 
using Counter = alpaka::Vec< alpaka::DimInt< TParams::counterSize >, std::uint32_t >
 
using Key = alpaka::Vec< alpaka::DimInt< TParams::counterSize/2 >, std::uint32_t >
 

Static Public Member Functions

static ALPAKA_FN_HOST_ACC auto generate (Counter const &counter, Key const &key) -> Counter
 
- Static Public Member Functions inherited from alpaka::rand::engine::PhiloxConstants< TParams >
static constexpr std::uint32_t MULTIPLITER_4x32_0 ()
 First Philox S-box multiplier. More...
 
static constexpr std::uint32_t MULTIPLITER_4x32_1 ()
 Second Philox S-box multiplier. More...
 
static constexpr std::uint32_t WEYL_32_0 ()
 1st Weyl sequence parameter, 32 bits More...
 
static constexpr std::uint32_t WEYL_32_1 ()
 2nd Weyl sequence parameter, 32 bits More...
 
static constexpr std::uint64_t WEYL_64_0 ()
 First Weyl sequence parameter: the golden ratio. More...
 
static constexpr std::uint64_t WEYL_64_1 ()
 Second Weyl sequence parameter: $ \sqrt{3}-1 $. More...
 

Static Protected Member Functions

static ALPAKA_FN_HOST_ACC auto bumpKey (Key const &key)
 
static ALPAKA_FN_HOST_ACC auto nRounds (Counter const &counter_in, Key const &key_in) -> Counter
 
static ALPAKA_FN_HOST_ACC auto singleRound (Counter const &counter, Key const &key)
 

Detailed Description

template<typename TParams>
class alpaka::rand::engine::PhiloxStateless< TParams >

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
TParamsPhilox algorithm parameters
See also
PhiloxParams

Definition at line 38 of file PhiloxStateless.hpp.

Member Typedef Documentation

◆ Constants

template<typename TParams >
using alpaka::rand::engine::PhiloxStateless< TParams >::Constants = PhiloxConstants<TParams>

Definition at line 65 of file PhiloxStateless.hpp.

◆ Counter

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

Definition at line 63 of file PhiloxStateless.hpp.

◆ Key

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

Definition at line 64 of file PhiloxStateless.hpp.

Member Function Documentation

◆ bumpKey()

template<typename TParams >
static ALPAKA_FN_HOST_ACC auto alpaka::rand::engine::PhiloxStateless< TParams >::bumpKey ( Key const &  key)
inlinestaticprotected

Bump the key by the Weyl sequence step parameter

Parameters
keythe key to be bumped
Returns
the bumped key

Definition at line 87 of file PhiloxStateless.hpp.

◆ generate()

template<typename TParams >
static ALPAKA_FN_HOST_ACC auto alpaka::rand::engine::PhiloxStateless< TParams >::generate ( Counter const &  counter,
Key const &  key 
) -> Counter
inlinestatic

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 120 of file PhiloxStateless.hpp.

◆ nRounds()

template<typename TParams >
static ALPAKA_FN_HOST_ACC auto alpaka::rand::engine::PhiloxStateless< TParams >::nRounds ( Counter const &  counter_in,
Key const &  key_in 
) -> Counter
inlinestaticprotected

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 98 of file PhiloxStateless.hpp.

◆ singleRound()

template<typename TParams >
static ALPAKA_FN_HOST_ACC auto alpaka::rand::engine::PhiloxStateless< TParams >::singleRound ( Counter const &  counter,
Key const &  key 
)
inlinestaticprotected

Single round of the Philox shuffle

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

Definition at line 74 of file PhiloxStateless.hpp.


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