alpaka
Abstraction Library for Parallel Kernel Acceleration
alpaka::rand::Philox4x32x10Vector Class Reference

#include <RandPhilox.hpp>

+ Inheritance diagram for alpaka::rand::Philox4x32x10Vector:

Public Types

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

Public Member Functions

ALPAKA_FN_HOST_ACC Philox4x32x10Vector (std::uint32_t const seed=0, std::uint32_t const subsequence=0, std::uint32_t const offset=0)
 
constexpr ALPAKA_FN_HOST_ACC auto max () -> ResultInt
 
constexpr ALPAKA_FN_HOST_ACC auto min () -> ResultInt
 
ALPAKA_FN_HOST_ACC auto operator() () -> ResultVec
 

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 87 of file RandPhilox.hpp.

Member Typedef Documentation

◆ EngineParams

◆ EngineVariant

◆ ResultContainer

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

Definition at line 108 of file RandPhilox.hpp.

◆ ResultInt

Definition at line 110 of file RandPhilox.hpp.

◆ ResultVec

using alpaka::rand::Philox4x32x10Vector::ResultVec = decltype(std::declval<EngineVariant>()())

Definition at line 111 of file RandPhilox.hpp.

Constructor & Destructor Documentation

◆ Philox4x32x10Vector()

ALPAKA_FN_HOST_ACC alpaka::rand::Philox4x32x10Vector::Philox4x32x10Vector ( std::uint32_t const  seed = 0,
std::uint32_t const  subsequence = 0,
std::uint32_t const  offset = 0 
)
inline

Initialize a new Philox engine

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

Definition at line 99 of file RandPhilox.hpp.

Member Function Documentation

◆ max()

constexpr ALPAKA_FN_HOST_ACC auto alpaka::rand::Philox4x32x10Vector::max ( ) -> ResultInt
inlineconstexpr

Definition at line 118 of file RandPhilox.hpp.

◆ min()

constexpr ALPAKA_FN_HOST_ACC auto alpaka::rand::Philox4x32x10Vector::min ( ) -> ResultInt
inlineconstexpr

Definition at line 113 of file RandPhilox.hpp.

◆ operator()()

ALPAKA_FN_HOST_ACC auto alpaka::rand::Philox4x32x10Vector::operator() ( ) -> ResultVec
inline

Definition at line 123 of file RandPhilox.hpp.


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