generate#

Description

Entry point to obtain random numbers from a given engine with proper statistics of a given distribution.

Syntax

namespace oneapi::mkl::rng::device {
  template<typename Distr, typename Engine>
  auto generate(Distr& distr, Engine& engine) ->
    typename std::conditional<Engine::vec_size == 1, typename Distr::result_type,
                              sycl::vec<typename Distr::result_type, Engine::vec_size>>::type
}

Template Parameters

Distr

Type of distribution which is used for random number generation.

Engine

Type of engine which is used for random number generation.

Input Parameters

distr

Distribution object. See Device Distributions for details.

engine

Engine object. See Device Engines (Basic Random Number Generators) for details.

Return Value

Returns Distr::result_type if Engine::vec_size == 1 or sycl::vec<typename Distr::result_type, Engine::vec_size> with generated random numbers.

Parent topic: Device Generate Routines