mkl::rng::bits

Generates bits of underlying engine (BRNG) integer reccurence.

Syntax

template<typename UIntType = std::uint32_t>

class bits {

using result_type = UIntType;

};

Devices supported: Host, CPU, and GPU.

Include Files

Description

The mkl::rng::bits class object is used to generate integer random values. Each integer can be treated as a vector of several bits. In a truly random generator, these bits are random, while in pseudorandom generators this randomness can be violated. For example, a drawback of linear congruential generators is that lower bits are less random than higher bits (for example, see [Knuth81]). For this reason, exercise care when using this function. Typically, in a 32-bit LCG only 24 higher bits of an integer value can be considered random. See VS Notes for details.

Template Parameters

typename UIntType = std::uint32_t

Type of the produced values. The specific values are as follows:

std::uint32_t