philox4x32x10#

The Philox4x32x10 counter-based pseudorandom number generator.

Description

The Philox4x32x10 engine is a keyed family of generator of counter-based BRNG. The state consists of 128-bit integer counter c and two 32-bits keys k0 and k1.

Generation algorithm

The generator has 32-bit integer output obtained in the following way [Salmon11]:

  1. cn=cn1+1

  2. ωn=f(cn), where f 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 c is interpreted as four 32-bit numbers c=L1R1L0R0, where ABCD=A296+B264+C232+D, put k00=k0,k10=k1.

    2.2. The following recurrence is calculated:

    L1i+1=mullo(R1i,0xD2511F53)

    R1i+1=mulhi(R0i,0xCD9E8D57)k0iL0i

    L0i+1=mullo(R0i,0xCD9E8D57)

    R0i+1=mulhi(R1i,0xD2511F53)k1iL1i

    k0i+1=k0i+0xBB67AE85

    k1i+1=k1i+0x9E3779B9, where mulhi(a,b) and mullo(a,b) are high and low parts of the ab product respectively.

    2.3. Put f(c)=L1NR1NL0NR0N, where N=10

  3. Integer output: r4n+k=ωn(k), where ωn(k) is the k-th 32-bit integer in quadruple ωn,k=0,1,2,3

  4. Real output: un=(int)rn/232+1/2

class philox4x32x10#

Syntax

namespace oneapi::mkl::rng {
class philox4x32x10 {
public:
static constexpr std::uint64_t default_seed = 0;

philox4x32x10(sycl::queue queue, std::uint64_t seed = default_seed);

philox4x32x10(sycl::queue queue, std::initializer_list<std::uint64_t> seed);

philox4x32x10(const philox4x32x10& other);

philox4x32x10(philox4x32x10&& other);

philox4x32x10& operator=(const philox4x32x10& other);

philox4x32x10& operator=(philox4x32x10&& other);

~philox4x32x10();
};
}

Class Members

Routine

Description

philox4x32x10(sycl::queue queue, std::uint64_t seed = default_seed)

Constructor for common seed initialization of the engine

philox4x32x10(sycl::queue queue, std::initializer_list<std::uint64_t> seed)

Constructor for extended seed initialization of the engine

philox4x32x10(const philox4x32x10& other)

Copy constructor

philox4x32x10(philox4x32x10&& other)

Move constructor

philox4x32x10& operator=(const philox4x32x10& other)

Copy assignment operator

philox4x32x10& operator=(philox4x32x10&& other)

Move assignment operator

Constructors

philox4x32x10::philox4x32x10(sycl::queue queue, std::uint64_t seed = default_seed)

Input Parameters

queue

Valid sycl::queue object, calls of the oneapi::mkl::rng::generate() routine submits kernels in this queue to obtain random numbers from a given engine.

seed

The initial conditions of the generator state, assume k=seed,c=0, where k is a 64-bit key, c is a 128-bit counter.

philox4x32x10::philox4x32x10(sycl::queue queue, std::initializer_list<std::uint64_t> seed)

Input Parameters

queue

Valid sycl::queue object, calls of the oneapi::mkl::rng::generate() routine submits kernels in this queue to obtain random numbers from a given engine.

seed

The initial conditions of the generator state, assume if n=0:k=0,c=0

if n=1:k=seed[0],c=0

if n=2:k=seed[0],c=seed[1]

if n=3:k=seed[0],c=seed[1]+seed[2]264

for n>3 following arguments are ignored

philox4x32x10::philox4x32x10(const philox4x32x10& other)

Input Parameters

other

Valid philox4x32x10 object. The queue and state of the other engine is copied and applied to the current engine.

philox4x32x10::philox4x32x10(philox4x32x10&& other)

Input Parameters

other

Valid philox4x32x10 r-value object. The queue and state of the other engine is moved to the current engine.

philox4x32x10::philox4x32x10& operator=(const philox4x32x10& other)

Input Parameters

other

Valid philox4x32x10 object. The queue and state of the other engine is copied and applied to the current engine.

philox4x32x10::philox4x32x10& operator=(philox4x32x10&& other)

Input Parameters

other

Valid philox4x32x10 r-value object. The queue and state of the other engine is moved to the current engine.

Parent topic: Host Engines (Basic Random Number Generators)