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

#include <RandPhilox.hpp>

+ Inheritance diagram for alpaka::rand::Philox4x32x10:

Public Types

using EngineParams = engine::PhiloxParams< 4, 32, 10 >
 Philox algorithm: 10 rounds, 4 numbers of size 32. More...
 
using EngineVariant = engine::PhiloxSingle< EngineParams >
 Engine outputs a single number. More...
 
using result_type = std::uint32_t
 

Public Member Functions

ALPAKA_FN_HOST_ACC Philox4x32x10 (std::uint64_t const seed=0, std::uint64_t const subsequence=0, std::uint64_t const offset=0)
 
constexpr ALPAKA_FN_HOST_ACC auto max () -> result_type
 
constexpr ALPAKA_FN_HOST_ACC auto min () -> result_type
 
ALPAKA_FN_HOST_ACC auto operator() () -> result_type
 

Detailed Description

Most common Philox engine variant, outputs single number

This is a variant of the Philox engine generator which outputs a single float. The counter size is $4 \times 32 = 128$ bits. Since the engine returns a single number, the generated result, which has the same size as the counter, has to be stored between invocations. Additionally a 32 bit pointer is stored. The total size of the state is 352 bits = 44 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 31 of file RandPhilox.hpp.

Member Typedef Documentation

◆ EngineParams

Philox algorithm: 10 rounds, 4 numbers of size 32.

Definition at line 35 of file RandPhilox.hpp.

◆ EngineVariant

Engine outputs a single number.

Definition at line 37 of file RandPhilox.hpp.

◆ result_type

Definition at line 55 of file RandPhilox.hpp.

Constructor & Destructor Documentation

◆ Philox4x32x10()

ALPAKA_FN_HOST_ACC alpaka::rand::Philox4x32x10::Philox4x32x10 ( std::uint64_t const  seed = 0,
std::uint64_t const  subsequence = 0,
std::uint64_t const  offset = 0 
)
inline

Initialize a new Philox engine

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

Member Function Documentation

◆ max()

constexpr ALPAKA_FN_HOST_ACC auto alpaka::rand::Philox4x32x10::max ( ) -> result_type
inlineconstexpr

Definition at line 62 of file RandPhilox.hpp.

◆ min()

constexpr ALPAKA_FN_HOST_ACC auto alpaka::rand::Philox4x32x10::min ( ) -> result_type
inlineconstexpr

Definition at line 57 of file RandPhilox.hpp.

◆ operator()()

ALPAKA_FN_HOST_ACC auto alpaka::rand::Philox4x32x10::operator() ( ) -> result_type
inline

Definition at line 67 of file RandPhilox.hpp.


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