uniform_int_distribution< IntType > Class Template Reference#
API library
|
rocrand_cpp::uniform_int_distribution< IntType > Class Template Reference
Produces random integer values uniformly distributed on the interval [0, 2^(sizeof(IntType)*8) - 1]. More...
#include <rocrand.hpp>
Public Types | |
typedef IntType | result_type |
See description for IntType template parameter. | |
Public Member Functions | |
uniform_int_distribution () | |
Default constructor. | |
template<class Generator > | |
void | operator() (Generator &g, IntType *output, size_t size) |
Fills output with uniformly distributed random integer values. More... | |
bool | operator== (const uniform_int_distribution< IntType > &other) const |
Returns true if the distribution is the same as other . | |
bool | operator!= (const uniform_int_distribution< IntType > &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 IntType | min () |
Returns the smallest possible value that can be generated. | |
static constexpr IntType | max () |
Returns the largest possible value that can be generated. | |
Detailed Description
template<class IntType = unsigned int>
class rocrand_cpp::uniform_int_distribution< IntType >
Produces random integer values uniformly distributed on the interval [0, 2^(sizeof(IntType)*8) - 1].
- Template Parameters
-
IntType - type of generated values. Only unsigned
char
,unsigned
short
andunsigned
int
andunsigned
long
long
int
type is supported.
Member Function Documentation
◆ operator()()
template<class IntType = unsigned int>
template<class Generator >
|
inline |
Fills output
with uniformly distributed random integer values.
Generates size
random integer values uniformly distributed on the interval [0, 2^(sizeof(IntType)*8) - 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 leastsize
values ofIntType
type. - If generator
g
is a quasi-random number generator (rocrand_cpp::sobol32_engine
), thensize
must be a multiple of that generator's dimension.
See also: rocrand_generate(), rocrand_generate_char(), rocrand_generate_short()
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.2.1/library/include/rocrand/rocrand.hpp
Generated by 1.9.1