Template Class lfsr113_engine
Defined in File rocrand.hpp
Class Documentation
-
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 lfsr113_engine 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].Public Types
-
typedef unsigned int result_type
Type of values generated by the random number engine.
-
typedef rocrand_ordering order_type
Pseudo-random number engine ordering type. Represents the ordering of the results of a random number engine.
See also: order()
Public Functions
-
inline lfsr113_engine(seed_type seed_value = {DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW}, order_type order_value = ROCRAND_ORDERING_QUASI_DEFAULT)
Constructs the pseudo-random number engine.
LFSR113 does not accept offset.
See also: hiprandCreateGenerator()
-
inline lfsr113_engine(rocrand_generator &generator)
Constructs the pseudo-random number engine.
The pseudo-random number engine will be created using
generator
. The constructed engine take ownership overgenerator
, and sets passed reference toNULL
. The lifetime ofgenerator
is now bound to the lifetime of the engine.- Parameters:
generator – - rocRAND generator
-
inline ~lfsr113_engine() noexcept(false)
Destructs the engine.
See also: rocrand_destroy_generator()
-
inline void stream(hipStream_t value)
Sets the random number engine’s
hipStream
for kernel launches.- Parameters:
value – - new
hipStream
to use
-
inline void order(order_type value)
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.
See also: rocrand_set_ordering()
- Parameters:
value – - New ordering
-
inline void seed(unsigned long long value)
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.
See also: rocrand_set_seed()
- Parameters:
value – - New seed value
-
inline void seed(seed_type value)
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.
See also: rocrand_set_seed()
- Parameters:
value – - New seed value
-
template<class Generator>
inline void operator()(result_type *output, size_t size) 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 byoutput
pointer.The device memory pointed by
output
must have been previously allocated and be large enough to store at leastsize
values ofIntType
type.See also: rocrand_generate()
- Parameters:
output – - Pointer to device memory to store results
size – - Number of values to generate
-
inline result_type min() const
Returns the smallest possible value that can be generated by the engine.
-
inline result_type max() const
Returns the largest possible value that can be generated by the engine.
Public Static Functions
-
static inline constexpr rocrand_rng_type type()
Returns type of the rocRAND pseudo-random number generator associated with the engine.
Public Static Attributes
-
static constexpr seed_type default_seed = {DefaultSeedX, DefaultSeedY, DefaultSeedZ, DefaultSeedW}
The default seed equal to
DefaultSeed
.
-
typedef unsigned int result_type