oneapi::mkl::rng::bits

Generates bits of underlying engine (BRNG) integer reccurence.

Description

The oneapi::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.

API

Syntax

template<typename UIntType = std::uint32_t>
   class bits {
   using result_type = UIntType
   }

Devices supported: Host, CPU, and GPU.

Include Files

  • oneapi/mkl/rng.hpp

Template Parameters

Name

Description

typename UIntType =  std::uint32_t

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

std::uint32_t