lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW > Class Template Reference

lfsr113_engine&lt; DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW &gt; Class Template Reference#

API library: rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW > Class Template Reference
rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW > Class Template Reference

Random number engine based on the LFSR113 algorithm. More...

#include <rocrand.hpp>

Public Types

typedef unsigned int result_type
 
typedef rocrand_ordering order_type
 
typedef uint4 seed_type
 

Public Member Functions

 lfsr113_engine (seed_type seed_value={DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW}, order_type order_value=ROCRAND_ORDERING_PSEUDO_DEFAULT)
 Constructs the pseudo-random number engine. More...
 
 lfsr113_engine (unsigned long long seed_value, order_type order_value=ROCRAND_ORDERING_PSEUDO_DEFAULT)
 Constructs the pseudo-random number engine. More...
 
 lfsr113_engine (rocrand_generator &generator)
 Constructs the pseudo-random number engine. More...
 
 lfsr113_engine (const lfsr113_engine &)=delete
 
lfsr113_engineoperator= (const lfsr113_engine &)=delete
 
 lfsr113_engine (lfsr113_engine &&rhs) noexcept
 Move construct from an other engine, moving the state over. More...
 
lfsr113_engineoperator= (lfsr113_engine &&rhs) noexcept
 Move assign from an other engine, moving the state over. More...
 
 ~lfsr113_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 seed (unsigned long long value)
 Sets the seed of the pseudo-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. 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 seed_type default_seed = {DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW}
 The default seed equal to DefaultSeed. More...
 

Detailed Description

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
class rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >

Random number engine based on the LFSR113 algorithm.

lfsr113_engine is an implementation of LFSR113 pseudorandom number generator, which is a linear feedback shift resgisters (LFSR) based generator created by Pierre L'Ecuyer. It produces random 32-bit unsigned int values on the interval [0; 2^32 - 1].

Member Typedef Documentation

◆ order_type

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
typedef rocrand_ordering rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::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 DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
typedef unsigned int rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::result_type

Type of values generated by the random number engine.

◆ seed_type

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
typedef uint4 rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::seed_type

Pseudo-random number engine seed type definition.

See also: seed()

Constructor & Destructor Documentation

◆ lfsr113_engine() [1/4]

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::lfsr113_engine ( seed_type  seed_value = {DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW},
order_type  order_value = ROCRAND_ORDERING_PSEUDO_DEFAULT 
)
inline

Constructs the pseudo-random number engine.

LFSR113 does not accept offset.

Parameters
seed_value- seed value to use in the initialization of the internal state, see also seed()
order_value- ordering of the sequences generated by the engine, see also order()

See also: rocrand_create_generator()

◆ lfsr113_engine() [2/4]

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::lfsr113_engine ( unsigned long long  seed_value,
order_type  order_value = ROCRAND_ORDERING_PSEUDO_DEFAULT 
)
inline

Constructs the pseudo-random number engine.

LFSR113 does not accept offset.

Parameters
seed_value- seed value to use in the initialization of the internal state, see also seed()
order_value- ordering of the sequences generated by the engine, see also order()

See also: rocrand_create_generator()

◆ lfsr113_engine() [3/4]

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::lfsr113_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

◆ lfsr113_engine() [4/4]

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::lfsr113_engine ( lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW > &&  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.

◆ ~lfsr113_engine()

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::~lfsr113_engine ( )
inlinenoexcept

Destructs the engine.

See also: rocrand_destroy_generator()

Member Function Documentation

◆ max()

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
static constexpr result_type rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::max ( )
inlinestaticconstexpr

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

◆ min()

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
static constexpr result_type rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::min ( )
inlinestaticconstexpr

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

◆ operator()()

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
template<class Generator >
void rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::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 int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
lfsr113_engine& rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::operator= ( lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW > &&  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 DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
void rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::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() [1/2]

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
void rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::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()

◆ seed() [2/2]

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
void rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::seed ( unsigned long long  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 int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
void rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::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 DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
static constexpr rocrand_rng_type rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::type ( )
inlinestaticconstexpr

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

Member Data Documentation

◆ default_seed

template<unsigned int DefaultSeedX = ROCRAND_LFSR113_DEFAULT_SEED_X, unsigned int DefaultSeedY = ROCRAND_LFSR113_DEFAULT_SEED_Y, unsigned int DefaultSeedZ = ROCRAND_LFSR113_DEFAULT_SEED_Z, unsigned int DefaultSeedW = ROCRAND_LFSR113_DEFAULT_SEED_W>
constexpr seed_type rocrand_cpp::lfsr113_engine< DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW >::default_seed = {DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW}
staticconstexpr

The default seed equal to DefaultSeed.


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