onemkl::rng::generate¶
Entry point to obtain random numbers from a given engine with proper statistics of a given distribution.
Syntax
Buffer API
-
template<typename
T
, methodMethod
, template<typename, method> classDistr
, typenameEngineType
>
voidgenerate
(const Distr<T, Method> &distr, EngineType &engine, const std::int64_t n, cl::sycl::buffer<T, 1> &r)¶
USM API
-
template<typename
T
, methodMethod
, template<typename, method> classDistr
, typenameEngineType
>
cl::sycl::eventgenerate
(const Distr<T, Method> &distr, EngineType &engine, const std::int64_t n, T *r, const cl::sycl::vector_class<cl::sycl::event> &dependencies)¶
Include Files
mkl_sycl.hpp
Input Parameters
Name |
Type |
Description |
---|---|---|
distr |
const Distr<T, Method> |
Distribution object. See Distributions for details. |
engine |
EngineType |
Engine object. See Engines for details. |
n |
const std::int64_t |
Number of random values to be generated. |
Output Parameters
Buffer API
Name |
Type |
Description |
---|---|---|
r |
cl::sycl::buffer<T, 1> |
cl::sycl::buffer |
USM API
Name |
Type |
Description |
---|---|---|
r |
T* |
Pointer |
event |
cl::sycl::event |
Function return event after submitting task in cl::sycl::queue from the engine. |
onemkl::rng::generate submits a kernel into a queue that is held by the engine and fills cl::sycl::buffer/T* vector with n random numbers.
Parent topic: Generate Routine