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

Most common Philox engine variant, outputs single number. More...

#include <philox.hpp>

Public Types

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

Public Member Functions

constexpr Philox4x32x10 (std::uint64_t const seed=0, std::uint64_t const subsequence=0, std::uint64_t const offset=0)
 Initialize a new Philox engine.
constexpr auto operator() () -> result_type

Static Public Member Functions

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

Private Attributes

EngineVariant engineVariant

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. A bit shuffle is performed 10 subsequent times. 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 philox.hpp.

Member Typedef Documentation

◆ EngineParams

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

Definition at line 35 of file philox.hpp.

◆ EngineVariant

Engine outputs a single number.

Definition at line 37 of file philox.hpp.

◆ result_type

Definition at line 56 of file philox.hpp.

Constructor & Destructor Documentation

◆ Philox4x32x10()

alpaka::rand::engine::Philox4x32x10::Philox4x32x10 ( std::uint64_t const seed = 0,
std::uint64_t const subsequence = 0,
std::uint64_t const offset = 0 )
inlineexplicitconstexpr

Initialize a new Philox engine.

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

Member Function Documentation

◆ max()

constexpr auto alpaka::rand::engine::Philox4x32x10::max ( ) -> result_type
inlinestaticconstexpr

Definition at line 63 of file philox.hpp.

◆ min()

constexpr auto alpaka::rand::engine::Philox4x32x10::min ( ) -> result_type
inlinestaticconstexpr

Definition at line 58 of file philox.hpp.

◆ operator()()

auto alpaka::rand::engine::Philox4x32x10::operator() ( ) -> result_type
inlineconstexpr

Definition at line 68 of file philox.hpp.

Member Data Documentation

◆ engineVariant

EngineVariant alpaka::rand::engine::Philox4x32x10::engineVariant
private

Definition at line 74 of file philox.hpp.


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