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

Philox engine generating a vector of numbers. More...

#include <PhiloxVector.hpp>

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

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.

Detailed Description

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

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
T_ParamsBasic parameters for the Philox algorithm

Definition at line 21 of file PhiloxVector.hpp.

Member Typedef Documentation

◆ Base

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

Definition at line 24 of file PhiloxVector.hpp.

◆ Counter

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

Counter type.

Definition at line 27 of file PhiloxVector.hpp.

◆ Key

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

Key type.

Definition at line 29 of file PhiloxVector.hpp.

◆ ResultContainer

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

Definition at line 32 of file PhiloxVector.hpp.

◆ State

template<typename T_Params>
using alpaka::rand::engine::internal::PhiloxVector< T_Params >::State = PhiloxState<Counter, Key, PhiloxVector<T_Params>>

Definition at line 30 of file PhiloxVector.hpp.

Constructor & Destructor Documentation

◆ PhiloxVector()

template<typename T_Params>
alpaka::rand::engine::internal::PhiloxVector< T_Params >::PhiloxVector ( uint64_t seed = 0,
uint64_t subsequence = 0,
uint64_t offset = 0 )
inlineexplicitconstexpr

Construct a new Philox engine with vector output.

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

Definition at line 62 of file PhiloxVector.hpp.

Member Function Documentation

◆ nextVector()

template<typename T_Params>
auto alpaka::rand::engine::internal::PhiloxVector< T_Params >::nextVector ( )
inlineconstexprprotected

Get the next array of random numbers and advance internal state.

Returns
The next array of random numbers

Definition at line 39 of file PhiloxVector.hpp.

◆ operator()()

template<typename T_Params>
auto alpaka::rand::engine::internal::PhiloxVector< T_Params >::operator() ( )
inlineconstexpr

Get the next vector of random numbers.

Returns
The next vector of random numbers

Definition at line 74 of file PhiloxVector.hpp.

◆ skip()

template<typename T_Params>
void alpaka::rand::engine::internal::PhiloxVector< T_Params >::skip ( uint64_t offset)
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.


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