generate#
Description#
Entry point to obtain random numbers from a given engine with proper statistics of a given distribution.
API#
Syntax#
Buffer API
namespace oneapi::mkl::rng {
template<typename Distr, typename Engine>
void generate (const Distr& distr,
Engine& engine, std::int64_t n,
sycl::buffer<typename Distr::result_type, 1>& r)
}
USM API
namespace oneapi::mkl::rng {
template<typename Distr, typename Engine>
sycl::event generate (const Distr& distr,
Engine& engine, std::int64_t n,
typename Distr::result_type* r,
const std::vector<sycl::event> & dependencies)
}
Include Files#
oneapi/mkl/rng.hpp
Input Parameters#
Name |
Type |
Description |
---|---|---|
distr |
const Distr& |
Distribution object. See Distributions for details. |
engine |
Engine& |
Engine object. See Engines for details. |
n |
|
Number of random values to be generated. |
Optional Input Parameter for USM API
Name |
Type |
Description |
---|---|---|
dependencies |
const |
List of events to wait for before starting computation, if any. |
Output Parameters#
Buffer API
Name |
Type |
Description |
---|---|---|
r |
|
|
USM API
Name |
Type |
Description |
---|---|---|
r |
typename |
Pointer |
event |
|
Function return event after submitting task in |
generate
submits a kernel into a queue that is held by the engine and fills sycl::buffer<typename
sDistr::result_type>
vector with n
random numbers.