uniform_real_distribution< RealType > Class Template Reference

uniform_real_distribution&lt; RealType &gt; Class Template Reference#

API library: rocrand_cpp::uniform_real_distribution< RealType > Class Template Reference
rocrand_cpp::uniform_real_distribution< RealType > Class Template Reference

Produces random floating-point values uniformly distributed on the interval (0, 1]. More...

#include <rocrand.hpp>

Public Types

typedef RealType result_type
 See description for RealType template parameter.
 

Public Member Functions

 uniform_real_distribution ()
 Default constructor.
 
template<class Generator >
void operator() (Generator &g, RealType *output, size_t size)
 Fills output with uniformly distributed random floating-point values. More...
 
bool operator== (const uniform_real_distribution< RealType > &other) const
 Returns true if the distribution is the same as other.
 
bool operator!= (const uniform_real_distribution< RealType > &other) const
 Returns true if the distribution is different from other.
 

Static Public Member Functions

static void reset ()
 Resets distribution's internal state if there is any.
 
static constexpr RealType min ()
 Returns the smallest possible value that can be generated.
 
static constexpr RealType max ()
 Returns the largest possible value that can be generated.
 

Detailed Description

template<class RealType = float>
class rocrand_cpp::uniform_real_distribution< RealType >

Produces random floating-point values uniformly distributed on the interval (0, 1].

Template Parameters
RealType- type of generated values. Only float, double and half types are supported.

Member Function Documentation

◆ operator()()

template<class RealType = float>
template<class Generator >
void rocrand_cpp::uniform_real_distribution< RealType >::operator() ( Generator &  g,
RealType *  output,
size_t  size 
)
inline

Fills output with uniformly distributed random floating-point values.

Generates size random floating-point values uniformly distributed on the interval (0, 1], and stores them into the device memory referenced by output pointer.

Parameters
g- An uniform random number generator object
output- Pointer to device memory to store results
size- Number of values to generate

Requirements:

  • The device memory pointed by output must have been previously allocated and be large enough to store at least size values of RealType type.
  • If generator g is a quasi-random number generator (rocrand_cpp::sobol32_engine), then size must be a multiple of that generator's dimension.

See also: rocrand_generate_uniform(), rocrand_generate_uniform_double(), rocrand_generate_uniform_half()


The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocrand/checkouts/latest/library/include/rocrand/rocrand.hpp