Visible to Intel only — GUID: GUID-CABB31EC-A086-4E02-B3FE-C97E0D364D4E
Visible to Intel only — GUID: GUID-CABB31EC-A086-4E02-B3FE-C97E0D364D4E
mrg32k3a
Description
The combined multiple recursive pseudorandom number generator MRG32k3a [L’Ecuyer99a].
API
Syntax
namespace oneapi::mkl::rng {
class mrg32k3a {
public:
static constexpr std::uint32_t default_seed = 1;
mrg32k3a(sycl::queue queue, std::uint32_t seed = default_seed);
mrg32k3a(sycl::queue queue, std::uint32_t seed, mrg32k3a_mode::optimal mode);
mrg32k3a(sycl::queue queue, std::uint32_t seed, mrg32k3a_mode::custom mode);
mrg32k3a(sycl::queue queue, std::initializer_list<std::uint32_t> seed);
mrg32k3a(sycl::queue queue, std::initializer_list<std::uint32_t> seed,
mrg32k3a_mode::optimal mode);
mrg32k3a(sycl::queue queue, std::initializer_list<std::uint32_t> seed,
mrg32k3a_mode::custom mode);
mrg32k3a(const mrg32k3a& other);
mrg32k3a(mrg32k3a&& other);
mrg32k3a& operator=(const mrg32k3a& other);
mrg32k3a& operator=(mrg32k3a&& other);
~mrg32k3a();
};
}
Devices supported: CPU and GPU.
Include Files
oneapi/mkl/rng.hpp
Input Parameters
Name |
Type |
Description |
---|---|---|
queue |
sycl::queue |
Valid sycl::queue, calls of the oneapi::mkl::rng::generate() routine submits kernels in this queue. |
seed |
std::uint32_tstd::initializer_list<std::uint32_t> |
Initial conditions of the generator state or engine state. |
mode |
mrg32k3a_mode::optimalmrg32k3a_mode::custom |
Initial conditions of the generator state or engine state. |
- Sub-sequence parallelization [L’Ecuyer02] is supported via the mode parameter. mrg32k3a_mode::optimal uses the optimal number of sub-streams, and mrg32k3a_mode::custom enables the passing a user-defined number of sub-streams (e.g. mrg32k3a_mode::custom my_mode{123}). There is also a helper structure template, mrg32k3a_mode::optimal_v, for optimal mode. Refer to the corresponding example for usage details.
Currently sub-sequence parallelization is supported only for uniform and gaussian distributions on GPU device.
See VS Notes for the detailed descriptions.