philox4x32x10#
A Philox4x32-10 counter-based pseudorandom number generator [Salmon11].
Description
The Philox4x32x10 engine is a keyed family of generator of counter-based BRNG. The state consists of 128-bit integer counter
Generation algorithm
The generator has 32-bit integer output obtained in the following way [Salmon11]:
, where is a function that takes 128-bit argument and returns a 128-bit number. The returned number is obtained as follows:2.1. The argument
is interpreted as four 32-bit numbers , where , put .2.2. The following recurrence is calculated:
, where and are high and low parts of the product respectively.2.3. Put
, where
Integer output:
, where is the k-th 32-bit integer in quadrupleReal output:
class philox4x32x10#
Syntax
namespace oneapi::math::rng::device {
template<std::int32_t VecSize = 1>
class philox4x32x10 {
public:
static constexpr std::uint64_t default_seed = 1;
static constexpr std::int32_t vec_size = VecSize;
philox4x32x10();
philox4x32x10(std::uint64_t seed, std::uint64_t offset = 0);
philox4x32x10(std::initializer_list<std::uint64_t> seed, std::uint64_t offset = 0);
philox4x32x10(std::uint64_t seed, std::initializer_list<std::uint64_t> offset);
philox4x32x10(std::initializer_list<std::uint64_t> seed, std::initializer_list<std::uint64_t> offset);
};
}
Class Template Parameters
- VecSize
Describes the size of vector which will be produced by generate function by this engine. VecSize values may be 1, 2, 3, 4, 8, 16 as
sycl::vecclass size. By default VecSize = 1, for this case, a single random number is returned by thegeneratefunction.
Class Members
Routine |
Description |
|---|---|
Default constructor |
|
Constructor for common seed initialization of the engine and common number of skipped elements |
|
philox4x32x10(std::initializer_list<std::uint32_t> seed, std::uint64_t offset = 0) |
Constructor for extended seed initialization of the engine and common number of skipped elements |
philox4x32x10(std::uint32_t seed, std::initializer_list<std::uint64_t> offset) |
Constructor for common seed initialization of the engine and extended number of skipped elements |
Constructor for extended seed initialization of the engine and extended number of skipped elements |
Constructors
philox4x32x10::philox4x32x10()
philox4x32x10::philox4x32x10(std::uint32_t seed, std::uint64_t offset = 0)
Input Parameters
- seed
The initial conditions of the generator state, assume
, where is a 64-bit key, is a 128-bit counter.- offset
Number of skipped elements.
philox4x32x10::philox4x32x10(std::initializer_list<std::uint32_t> seed, std::uint64_t offset = 0)
Input Parameters
- seed
The initial conditions of the generator state, assume if
if
if
if
for
following arguments are ignored.- offset
Number of skipped elements.
philox4x32x10::philox4x32x10(std::uint32_t seed, std::initializer_list<std::uint64_t> offset)
Input Parameters
- seed
The initial conditions of the generator state, assume
, where is a 64-bit key, is a 128-bit counter.- offset
Number of skipped elements. Offset is calculated as:
num_to_skip[0]+num_to_skip[1]*264 +num_to_skip[2]* 2128 + … +num_to_skip[n-1]*264 *(n-1).
philox4x32x10::philox4x32x10(std::initializer_list<std::uint32_t> seed, std::initializer_list<std::uint64_t> offset)
Input Parameters
- seed
The initial conditions of the generator state, assume if
if
if
if
for
following arguments are ignored.- offset
Number of skipped elements. Offset is calculated as:
num_to_skip[0]+num_to_skip[1]*264 +num_to_skip[2]* 2128 + … +num_to_skip[n-1]*264 *(n-1).
Parent topic: Device Engines (Basic Random Number Generators)