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

#include <PhiloxVector.hpp>

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

Public Types

using Base = PhiloxBaseCommon< TParams, PhiloxVector< TParams > >
 
using Counter = typename Base::Counter
 Counter type. More...
 
using Key = typename Base::Key
 Key type. More...
 
template<typename TDistributionResultScalar >
using ResultContainer = typename Base::template ResultContainer< TDistributionResultScalar >
 
using State = PhiloxStateVector< Counter, Key >
 State type. More...
 
- Public Types inherited from alpaka::rand::engine::PhiloxBaseCommon< TParams, PhiloxVector< TParams > >
using Counter = typename PhiloxStateless< TParams >::Counter
 
using Key = typename PhiloxStateless< TParams >::Key
 
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 >
 

Public Member Functions

ALPAKA_FN_HOST_ACC PhiloxVector (uint64_t seed=0, uint64_t subsequence=0, uint64_t offset=0)
 
ALPAKA_FN_HOST_ACC auto operator() ()
 

Public Attributes

State state
 

Protected Member Functions

ALPAKA_FN_HOST_ACC auto nextVector ()
 
ALPAKA_FN_HOST_ACC void skip (uint64_t offset)
 
- Protected Member Functions inherited from alpaka::rand::engine::PhiloxBaseCommon< TParams, PhiloxVector< TParams > >
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>
class alpaka::rand::engine::PhiloxVector< TParams >

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.

Template Parameters
TParamsBasic parameters for the Philox algorithm

Definition at line 40 of file PhiloxVector.hpp.

Member Typedef Documentation

◆ Base

template<typename TParams >
using alpaka::rand::engine::PhiloxVector< TParams >::Base = PhiloxBaseCommon<TParams, PhiloxVector<TParams> >

Definition at line 43 of file PhiloxVector.hpp.

◆ Counter

template<typename TParams >
using alpaka::rand::engine::PhiloxVector< TParams >::Counter = typename Base::Counter

Counter type.

Definition at line 46 of file PhiloxVector.hpp.

◆ Key

template<typename TParams >
using alpaka::rand::engine::PhiloxVector< TParams >::Key = typename Base::Key

Key type.

Definition at line 48 of file PhiloxVector.hpp.

◆ ResultContainer

template<typename TParams >
template<typename TDistributionResultScalar >
using alpaka::rand::engine::PhiloxVector< TParams >::ResultContainer = typename Base::template ResultContainer<TDistributionResultScalar>

Definition at line 53 of file PhiloxVector.hpp.

◆ State

template<typename TParams >
using alpaka::rand::engine::PhiloxVector< TParams >::State = PhiloxStateVector<Counter, Key>

State type.

Definition at line 50 of file PhiloxVector.hpp.

Constructor & Destructor Documentation

◆ PhiloxVector()

template<typename TParams >
ALPAKA_FN_HOST_ACC alpaka::rand::engine::PhiloxVector< TParams >::PhiloxVector ( uint64_t  seed = 0,
uint64_t  subsequence = 0,
uint64_t  offset = 0 
)
inline

Construct a new Philox engine with vector output

Parameters
seedSet the Philox generator key
subsequenceSelect a subsequence of size 2^64
offsetSkip offset numbers form the start of the subsequence

Definition at line 85 of file PhiloxVector.hpp.

Member Function Documentation

◆ nextVector()

template<typename TParams >
ALPAKA_FN_HOST_ACC auto alpaka::rand::engine::PhiloxVector< TParams >::nextVector ( )
inlineprotected

Get the next array of random numbers and advance internal state

Returns
The next array of random numbers

Definition at line 62 of file PhiloxVector.hpp.

◆ operator()()

template<typename TParams >
ALPAKA_FN_HOST_ACC auto alpaka::rand::engine::PhiloxVector< TParams >::operator() ( )
inline

Get the next vector of random numbers

Returns
The next vector of random numbers

Definition at line 97 of file PhiloxVector.hpp.

◆ skip()

template<typename TParams >
ALPAKA_FN_HOST_ACC void alpaka::rand::engine::PhiloxVector< TParams >::skip ( uint64_t  offset)
inlineprotected

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 73 of file PhiloxVector.hpp.

Member Data Documentation

◆ state

template<typename TParams >
State alpaka::rand::engine::PhiloxVector< TParams >::state

Definition at line 55 of file PhiloxVector.hpp.


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