philox4x32_10_engine< DefaultSeed > Class Template Reference

philox4x32_10_engine&lt; DefaultSeed &gt; Class Template Reference#

API library: rocrand_cpp::philox4x32_10_engine< DefaultSeed > Class Template Reference

Pseudorandom number engine based Philox algorithm. More...

#include <rocrand.hpp>

Public Types

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

Public Member Functions

 philox4x32_10_engine (seed_type seed_value=DefaultSeed, offset_type offset_value=0, order_type order_value=ROCRAND_ORDERING_PSEUDO_DEFAULT)
 Constructs the pseudo-random number engine. More...
 
 philox4x32_10_engine (rocrand_generator &generator)
 Constructs the pseudo-random number engine. More...
 
 philox4x32_10_engine (const philox4x32_10_engine &)=delete
 
philox4x32_10_engineoperator= (const philox4x32_10_engine &)=delete
 
 philox4x32_10_engine (philox4x32_10_engine &&rhs) noexcept
 Move construct from an other engine, moving the state over. More...
 
philox4x32_10_engineoperator= (philox4x32_10_engine &&rhs) noexcept
 Move assign from an other engine, moving the state over. More...
 
 ~philox4x32_10_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 seed (seed_type value)
 Sets the seed of the pseudo-random number engine. 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.
 
static constexpr result_type max ()
 Returns the largest possible value that can be generated by the engine.
 
static constexpr rocrand_rng_type type ()
 Returns type of the rocRAND pseudo-random number generator associated with the engine.
 

Static Public Attributes

static constexpr seed_type default_seed = DefaultSeed
 The default seed equal to DefaultSeed.
 

Detailed Description

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
class rocrand_cpp::philox4x32_10_engine< DefaultSeed >

Pseudorandom number engine based Philox algorithm.

It generates random numbers of type unsigned int on the interval [0; 2^32 - 1]. Random numbers are generated in sets of four.

Member Typedef Documentation

◆ offset_type

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
rocrand_cpp::philox4x32_10_engine< DefaultSeed >::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 long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
typedef rocrand_ordering rocrand_cpp::philox4x32_10_engine< DefaultSeed >::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 long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
rocrand_cpp::philox4x32_10_engine< DefaultSeed >::result_type

Type of values generated by the random number engine.

◆ seed_type

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
rocrand_cpp::philox4x32_10_engine< DefaultSeed >::seed_type

Pseudo-random number engine seed type definition.

See also: seed()

Constructor & Destructor Documentation

◆ philox4x32_10_engine() [1/3]

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
rocrand_cpp::philox4x32_10_engine< DefaultSeed >::philox4x32_10_engine ( seed_type  seed_value = DefaultSeed,
offset_type  offset_value = 0,
order_type  order_value = ROCRAND_ORDERING_PSEUDO_DEFAULT 
)
inline

Constructs the pseudo-random number engine.

Parameters
seed_value- seed value to use in the initialization of the internal state, see also seed()
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()

◆ philox4x32_10_engine() [2/3]

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
rocrand_cpp::philox4x32_10_engine< DefaultSeed >::philox4x32_10_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

◆ philox4x32_10_engine() [3/3]

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
rocrand_cpp::philox4x32_10_engine< DefaultSeed >::philox4x32_10_engine ( philox4x32_10_engine< DefaultSeed > &&  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.

◆ ~philox4x32_10_engine()

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
rocrand_cpp::philox4x32_10_engine< DefaultSeed >::~philox4x32_10_engine ( )
inlinenoexcept

Destructs the engine.

See also: rocrand_destroy_generator()

Member Function Documentation

◆ offset()

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
void rocrand_cpp::philox4x32_10_engine< DefaultSeed >::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 long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
template<class Generator >
void rocrand_cpp::philox4x32_10_engine< DefaultSeed >::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^32 - 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

The device memory pointed by output must have been previously allocated and be large enough to store at least size values of IntType type.

See also: rocrand_generate()

◆ operator=()

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
philox4x32_10_engine& rocrand_cpp::philox4x32_10_engine< DefaultSeed >::operator= ( philox4x32_10_engine< DefaultSeed > &&  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 long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
void rocrand_cpp::philox4x32_10_engine< DefaultSeed >::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()

◆ seed()

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
void rocrand_cpp::philox4x32_10_engine< DefaultSeed >::seed ( seed_type  value)
inline

Sets the seed of the pseudo-random number engine.

The seed is used to construct the initial state of an engine.

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

See also: rocrand_set_seed()

◆ stream()

template<unsigned long long DefaultSeed = ROCRAND_PHILOX4x32_DEFAULT_SEED>
void rocrand_cpp::philox4x32_10_engine< DefaultSeed >::stream ( hipStream_t  value)
inline

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

Parameters
value- new hipStream to use

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