alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::rand::engine::Philox4x32x10Vector Class Reference

Most common Philox engine variant, outputs a 4-vector of floats. More...

#include <philox.hpp>

Public Types

using EngineParams = internal::PhiloxParams<4, 32, 10>
using EngineVariant = internal::PhiloxVector<EngineParams>
template<typename TScalar>
using ResultContainer = EngineVariant::ResultContainer<TScalar>
using ResultInt = std::uint32_t
using ResultVec = decltype(std::declval<EngineVariant>()())

Public Member Functions

constexpr Philox4x32x10Vector (std::uint32_t const seed=0, std::uint32_t const subsequence=0, std::uint32_t const offset=0)
 Initialize a new Philox engine.
constexpr auto operator() () -> ResultVec

Static Public Member Functions

static constexpr auto max () -> ResultInt
static constexpr auto min () -> ResultInt

Detailed Description

Most common Philox engine variant, outputs a 4-vector of floats.

This is a variant of the Philox engine generator which outputs a vector containing 4 floats. The counter size is $4 \times 32 = 128$ bits. Since the engine returns the whole generated vector, it is up to the user to extract individual floats as they need. The benefit is smaller state size since the state does not contain the intermediate results. The total size of the state is 192 bits = 24 bytes.

Ref.: J. K. Salmon, M. A. Moraes, R. O. Dror and D. E. Shaw, "Parallel random numbers: As easy as 1, 2, 3," SC '11: Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis, 2011, pp. 1-12, doi: 10.1145/2063384.2063405.

Definition at line 88 of file philox.hpp.

Member Typedef Documentation

◆ EngineParams

using alpaka::rand::engine::Philox4x32x10Vector::EngineParams = internal::PhiloxParams<4, 32, 10>

Definition at line 91 of file philox.hpp.

◆ EngineVariant

Definition at line 92 of file philox.hpp.

◆ ResultContainer

template<typename TScalar>
using alpaka::rand::engine::Philox4x32x10Vector::ResultContainer = EngineVariant::ResultContainer<TScalar>

Definition at line 109 of file philox.hpp.

◆ ResultInt

Definition at line 111 of file philox.hpp.

◆ ResultVec

Definition at line 112 of file philox.hpp.

Constructor & Destructor Documentation

◆ Philox4x32x10Vector()

alpaka::rand::engine::Philox4x32x10Vector::Philox4x32x10Vector ( std::uint32_t const seed = 0,
std::uint32_t const subsequence = 0,
std::uint32_t const offset = 0 )
inlineexplicitconstexpr

Initialize a new Philox engine.

Parameters
seedSet the Philox generator key
subsequenceSelect a subsequence of size 2^64
offsetNumber of numbers to skip from the start of the subsequence.

Definition at line 100 of file philox.hpp.

Member Function Documentation

◆ max()

constexpr auto alpaka::rand::engine::Philox4x32x10Vector::max ( ) -> ResultInt
inlinestaticconstexpr

Definition at line 119 of file philox.hpp.

◆ min()

constexpr auto alpaka::rand::engine::Philox4x32x10Vector::min ( ) -> ResultInt
inlinestaticconstexpr

Definition at line 114 of file philox.hpp.

◆ operator()()

auto alpaka::rand::engine::Philox4x32x10Vector::operator() ( ) -> ResultVec
inlineconstexpr

Definition at line 124 of file philox.hpp.


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