sobol64_engine< DefaultNumDimensions > Class Template Reference

sobol64_engine&lt; DefaultNumDimensions &gt; Class Template Reference#

API library: rocrand_cpp::sobol64_engine< DefaultNumDimensions > Class Template Reference
API library
rocrand_cpp::sobol64_engine< DefaultNumDimensions > Class Template Reference

Sobol's quasi-random sequence generator. More...

#include <rocrand.hpp>

Public Types

typedef unsigned long long int result_type
 
typedef unsigned long long int offset_type
 
typedef rocrand_ordering order_type
 
typedef unsigned int dimensions_num_type
 

Public Member Functions

 sobol64_engine (dimensions_num_type num_of_dimensions=DefaultNumDimensions, offset_type offset_value=0, order_type order_value=ROCRAND_ORDERING_QUASI_DEFAULT)
 Constructs the pseudo-random number engine. More...
 
 sobol64_engine (rocrand_generator &generator)
 Constructs the pseudo-random number engine. More...
 
 sobol64_engine (const sobol64_engine &)=delete
 
sobol64_engineoperator= (const sobol64_engine &)=delete
 
 sobol64_engine (sobol64_engine &&rhs) noexcept
 Move construct from an other engine, moving the state over. More...
 
sobol64_engineoperator= (sobol64_engine &&rhs) noexcept
 Move assign from an other engine, moving the state over. More...
 
 ~sobol64_engine () noexcept(false)
 
void stream (hipStream_t value)
 Sets the random number engine's hipStream for kernel launches. More...
 
void order (order_type value)
 Sets the order of a random number engine. More...
 
void offset (offset_type value)
 Sets the offset of a random number engine. More...
 
void dimensions (dimensions_num_type value)
 Set the number of dimensions of a quasi-random number generator. More...
 
template<class Generator >
void operator() (result_type *output, size_t size)
 Fills output with uniformly distributed random integer values. More...
 

Static Public Member Functions

static constexpr result_type min ()
 Returns the smallest possible value that can be generated by the engine. More...
 
static constexpr result_type max ()
 Returns the largest possible value that can be generated by the engine. More...
 
static constexpr rocrand_rng_type type ()
 Returns type of the rocRAND pseudo-random number generator associated with the engine. More...
 

Static Public Attributes

static constexpr dimensions_num_type default_num_dimensions = DefaultNumDimensions
 The default number of dimenstions, equal to DefaultNumDimensions.
 

Detailed Description

template<unsigned int DefaultNumDimensions = 1>
class rocrand_cpp::sobol64_engine< DefaultNumDimensions >

Sobol's quasi-random sequence generator.

sobol64 is a quasi-random number engine which produces Sobol sequences. This implementation supports generating sequences in up to 20,000 dimensions. The engine produces random unsigned integers on the interval [0, 2^64 - 1].

Member Typedef Documentation

◆ dimensions_num_type

template<unsigned int DefaultNumDimensions = 1>
rocrand_cpp::sobol64_engine< DefaultNumDimensions >::dimensions_num_type

Quasi-random number engine type for number of dimensions.

See also dimensions()

◆ offset_type

template<unsigned int DefaultNumDimensions = 1>
typedef unsigned long long int rocrand_cpp::sobol64_engine< DefaultNumDimensions >::offset_type

Pseudo-random number engine offset type. Offset represents a number of the random number engine's states that should be skipped before first value is generated.

See also: offset()

◆ order_type

template<unsigned int DefaultNumDimensions = 1>
typedef rocrand_ordering rocrand_cpp::sobol64_engine< DefaultNumDimensions >::order_type

Pseudo-random number engine ordering type. Represents the ordering of the results of a random number engine.

See also: order()

◆ result_type

template<unsigned int DefaultNumDimensions = 1>
typedef unsigned long long int rocrand_cpp::sobol64_engine< DefaultNumDimensions >::result_type

Type of values generated by the random number engine.

Constructor & Destructor Documentation

◆ sobol64_engine() [1/3]

template<unsigned int DefaultNumDimensions = 1>
rocrand_cpp::sobol64_engine< DefaultNumDimensions >::sobol64_engine ( dimensions_num_type  num_of_dimensions = DefaultNumDimensions,
offset_type  offset_value = 0,
order_type  order_value = ROCRAND_ORDERING_QUASI_DEFAULT 
)
inline

Constructs the pseudo-random number engine.

Parameters
num_of_dimensions- number of dimensions to use in the initialization of the internal state, see also dimensions()
offset_value- number of internal states that should be skipped, see also offset()
order_value- ordering of the sequences generated by the engine, see also order()

See also: rocrand_create_generator()

◆ sobol64_engine() [2/3]

template<unsigned int DefaultNumDimensions = 1>
rocrand_cpp::sobol64_engine< DefaultNumDimensions >::sobol64_engine ( rocrand_generator &  generator)
inlineexplicit

Constructs the pseudo-random number engine.

The pseudo-random number engine will be created using generator. The constructed engine take ownership over generator, and sets passed reference to NULL. The lifetime of generator is now bound to the lifetime of the engine.

Parameters
generator- rocRAND generator

◆ sobol64_engine() [3/3]

template<unsigned int DefaultNumDimensions = 1>
rocrand_cpp::sobol64_engine< DefaultNumDimensions >::sobol64_engine ( sobol64_engine< DefaultNumDimensions > &&  rhs)
inlinenoexcept

Move construct from an other engine, moving the state over.

Parameters
rhsthe engine to move-from
  • The moved-from engine is safe to assign to or destroy, but otherwise cannot be used.
  • This engine will continue the sequence generated by rhs.

◆ ~sobol64_engine()

template<unsigned int DefaultNumDimensions = 1>
rocrand_cpp::sobol64_engine< DefaultNumDimensions >::~sobol64_engine ( )
inlinenoexcept

Destructs the engine.

See also: rocrand_destroy_generator()

Member Function Documentation

◆ dimensions()

template<unsigned int DefaultNumDimensions = 1>
void rocrand_cpp::sobol64_engine< DefaultNumDimensions >::dimensions ( dimensions_num_type  value)
inline

Set the number of dimensions of a quasi-random number generator.

Supported values of dimensions are 1 to 20000.

  • This operation resets the generator's internal state.
  • This operation does not change the generator's offset.
Parameters
value- Number of dimensions

See also: rocrand_set_quasi_random_generator_dimensions()

◆ max()

template<unsigned int DefaultNumDimensions = 1>
static constexpr result_type rocrand_cpp::sobol64_engine< DefaultNumDimensions >::max ( )
inlinestaticconstexpr

Returns the largest possible value that can be generated by the engine.

◆ min()

template<unsigned int DefaultNumDimensions = 1>
static constexpr result_type rocrand_cpp::sobol64_engine< DefaultNumDimensions >::min ( )
inlinestaticconstexpr

Returns the smallest possible value that can be generated by the engine.

◆ offset()

template<unsigned int DefaultNumDimensions = 1>
void rocrand_cpp::sobol64_engine< DefaultNumDimensions >::offset ( offset_type  value)
inline

Sets the offset of a random number engine.

Offset represents a number of the random number engine's states that should be skipped before first value is generated.

  • This operation resets the engine's internal state.
  • This operation does not change the engine's seed or the number of dimensions.
Parameters
value- New absolute offset

See also: rocrand_set_offset()

◆ operator()()

template<unsigned int DefaultNumDimensions = 1>
template<class Generator >
void rocrand_cpp::sobol64_engine< DefaultNumDimensions >::operator() ( result_type output,
size_t  size 
)
inline

Fills output with uniformly distributed random integer values.

Generates size random integer values uniformly distributed on the interval [0, 2^64 - 1], and stores them into the device memory referenced by output pointer.

Parameters
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 IntType type.
  • size must be a multiple of the engine's number of dimensions.

See also: rocrand_generate()

◆ operator=()

template<unsigned int DefaultNumDimensions = 1>
sobol64_engine& rocrand_cpp::sobol64_engine< DefaultNumDimensions >::operator= ( sobol64_engine< DefaultNumDimensions > &&  rhs)
inlinenoexcept

Move assign from an other engine, moving the state over.

Parameters
rhsthe engine to move-from
  • The moved-from engine is safe to assign to or destroy, but otherwise cannot be used.
  • This engine will continue the sequence generated by rhs.

◆ order()

template<unsigned int DefaultNumDimensions = 1>
void rocrand_cpp::sobol64_engine< DefaultNumDimensions >::order ( order_type  value)
inline

Sets the order of a random number engine.

The order refers to the ordering of the sequences generated by the engine.

  • This operation resets the engine's internal state.
  • This operation does not change the engine's seed.
Parameters
value- New ordering

See also: rocrand_set_ordering()

◆ stream()

template<unsigned int DefaultNumDimensions = 1>
void rocrand_cpp::sobol64_engine< DefaultNumDimensions >::stream ( hipStream_t  value)
inline

Sets the random number engine's hipStream for kernel launches.

Parameters
value- new hipStream to use

◆ type()

template<unsigned int DefaultNumDimensions = 1>
static constexpr rocrand_rng_type rocrand_cpp::sobol64_engine< DefaultNumDimensions >::type ( )
inlinestaticconstexpr

Returns type of the rocRAND pseudo-random number generator associated with the engine.


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