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

#include <PhiloxBaseCommon.hpp>

+ Inheritance diagram for alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >:

Public Types

using Counter = typename PhiloxStateless< TParams >::Counter
 
using Key = typename PhiloxStateless< TParams >::Key
 
template<typename TDistributionResultScalar >
using ResultContainer = typename alpaka::Vec< alpaka::DimInt< TParams::counterSize >, TDistributionResultScalar >
 Distribution container type. More...
 
- Public Types inherited from alpaka::rand::engine::PhiloxStateless< TParams >
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 >
 

Protected Member Functions

ALPAKA_FN_HOST_ACC void advanceCounter (Counter &counter)
 
ALPAKA_FN_HOST_ACC void skip4 (uint64_t offset)
 
ALPAKA_FN_HOST_ACC void skipSubsequence (uint64_t subsequence)
 

Additional Inherited Members

- Static Public Member Functions inherited from alpaka::rand::engine::PhiloxStateless< TParams >
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 inherited from alpaka::rand::engine::PhiloxStateless< TParams >
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, typename TImpl>
class alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >

Common class for Philox family engines

Relies on PhiloxStateless to provide the PRNG and adds state to handling the counting.

Template Parameters
TParamsPhilox algorithm parameters
See also
PhiloxParams
Template Parameters
TImplengine 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 27 of file PhiloxBaseCommon.hpp.

Member Typedef Documentation

◆ Counter

template<typename TParams , typename TImpl >
using alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >::Counter = typename PhiloxStateless<TParams>::Counter

Definition at line 30 of file PhiloxBaseCommon.hpp.

◆ Key

template<typename TParams , typename TImpl >
using alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >::Key = typename PhiloxStateless<TParams>::Key

Definition at line 31 of file PhiloxBaseCommon.hpp.

◆ ResultContainer

template<typename TParams , typename TImpl >
template<typename TDistributionResultScalar >
using alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >::ResultContainer = typename alpaka::Vec<alpaka::DimInt<TParams::counterSize>, TDistributionResultScalar>

Distribution container type.

Definition at line 35 of file PhiloxBaseCommon.hpp.

Member Function Documentation

◆ advanceCounter()

template<typename TParams , typename TImpl >
ALPAKA_FN_HOST_ACC void alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >::advanceCounter ( Counter counter)
inlineprotected

Advance the counter to the next state

Increments the passed-in counter by one with a 128-bit carry.

Parameters
counterreference to the counter which is to be advanced

Definition at line 44 of file PhiloxBaseCommon.hpp.

◆ skip4()

template<typename TParams , typename TImpl >
ALPAKA_FN_HOST_ACC void alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >::skip4 ( uint64_t  offset)
inlineprotected

Advance the internal state counter by offset N-vectors (N = counter size)

Advances the internal value of this->state.counter

Parameters
offsetnumber of N-vectors to skip

Definition at line 68 of file PhiloxBaseCommon.hpp.

◆ skipSubsequence()

template<typename TParams , typename TImpl >
ALPAKA_FN_HOST_ACC void alpaka::rand::engine::PhiloxBaseCommon< TParams, TImpl >::skipSubsequence ( uint64_t  subsequence)
inlineprotected

Advance the counter by the length of subsequence

Advances the internal value of this->state.counter

Parameters
subsequencenumber of subsequences to skip

Definition at line 84 of file PhiloxBaseCommon.hpp.


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