hip.hiprand#
(No short description)
- Attributes:
- HIPRAND_VERSION (
int
): Macro constant.
- HIPRAND_DEFAULT_MAX_BLOCK_SIZE (
int
): Macro constant.
- HIPRAND_DEFAULT_MIN_WARPS_PER_EU (
int
): Macro constant.
- rocrand_discrete_distribution:
alias of
rocrand_discrete_distribution_st
- rocrand_generator:
alias of
rocrand_generator_base_type
- hiprandGenerator_st:
alias of
rocrand_generator_base_type
- hiprandDiscreteDistribution_st:
alias of
rocrand_discrete_distribution_st
- hiprandGenerator_t:
alias of
rocrand_generator_base_type
- hiprandDiscreteDistribution_t:
alias of
rocrand_discrete_distribution_st
- hiprandStatus_t:
alias of
hiprandStatus
- hiprandRngType_t:
alias of
hiprandRngType
- hiprandDirectionVectorSet_t:
alias of
hiprandDirectionVectorSet
- HIPRAND_VERSION (
- class hip.hiprand.uint4(*args, **kwargs)#
Bases:
Pointer
Python wrapper for cdef class chiprand.uint4.
Python wrapper for cdef class chiprand.uint4.
If this type is initialized via its
__init__
method, it allocates a member of the underlying C type and destroys it again if the wrapper type is deallocated.This type also serves as adapter when appearing as argument type in a function signature. In this case, the type can further be initialized from a number of Python objects:
None
:This will set the
self._ptr
attribute toNULL
.int
:Interprets the integer value as pointer address and writes it to
self._ptr
. No ownership is transferred.-
Takes the pointer address
pyobj.value
and writes it toself._ptr
. No ownership is transferred. object
that implements the CUDA Array Interface protocol:Takes the integer-valued pointer address, i.e. the first entry of the
data
tuple frompyobj
’s member__cuda_array_interface__
and writes it toself._ptr
.object
that implements the Python buffer protocol:If the object represents a simple contiguous array, writes the
Py_buffer
associated withpyobj
toself._py_buffer
, sets theself._py_buffer_acquired
flag toTrue
, and writesself._py_buffer.buf
to the data pointerself._ptr
.-
Takes the pointer address
pyobj._ptr
and writes it toself._ptr
. No ownership is transferred.
Type checks are performed in the above order.
- C Attributes:
- _ptr (C type
void *
, protected): Stores a pointer to the data of the original Python object.
- _is_ptr_owner (C type
bint
, protected): If this wrapper is the owner of the underlying data.
- _py_buffer (C type ``Py_buffer`, protected):
Stores a pointer to the data of the original Python object.
- _py_buffer_acquired (C type
bint
, protected): Stores a pointer to the data of the original Python object.
- _ptr (C type
- static PROPERTIES()#
- __getitem__(key, /)#
Return self[key].
- __init__()#
Constructor type uint4.
Constructor for type uint4.
- as_c_void_p(self)#
Returns the data’s address as
ctypes.c_void_p
Note:Implemented as function to not collide with autogenerated property names.
- c_sizeof(self)#
Returns the size of the underlying C type in bytes. Note:
Implemented as function to not collide with autogenerated property names.
- createRef(self) Pointer #
Creates are reference to this pointer.
Returns a
Pointer
that stores the address of this `~.Pointer’s data pointer.- Note:
No ownership information is transferred.
- static fromObj(pyobj)#
Creates a uint4 from a Python object.
Derives a uint4 from the given Python object
pyobj
. In casepyobj
is itself anuint4
reference, this method returns it directly. No newuint4
is created in this case.
- get_w(self, i)#
Get value
w
of(<chiprand.uint4*>self._ptr)[i]
.
- get_x(self, i)#
Get value
x
of(<chiprand.uint4*>self._ptr)[i]
.
- get_y(self, i)#
Get value
y
of(<chiprand.uint4*>self._ptr)[i]
.
- get_z(self, i)#
Get value
z
of(<chiprand.uint4*>self._ptr)[i]
.
- is_ptr_null#
If data pointer is NULL.
- set_w(self, i, unsigned int value)#
Set value
w
of(<chiprand.uint4*>self._ptr)[i]
.
- set_x(self, i, unsigned int value)#
Set value
x
of(<chiprand.uint4*>self._ptr)[i]
.
- set_y(self, i, unsigned int value)#
Set value
y
of(<chiprand.uint4*>self._ptr)[i]
.
- set_z(self, i, unsigned int value)#
Set value
z
of(<chiprand.uint4*>self._ptr)[i]
.
- w#
(undocumented)
- x#
(undocumented)
- y#
(undocumented)
- z#
(undocumented)
- class hip.hiprand.rocrand_discrete_distribution_st(*args, **kwargs)#
Bases:
Pointer
Python wrapper for cdef class chiprand.rocrand_discrete_distribution_st.
Python wrapper for cdef class chiprand.rocrand_discrete_distribution_st.
If this type is initialized via its
__init__
method, it allocates a member of the underlying C type and destroys it again if the wrapper type is deallocated.This type also serves as adapter when appearing as argument type in a function signature. In this case, the type can further be initialized from a number of Python objects:
None
:This will set the
self._ptr
attribute toNULL
.int
:Interprets the integer value as pointer address and writes it to
self._ptr
. No ownership is transferred.-
Takes the pointer address
pyobj.value
and writes it toself._ptr
. No ownership is transferred. object
that implements the CUDA Array Interface protocol:Takes the integer-valued pointer address, i.e. the first entry of the
data
tuple frompyobj
’s member__cuda_array_interface__
and writes it toself._ptr
.object
that implements the Python buffer protocol:If the object represents a simple contiguous array, writes the
Py_buffer
associated withpyobj
toself._py_buffer
, sets theself._py_buffer_acquired
flag toTrue
, and writesself._py_buffer.buf
to the data pointerself._ptr
.-
Takes the pointer address
pyobj._ptr
and writes it toself._ptr
. No ownership is transferred.
Type checks are performed in the above order.
- C Attributes:
- _ptr (C type
void *
, protected): Stores a pointer to the data of the original Python object.
- _is_ptr_owner (C type
bint
, protected): If this wrapper is the owner of the underlying data.
- _py_buffer (C type ``Py_buffer`, protected):
Stores a pointer to the data of the original Python object.
- _py_buffer_acquired (C type
bint
, protected): Stores a pointer to the data of the original Python object.
- _ptr (C type
- static PROPERTIES()#
- __getitem__(key, /)#
Return self[key].
- __init__()#
Constructor type rocrand_discrete_distribution_st.
Constructor for type rocrand_discrete_distribution_st.
- alias#
Alias table Note:
Setting this alias can be dangerous if the underlying pointer is from a python object that is later on garbage collected.
- as_c_void_p(self)#
Returns the data’s address as
ctypes.c_void_p
Note:Implemented as function to not collide with autogenerated property names.
- c_sizeof(self)#
Returns the size of the underlying C type in bytes. Note:
Implemented as function to not collide with autogenerated property names.
- cdf#
Cumulative distribution function Note:
Setting this cdf can be dangerous if the underlying pointer is from a python object that is later on garbage collected.
- createRef(self) Pointer #
Creates are reference to this pointer.
Returns a
Pointer
that stores the address of this `~.Pointer’s data pointer.- Note:
No ownership information is transferred.
- static fromObj(pyobj)#
Creates a rocrand_discrete_distribution_st from a Python object.
Derives a rocrand_discrete_distribution_st from the given Python object
pyobj
. In casepyobj
is itself anrocrand_discrete_distribution_st
reference, this method returns it directly. No newrocrand_discrete_distribution_st
is created in this case.
- get_alias(self, i)#
Get value
alias
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.
- get_cdf(self, i)#
Get value
cdf
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.
- get_offset(self, i)#
Get value
offset
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.
- get_probability(self, i)#
Get value
probability
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.
- get_size(self, i)#
Get value
size
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.
- is_ptr_null#
If data pointer is NULL.
- offset#
The distribution can be offset
- probability#
Probability data for the alias table Note:
Setting this probability can be dangerous if the underlying pointer is from a python object that is later on garbage collected.
- set_alias(self, i, value)#
Set value
alias
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.- Note:
This can be dangerous if the pointer is from a python object that is later on garbage collected.
- set_cdf(self, i, value)#
Set value
cdf
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.- Note:
This can be dangerous if the pointer is from a python object that is later on garbage collected.
- set_offset(self, i, unsigned int value)#
Set value
offset
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.
- set_probability(self, i, value)#
Set value
probability
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.- Note:
This can be dangerous if the pointer is from a python object that is later on garbage collected.
- set_size(self, i, unsigned int value)#
Set value
size
of(<chiprand.rocrand_discrete_distribution_st*>self._ptr)[i]
.
- size#
Number of entries in the probability table
- hip.hiprand.rocrand_discrete_distribution#
alias of
rocrand_discrete_distribution_st
- class hip.hiprand.rocrand_generator_base_type#
Bases:
Pointer
Python wrapper for cdef class chiprand.rocrand_generator_base_type.
Python wrapper for cdef class chiprand.rocrand_generator_base_type.
If this type is initialized via its
__init__
method, it allocates a member of the underlying C type and destroys it again if the wrapper type is deallocated.This type also serves as adapter when appearing as argument type in a function signature. In this case, the type can further be initialized from a number of Python objects:
None
:This will set the
self._ptr
attribute toNULL
.int
:Interprets the integer value as pointer address and writes it to
self._ptr
. No ownership is transferred.-
Takes the pointer address
pyobj.value
and writes it toself._ptr
. No ownership is transferred. object
that implements the CUDA Array Interface protocol:Takes the integer-valued pointer address, i.e. the first entry of the
data
tuple frompyobj
’s member__cuda_array_interface__
and writes it toself._ptr
.object
that implements the Python buffer protocol:If the object represents a simple contiguous array, writes the
Py_buffer
associated withpyobj
toself._py_buffer
, sets theself._py_buffer_acquired
flag toTrue
, and writesself._py_buffer.buf
to the data pointerself._ptr
.-
Takes the pointer address
pyobj._ptr
and writes it toself._ptr
. No ownership is transferred.
Type checks are performed in the above order.
- C Attributes:
- _ptr (C type
void *
, protected): Stores a pointer to the data of the original Python object.
- _is_ptr_owner (C type
bint
, protected): If this wrapper is the owner of the underlying data.
- _py_buffer (C type ``Py_buffer`, protected):
Stores a pointer to the data of the original Python object.
- _py_buffer_acquired (C type
bint
, protected): Stores a pointer to the data of the original Python object.
- _ptr (C type
- static PROPERTIES()#
- __getitem__(key, /)#
Return self[key].
- __init__()#
Constructor.
- as_c_void_p(self)#
Returns the data’s address as
ctypes.c_void_p
Note:Implemented as function to not collide with autogenerated property names.
- createRef(self) Pointer #
Creates are reference to this pointer.
Returns a
Pointer
that stores the address of this `~.Pointer’s data pointer.- Note:
No ownership information is transferred.
- static fromObj(pyobj)#
Creates a rocrand_generator_base_type from a Python object.
Derives a rocrand_generator_base_type from the given Python object
pyobj
. In casepyobj
is itself anrocrand_generator_base_type
reference, this method returns it directly. No newrocrand_generator_base_type
is created in this case.
- is_ptr_null#
If data pointer is NULL.
- hip.hiprand.rocrand_generator#
alias of
rocrand_generator_base_type
- class hip.hiprand.rocrand_status(value)#
Bases:
_rocrand_status__Base
rocRAND function call status type
- Attributes:
- ROCRAND_STATUS_SUCCESS:
No errors
- ROCRAND_STATUS_VERSION_MISMATCH:
Header file and linked library version do not match
- ROCRAND_STATUS_NOT_CREATED:
Generator was not created using rocrand_create_generator
- ROCRAND_STATUS_ALLOCATION_FAILED:
Memory allocation failed during execution
- ROCRAND_STATUS_TYPE_ERROR:
Generator type is wrong
- ROCRAND_STATUS_OUT_OF_RANGE:
Argument out of range
- ROCRAND_STATUS_LENGTH_NOT_MULTIPLE:
Requested size is not a multiple of quasirandom generator’s dimension, or requested size is not even (see rocrand_generate_normal()), or pointer is misaligned (see rocrand_generate_normal())
- ROCRAND_STATUS_DOUBLE_PRECISION_REQUIRED:
GPU does not have double precision
- ROCRAND_STATUS_LAUNCH_FAILURE:
Kernel launch failure
- ROCRAND_STATUS_INTERNAL_ERROR:
Internal library error
- ROCRAND_STATUS_SUCCESS = 0#
- ROCRAND_STATUS_VERSION_MISMATCH = 100#
- ROCRAND_STATUS_NOT_CREATED = 101#
- ROCRAND_STATUS_ALLOCATION_FAILED = 102#
- ROCRAND_STATUS_TYPE_ERROR = 103#
- ROCRAND_STATUS_OUT_OF_RANGE = 104#
- ROCRAND_STATUS_LENGTH_NOT_MULTIPLE = 105#
- ROCRAND_STATUS_DOUBLE_PRECISION_REQUIRED = 106#
- ROCRAND_STATUS_LAUNCH_FAILURE = 107#
- ROCRAND_STATUS_INTERNAL_ERROR = 108#
- static ctypes_type()#
The type of the enum constants as ctypes type.
- class hip.hiprand.rocrand_rng_type(value)#
Bases:
_rocrand_rng_type__Base
rocRAND generator type
- Attributes:
- ROCRAND_RNG_PSEUDO_DEFAULT:
Default pseudorandom generator
- ROCRAND_RNG_PSEUDO_XORWOW:
XORWOW pseudorandom generator
- ROCRAND_RNG_PSEUDO_MRG32K3A:
MRG32k3a pseudorandom generator
- ROCRAND_RNG_PSEUDO_MTGP32:
Mersenne Twister MTGP32 pseudorandom generator
- ROCRAND_RNG_PSEUDO_PHILOX4_32_10:
PHILOX-4x32-10 pseudorandom generator
- ROCRAND_RNG_PSEUDO_MRG31K3P:
MRG31k3p pseudorandom generator
- ROCRAND_RNG_PSEUDO_LFSR113:
LFSR113 pseudorandom generator
- ROCRAND_RNG_PSEUDO_MT19937:
Mersenne Twister MT19937 pseudorandom generator
- ROCRAND_RNG_PSEUDO_THREEFRY2_32_20:
(undocumented)
- ROCRAND_RNG_PSEUDO_THREEFRY2_64_20:
(undocumented)
- ROCRAND_RNG_PSEUDO_THREEFRY4_32_20:
(undocumented)
- ROCRAND_RNG_PSEUDO_THREEFRY4_64_20:
(undocumented)
- ROCRAND_RNG_QUASI_DEFAULT:
Default quasirandom generator
- ROCRAND_RNG_QUASI_SOBOL32:
Sobol32 quasirandom generator
- ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32:
Scrambled Sobol32 quasirandom generator
- ROCRAND_RNG_QUASI_SOBOL64:
Sobol64 quasirandom generator
- ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64:
Scrambled Sobol64 quasirandom generator
- ROCRAND_RNG_PSEUDO_DEFAULT = 400#
- ROCRAND_RNG_PSEUDO_XORWOW = 401#
- ROCRAND_RNG_PSEUDO_MRG32K3A = 402#
- ROCRAND_RNG_PSEUDO_MTGP32 = 403#
- ROCRAND_RNG_PSEUDO_PHILOX4_32_10 = 404#
- ROCRAND_RNG_PSEUDO_MRG31K3P = 405#
- ROCRAND_RNG_PSEUDO_LFSR113 = 406#
- ROCRAND_RNG_PSEUDO_MT19937 = 407#
- ROCRAND_RNG_PSEUDO_THREEFRY2_32_20 = 408#
- ROCRAND_RNG_PSEUDO_THREEFRY2_64_20 = 409#
- ROCRAND_RNG_PSEUDO_THREEFRY4_32_20 = 410#
- ROCRAND_RNG_PSEUDO_THREEFRY4_64_20 = 411#
- ROCRAND_RNG_QUASI_DEFAULT = 500#
- ROCRAND_RNG_QUASI_SOBOL32 = 501#
- ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32 = 502#
- ROCRAND_RNG_QUASI_SOBOL64 = 504#
- ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64 = 505#
- static ctypes_type()#
The type of the enum constants as ctypes type.
- class hip.hiprand.rocrand_ordering(value)#
Bases:
_rocrand_ordering__Base
rocRAND generator ordering
- Attributes:
- ROCRAND_ORDERING_PSEUDO_BEST:
Best ordering for pseudorandom results
- ROCRAND_ORDERING_PSEUDO_DEFAULT:
Default ordering for pseudorandom results
- ROCRAND_ORDERING_PSEUDO_SEEDED:
Fast lower quality pseudorandom results
- ROCRAND_ORDERING_PSEUDO_LEGACY:
Legacy ordering for pseudorandom results
- ROCRAND_ORDERING_PSEUDO_DYNAMIC:
Adjust to the device executing the generator
- ROCRAND_ORDERING_QUASI_DEFAULT:
n-dimensional ordering for quasirandom results
- ROCRAND_ORDERING_PSEUDO_BEST = 100#
- ROCRAND_ORDERING_PSEUDO_DEFAULT = 101#
- ROCRAND_ORDERING_PSEUDO_SEEDED = 102#
- ROCRAND_ORDERING_PSEUDO_LEGACY = 103#
- ROCRAND_ORDERING_PSEUDO_DYNAMIC = 104#
- ROCRAND_ORDERING_QUASI_DEFAULT = 201#
- static ctypes_type()#
The type of the enum constants as ctypes type.
- class hip.hiprand.rocrand_direction_vector_set(value)#
Bases:
_rocrand_direction_vector_set__Base
rocRAND vector set
- Attributes:
- ROCRAND_DIRECTION_VECTORS_32_JOEKUO6:
(undocumented)
- ROCRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6:
(undocumented)
- ROCRAND_DIRECTION_VECTORS_64_JOEKUO6:
(undocumented)
- ROCRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6:
(undocumented)
- ROCRAND_DIRECTION_VECTORS_32_JOEKUO6 = 101#
- ROCRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6 = 102#
- ROCRAND_DIRECTION_VECTORS_64_JOEKUO6 = 103#
- ROCRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6 = 104#
- static ctypes_type()#
The type of the enum constants as ctypes type.
- hip.hiprand.hiprandGenerator_st#
alias of
rocrand_generator_base_type
- hip.hiprand.hiprandDiscreteDistribution_st#
alias of
rocrand_discrete_distribution_st
- class hip.hiprand.hiprandDirectionVectors32_t#
Bases:
Pointer
Python wrapper for cdef class chiprand.hiprandDirectionVectors32_t.
Python wrapper for cdef class chiprand.hiprandDirectionVectors32_t.
If this type is initialized via its
__init__
method, it allocates a member of the underlying C type and destroys it again if the wrapper type is deallocated.This type also serves as adapter when appearing as argument type in a function signature. In this case, the type can further be initialized from a number of Python objects:
None
:This will set the
self._ptr
attribute toNULL
.int
:Interprets the integer value as pointer address and writes it to
self._ptr
. No ownership is transferred.-
Takes the pointer address
pyobj.value
and writes it toself._ptr
. No ownership is transferred. object
that implements the CUDA Array Interface protocol:Takes the integer-valued pointer address, i.e. the first entry of the
data
tuple frompyobj
’s member__cuda_array_interface__
and writes it toself._ptr
.object
that implements the Python buffer protocol:If the object represents a simple contiguous array, writes the
Py_buffer
associated withpyobj
toself._py_buffer
, sets theself._py_buffer_acquired
flag toTrue
, and writesself._py_buffer.buf
to the data pointerself._ptr
.-
Takes the pointer address
pyobj._ptr
and writes it toself._ptr
. No ownership is transferred.
Type checks are performed in the above order.
- C Attributes:
- _ptr (C type
void *
, protected): Stores a pointer to the data of the original Python object.
- _is_ptr_owner (C type
bint
, protected): If this wrapper is the owner of the underlying data.
- _py_buffer (C type ``Py_buffer`, protected):
Stores a pointer to the data of the original Python object.
- _py_buffer_acquired (C type
bint
, protected): Stores a pointer to the data of the original Python object.
- _ptr (C type
- __getitem__(key, /)#
Return self[key].
- __init__()#
Constructor.
- as_c_void_p(self)#
Returns the data’s address as
ctypes.c_void_p
Note:Implemented as function to not collide with autogenerated property names.
- c_sizeof(self)#
Returns the size of the underlying C type in bytes. Note:
Implemented as function to not collide with autogenerated property names.
- createRef(self) Pointer #
Creates are reference to this pointer.
Returns a
Pointer
that stores the address of this `~.Pointer’s data pointer.- Note:
No ownership information is transferred.
- static fromObj(pyobj)#
Creates a hiprandDirectionVectors32_t from a Python object.
Derives a hiprandDirectionVectors32_t from the given Python object
pyobj
. In casepyobj
is itself anhiprandDirectionVectors32_t
reference, this method returns it directly. No newhiprandDirectionVectors32_t
is created in this case.
- is_ptr_null#
If data pointer is NULL.
- class hip.hiprand.hiprandDirectionVectors64_t#
Bases:
Pointer
Python wrapper for cdef class chiprand.hiprandDirectionVectors64_t.
Python wrapper for cdef class chiprand.hiprandDirectionVectors64_t.
If this type is initialized via its
__init__
method, it allocates a member of the underlying C type and destroys it again if the wrapper type is deallocated.This type also serves as adapter when appearing as argument type in a function signature. In this case, the type can further be initialized from a number of Python objects:
None
:This will set the
self._ptr
attribute toNULL
.int
:Interprets the integer value as pointer address and writes it to
self._ptr
. No ownership is transferred.-
Takes the pointer address
pyobj.value
and writes it toself._ptr
. No ownership is transferred. object
that implements the CUDA Array Interface protocol:Takes the integer-valued pointer address, i.e. the first entry of the
data
tuple frompyobj
’s member__cuda_array_interface__
and writes it toself._ptr
.object
that implements the Python buffer protocol:If the object represents a simple contiguous array, writes the
Py_buffer
associated withpyobj
toself._py_buffer
, sets theself._py_buffer_acquired
flag toTrue
, and writesself._py_buffer.buf
to the data pointerself._ptr
.-
Takes the pointer address
pyobj._ptr
and writes it toself._ptr
. No ownership is transferred.
Type checks are performed in the above order.
- C Attributes:
- _ptr (C type
void *
, protected): Stores a pointer to the data of the original Python object.
- _is_ptr_owner (C type
bint
, protected): If this wrapper is the owner of the underlying data.
- _py_buffer (C type ``Py_buffer`, protected):
Stores a pointer to the data of the original Python object.
- _py_buffer_acquired (C type
bint
, protected): Stores a pointer to the data of the original Python object.
- _ptr (C type
- __getitem__(key, /)#
Return self[key].
- __init__()#
Constructor.
- as_c_void_p(self)#
Returns the data’s address as
ctypes.c_void_p
Note:Implemented as function to not collide with autogenerated property names.
- c_sizeof(self)#
Returns the size of the underlying C type in bytes. Note:
Implemented as function to not collide with autogenerated property names.
- createRef(self) Pointer #
Creates are reference to this pointer.
Returns a
Pointer
that stores the address of this `~.Pointer’s data pointer.- Note:
No ownership information is transferred.
- static fromObj(pyobj)#
Creates a hiprandDirectionVectors64_t from a Python object.
Derives a hiprandDirectionVectors64_t from the given Python object
pyobj
. In casepyobj
is itself anhiprandDirectionVectors64_t
reference, this method returns it directly. No newhiprandDirectionVectors64_t
is created in this case.
- is_ptr_null#
If data pointer is NULL.
- hip.hiprand.hiprandGenerator_t#
alias of
rocrand_generator_base_type
- hip.hiprand.hiprandDiscreteDistribution_t#
alias of
rocrand_discrete_distribution_st
- class hip.hiprand.hiprandStatus(value)#
Bases:
_hiprandStatus__Base
hipRAND function call status type
- Attributes:
- HIPRAND_STATUS_SUCCESS:
Success
- HIPRAND_STATUS_VERSION_MISMATCH:
Header file and linked library version do not match
- HIPRAND_STATUS_NOT_INITIALIZED:
Generator not created
- HIPRAND_STATUS_ALLOCATION_FAILED:
Memory allocation failed
- HIPRAND_STATUS_TYPE_ERROR:
Generator type is wrong
- HIPRAND_STATUS_OUT_OF_RANGE:
Argument out of range
- HIPRAND_STATUS_LENGTH_NOT_MULTIPLE:
Requested size is not a multiple of quasirandom generator’s dimension, or requested size is not even (see hiprandGenerateNormal()), or pointer is misaligned (see hiprandGenerateNormal())
- HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED:
GPU does not have double precision
- HIPRAND_STATUS_LAUNCH_FAILURE:
Kernel launch failure
- HIPRAND_STATUS_PREEXISTING_FAILURE:
Preexisting failure on library entry
- HIPRAND_STATUS_INITIALIZATION_FAILED:
Initialization of HIP failed
- HIPRAND_STATUS_ARCH_MISMATCH:
Architecture mismatch, GPU does not support requested feature
- HIPRAND_STATUS_INTERNAL_ERROR:
Internal library error
- HIPRAND_STATUS_NOT_IMPLEMENTED:
Feature not implemented yet
- HIPRAND_STATUS_SUCCESS = 0#
- HIPRAND_STATUS_VERSION_MISMATCH = 100#
- HIPRAND_STATUS_NOT_INITIALIZED = 101#
- HIPRAND_STATUS_ALLOCATION_FAILED = 102#
- HIPRAND_STATUS_TYPE_ERROR = 103#
- HIPRAND_STATUS_OUT_OF_RANGE = 104#
- HIPRAND_STATUS_LENGTH_NOT_MULTIPLE = 105#
- HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED = 106#
- HIPRAND_STATUS_LAUNCH_FAILURE = 201#
- HIPRAND_STATUS_PREEXISTING_FAILURE = 202#
- HIPRAND_STATUS_INITIALIZATION_FAILED = 203#
- HIPRAND_STATUS_ARCH_MISMATCH = 204#
- HIPRAND_STATUS_INTERNAL_ERROR = 999#
- HIPRAND_STATUS_NOT_IMPLEMENTED = 1000#
- static ctypes_type()#
The type of the enum constants as ctypes type.
- hip.hiprand.hiprandStatus_t#
alias of
hiprandStatus
- class hip.hiprand.hiprandRngType(value)#
Bases:
_hiprandRngType__Base
hipRAND generator type
- Attributes:
HIPRAND_RNG_TEST:
- HIPRAND_RNG_PSEUDO_DEFAULT:
Default pseudorandom generator
- HIPRAND_RNG_PSEUDO_XORWOW:
XORWOW pseudorandom generator
- HIPRAND_RNG_PSEUDO_MRG32K3A:
MRG32k3a pseudorandom generator
- HIPRAND_RNG_PSEUDO_MTGP32:
Mersenne Twister MTGP32 pseudorandom generator
- HIPRAND_RNG_PSEUDO_MT19937:
Mersenne Twister 19937
- HIPRAND_RNG_PSEUDO_PHILOX4_32_10:
PHILOX_4x32 (10 rounds) pseudorandom generator
- HIPRAND_RNG_QUASI_DEFAULT:
Default quasirandom generator
- HIPRAND_RNG_QUASI_SOBOL32:
Sobol32 quasirandom generator
- HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32:
Scrambled Sobol32 quasirandom generator
- HIPRAND_RNG_QUASI_SOBOL64:
Sobol64 quasirandom generator
- HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64:
Scrambled Sobol64 quasirandom generator
- HIPRAND_RNG_TEST = 0#
- HIPRAND_RNG_PSEUDO_DEFAULT = 400#
- HIPRAND_RNG_PSEUDO_XORWOW = 401#
- HIPRAND_RNG_PSEUDO_MRG32K3A = 402#
- HIPRAND_RNG_PSEUDO_MTGP32 = 403#
- HIPRAND_RNG_PSEUDO_MT19937 = 404#
- HIPRAND_RNG_PSEUDO_PHILOX4_32_10 = 405#
- HIPRAND_RNG_QUASI_DEFAULT = 500#
- HIPRAND_RNG_QUASI_SOBOL32 = 501#
- HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32 = 502#
- HIPRAND_RNG_QUASI_SOBOL64 = 503#
- HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64 = 504#
- static ctypes_type()#
The type of the enum constants as ctypes type.
- hip.hiprand.hiprandRngType_t#
alias of
hiprandRngType
- class hip.hiprand.hiprandDirectionVectorSet(value)#
Bases:
_hiprandDirectionVectorSet__Base
- Attributes:
- HIPRAND_DIRECTION_VECTORS_32_JOEKUO6:
(undocumented)
- HIPRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6:
(undocumented)
- HIPRAND_DIRECTION_VECTORS_64_JOEKUO6:
(undocumented)
- HIPRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6:
(undocumented)
- HIPRAND_DIRECTION_VECTORS_32_JOEKUO6 = 101#
- HIPRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6 = 102#
- HIPRAND_DIRECTION_VECTORS_64_JOEKUO6 = 103#
- HIPRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6 = 104#
- static ctypes_type()#
The type of the enum constants as ctypes type.
- hip.hiprand.hiprandDirectionVectorSet_t#
alias of
hiprandDirectionVectorSet
- hip.hiprand.hiprandCreateGenerator(rng_type)#
Creates a new random number generator.
Creates a new random number generator of type
rng_type,
and returns it ingenerator.
That generator will use GPU to create random numbers.Values for
rng_type
are: - HIPRAND_RNG_PSEUDO_DEFAULT - HIPRAND_RNG_PSEUDO_XORWOW - HIPRAND_RNG_PSEUDO_MRG32K3A - HIPRAND_RNG_PSEUDO_MTGP32 - HIPRAND_RNG_PSEUDO_MT19937 - HIPRAND_RNG_PSEUDO_PHILOX4_32_10 - HIPRAND_RNG_QUASI_DEFAULT - HIPRAND_RNG_QUASI_SOBOL32 - HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32 - HIPRAND_RNG_QUASI_SOBOL64 - HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64- Args:
- rng_type (
hiprandRngType
): Type of random number generator to create
- rng_type (
- Returns:
A
tuple
of size 2 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_ALLOCATION_FAILED, if memory allocation failedHIPRAND_STATUS_INITIALIZATION_FAILED if there was a problem setting up the GPU
HIPRAND_STATUS_VERSION_MISMATCH if the header file version does not match the dynamically linked library version
HIPRAND_STATUS_TYPE_ERROR if the value for
rng_type
is invalidHIPRAND_STATUS_NOT_IMPLEMENTED if generator of type
rng_type
is not implemented yetHIPRAND_STATUS_SUCCESS if generator was created successfully
rocrand_generator_base_type
:Pointer to generator
- hip.hiprand.hiprandCreateGeneratorHost(rng_type)#
Creates a new random number generator on host.
Creates a new host random number generator of type
rng_type
and returns it ingenerator.
Created generator will use host CPU to generate random numbers.Values for
rng_type
are: - HIPRAND_RNG_PSEUDO_DEFAULT - HIPRAND_RNG_PSEUDO_XORWOW - HIPRAND_RNG_PSEUDO_MRG32K3A - HIPRAND_RNG_PSEUDO_MTGP32 - HIPRAND_RNG_PSEUDO_MT19937 - HIPRAND_RNG_PSEUDO_PHILOX4_32_10 - HIPRAND_RNG_QUASI_DEFAULT - HIPRAND_RNG_QUASI_SOBOL32 - HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32 - HIPRAND_RNG_QUASI_SOBOL64 - HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64- Args:
- rng_type (
hiprandRngType
): Type of random number generator to create
- rng_type (
- Returns:
A
tuple
of size 2 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_ALLOCATION_FAILED, if memory allocation failedHIPRAND_STATUS_VERSION_MISMATCH if the header file version does not match the dynamically linked library version
HIPRAND_STATUS_TYPE_ERROR if the value for
rng_type
is invalidHIPRAND_STATUS_NOT_IMPLEMENTED if host generator of type
rng_type
is not implemented yetHIPRAND_STATUS_SUCCESS if generator was created successfully
rocrand_generator_base_type
:Pointer to generator
- hip.hiprand.hiprandDestroyGenerator(generator)#
Destroys random number generator.
Destroys random number generator and frees related memory.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to be destroyed
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_SUCCESS if generator was destroyed successfully
- hip.hiprand.hiprandGenerate(generator, output_data, unsigned long n)#
Generates uniformly distributed 32-bit unsigned integers.
Generates
n
uniformly distributed 32-bit unsigned integers and saves them tooutput_data.
Generated numbers are between
0
and2^32,
including0
and excluding2^32.
Note:
generator
must be not be of typeHIPRAND_RNG_QUASI_SOBOL64
orHIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of 32-bit unsigned integers to generate
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateChar(generator, output_data, unsigned long n)#
Generates uniformly distributed 8-bit unsigned integers.
Generates
n
uniformly distributed 8-bit unsigned integers and saves them tooutput_data.
Generated numbers are between
0
and2^8,
including0
and excluding2^8.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of 8-bit unsigned integers to generate
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateShort(generator, output_data, unsigned long n)#
Generates uniformly distributed 16-bit unsigned integers.
Generates
n
uniformly distributed 16-bit unsigned integers and saves them tooutput_data.
Generated numbers are between
0
and2^16,
including0
and excluding2^16.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of 16-bit unsigned integers to generate
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateLongLong(generator, output_data, unsigned long n)#
Generates uniformly distributed 64-bit unsigned integers.
Generates
n
uniformly distributed 64-bit unsigned integers and saves them tooutput_data.
Generated numbers are between
0
and2^64,
including0
and excluding2^64.
Note:
generator
must be of typeHIPRAND_RNG_QUASI_SOBOL64
orHIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of 64-bit unsigned integers to generate
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateUniform(generator, output_data, unsigned long n)#
Generates uniformly distributed floats.
Generates
n
uniformly distributed 32-bit floating-point values and saves them tooutput_data.
Generated numbers are between
0.0f
and1.0f,
excluding0.0f
and including1.0f.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of floats to generate
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not a multiple of the dimension
of used quasi-random generator
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateUniformDouble(generator, output_data, unsigned long n)#
Generates uniformly distributed double-precision floating-point values.
Generates
n
uniformly distributed 64-bit double-precision floating-point values and saves them tooutput_data.
Generated numbers are between
0.0
and1.0,
excluding0.0
and including1.0.
Note: When
generator
is of type:HIPRAND_RNG_PSEUDO_MRG32K3A,
HIPRAND_RNG_PSEUDO_MTGP32,
HIPRAND_RNG_QUASI_SOBOL32,
orHIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32
then the returneddouble
values are generated from only 32 random bits each (one <tt>unsigned int</tt> value per one generateddouble).
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of floats to generate
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not a multiple of the dimension
of used quasi-random generator
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateUniformHalf(generator, output_data, unsigned long n)#
Generates uniformly distributed half-precision floating-point values.
Generates
n
uniformly distributed 16-bit half-precision floating-point values and saves them tooutput_data.
Generated numbers are between
0.0
and1.0,
excluding0.0
and including1.0.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of halfs to generate
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not a multiple of the dimension
of used quasi-random generator
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateNormal(generator, output_data, unsigned long n, float mean, float stddev)#
Generates normally distributed floats.
Generates
n
normally distributed 32-bit floating-point values and saves them tooutput_data.
- Args:
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not even,output_data
is not
aligned to
sizeof(float2)
bytes, orn
is not a multiple of the dimension of used quasi-random generatorHIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateNormalDouble(generator, output_data, unsigned long n, double mean, double stddev)#
Generates normally distributed doubles.
Generates
n
normally distributed 64-bit double-precision floating-point numbers and saves them tooutput_data.
- Args:
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not even,output_data
is not
aligned to
sizeof(double2)
bytes, orn
is not a multiple of the dimension of used quasi-random generatorHIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateNormalHalf(generator, output_data, unsigned long n, int mean, int stddev)#
Generates normally distributed halfs.
Generates
n
normally distributed 16-bit half-precision floating-point numbers and saves them tooutput_data.
- Args:
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not even,output_data
is not
aligned to
sizeof(half2)
bytes, orn
is not a multiple of the dimension of used quasi-random generatorHIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateLogNormal(generator, output_data, unsigned long n, float mean, float stddev)#
Generates log-normally distributed floats.
Generates
n
log-normally distributed 32-bit floating-point values and saves them tooutput_data.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of floats to generate
- mean (
float
/int
): Mean value of log normal distribution
- stddev (
float
/int
): Standard deviation value of log normal distribution
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not even,output_data
is not
aligned to
sizeof(float2)
bytes, orn
is not a multiple of the dimension of used quasi-random generatorHIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateLogNormalDouble(generator, output_data, unsigned long n, double mean, double stddev)#
Generates log-normally distributed doubles.
Generates
n
log-normally distributed 64-bit double-precision floating-point values and saves them tooutput_data.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to use
- output_data (
Pointer
/object
): Pointer to memory to store generated numbers
- n (
int
): Number of doubles to generate
- mean (
float
/int
): Mean value of log normal distribution
- stddev (
float
/int
): Standard deviation value of log normal distribution
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not even,output_data
is not
aligned to
sizeof(double2)
bytes, orn
is not a multiple of the dimension of used quasi-random generatorHIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateLogNormalHalf(generator, output_data, unsigned long n, int mean, int stddev)#
Generates log-normally distributed halfs.
Generates
n
log-normally distributed 16-bit half-precision floating-point values and saves them tooutput_data.
- Args:
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not even,output_data
is not
aligned to
sizeof(half2)
bytes, orn
is not a multiple of the dimension of used quasi-random generatorHIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGeneratePoisson(generator, output_data, unsigned long n, double lambda_)#
Generates Poisson-distributed 32-bit unsigned integers.
Generates
n
Poisson-distributed 32-bit unsigned integers and saves them tooutput_data.
- Args:
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_LAUNCH_FAILURE if generator failed to launch kernel
HIPRAND_STATUS_OUT_OF_RANGE if lambda is non-positive
HIPRAND_STATUS_LENGTH_NOT_MULTIPLE if
n
is not a multiple of the dimension
of used quasi-random generator
HIPRAND_STATUS_SUCCESS if random numbers were successfully generated
- hip.hiprand.hiprandGenerateSeeds(generator)#
Initializes the generator’s state on GPU or host.
Initializes the generator’s state on GPU or host.
If hiprandGenerateSeeds() was not called for a generator, it will be automatically called by functions which generates random numbers like hiprandGenerate(), hiprandGenerateUniform(), hiprandGenerateNormal() etc.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to initialize
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was never createdHIPRAND_STATUS_PREEXISTING_FAILURE if there was an existing error from a previous kernel launch
HIPRAND_STATUS_LAUNCH_FAILURE if the kernel launch failed for any reason
HIPRAND_STATUS_SUCCESS if the seeds were generated successfully
- hip.hiprand.hiprandSetStream(generator, stream)#
Sets the current stream for kernel launches.
Sets the current stream for all kernel launches of the generator. All functions will use this stream.
- Args:
- generator (
rocrand_generator_base_type
/object
): Generator to modify
- stream (
ihipStream_t
/object
): Stream to use or NULL for default stream
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_SUCCESS if stream was set successfully
- hip.hiprand.hiprandSetPseudoRandomGeneratorSeed(generator, unsigned long long seed)#
Sets the seed of a pseudo-random number generator.
Sets the seed of the pseudo-random number generator.
This operation resets the generator’s internal state.
This operation does not change the generator’s offset.
- Args:
- generator (
rocrand_generator_base_type
/object
): Pseudo-random number generator
- seed (
int
): New seed value
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_TYPE_ERROR if the generator is a quasi random number generator
HIPRAND_STATUS_SUCCESS if seed was set successfully
- hip.hiprand.hiprandSetGeneratorOffset(generator, unsigned long long offset)#
Sets the offset of a random number generator.
Sets the absolute offset of the random number generator.
This operation resets the generator’s internal state.
This operation does not change the generator’s seed.
Absolute offset cannot be set if generator’s type is HIPRAND_RNG_PSEUDO_MTGP32 or HIPRAND_RNG_PSEUDO_MT19937.
- Args:
- generator (
rocrand_generator_base_type
/object
): Random number generator
- offset (
int
): New absolute offset
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_INITIALIZED if the generator was not initializedHIPRAND_STATUS_SUCCESS if offset was successfully set
HIPRAND_STATUS_TYPE_ERROR if generator’s type is HIPRAND_RNG_PSEUDO_MTGP32
or HIPRAND_RNG_PSEUDO_MT19937
- hip.hiprand.hiprandSetQuasiRandomGeneratorDimensions(generator, unsigned int dimensions)#
Set the number of dimensions of a quasi-random number generator.
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.
- Args:
- generator (
rocrand_generator_base_type
/object
): Quasi-random number generator
- dimensions (
int
): Number of dimensions
- generator (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_NOT_CREATED if the generator wasn’t createdHIPRAND_STATUS_TYPE_ERROR if the generator is not a quasi-random number generator
HIPRAND_STATUS_OUT_OF_RANGE if
dimensions
is out of rangeHIPRAND_STATUS_SUCCESS if the number of dimensions was set successfully
- hip.hiprand.hiprandGetVersion()#
Returns the version number of the cuRAND or rocRAND library.
Returns in
version
the version number of the underlying cuRAND or rocRAND library.- Returns:
A
tuple
of size 2 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_OUT_OF_RANGE ifversion
is NULLHIPRAND_STATUS_SUCCESS if the version number was successfully returned
int
:Version of the library
- hip.hiprand.hiprandCreatePoissonDistribution(double lambda_)#
Construct the histogram for a Poisson distribution.
Construct the histogram for the Poisson distribution with lambda
lambda.
- Args:
- Returns:
A
tuple
of size 2 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_ALLOCATION_FAILED if memory could not be allocatedHIPRAND_STATUS_OUT_OF_RANGE if
discrete_distribution
pointer was nullHIPRAND_STATUS_OUT_OF_RANGE if lambda is non-positive
HIPRAND_STATUS_SUCCESS if the histogram was constructed successfully
rocrand_discrete_distribution_st
:pointer to the histogram in device memory
- hip.hiprand.hiprandDestroyDistribution(discrete_distribution)#
Destroy the histogram array for a discrete distribution.
Destroy the histogram array for a discrete distribution created by hiprandCreatePoissonDistribution.
- Args:
- discrete_distribution (
rocrand_discrete_distribution_st
/object
): pointer to the histogram in device memory
- discrete_distribution (
- Returns:
A
tuple
of size 1 that contains (in that order):hiprandStatus
: HIPRAND_STATUS_OUT_OF_RANGE ifdiscrete_distribution
was nullHIPRAND_STATUS_SUCCESS if the histogram was destroyed successfully
- hip.hiprand.hiprandGetDirectionVectors32(set)#
(No short description, might be part of a group.)
- Args:
- set (
hiprandDirectionVectorSet
): (undocumented)
- set (
- Returns:
A
tuple
of size 1 that contains (in that order):- vectors (
hiprandDirectionVectors32_t
): (undocumented)
- vectors (
- hip.hiprand.hiprandGetDirectionVectors64(set)#
(No short description, might be part of a group.)
- Args:
- set (
hiprandDirectionVectorSet
): (undocumented)
- set (
- Returns:
A
tuple
of size 1 that contains (in that order):- vectors (
hiprandDirectionVectors64_t
): (undocumented)
- vectors (
- hip.hiprand.hiprandGetScrambleConstants32(constants)#
(No short description, might be part of a group.)
- Args:
- constants (
ListOfUnsigned
/object
): (undocumented)
- constants (