Execution Traits#
Execution traits can be retrieved directly from a RNG function descriptor, if the description is a complete execution.
The available execution traits may depend on the execution operator used to build the descriptor. For example a descriptor built with Block operator should have the block dimension and shared memory size traits, but they are not needed for a descriptor built with Thread operator. Conversely, all the traits available for thread executions can also be used in block or device executions.
While cuRANDDx 0.1.0 release only supports Thread operator, Block or Device execution operators will be introduced in future releases and thus block- or device-level execution specific traits will be added.
Thread Execution Traits#
Trait |
Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
Data type of the output random bits generated by the generator, |
|
Data type of the input offset, |
|
Data type of the input direction vector, |
|
Data type of the input scrambled const for scrambled SOBOL generators, |
Threads traits can be retrieved from descriptors built with either Thread, Block, or Device operator.
For example to use execution traits in a user code:
#include <curanddx.hpp>
using RNG = decltype(curanddx::Generator<curanddx::philox4_32>()
+ curanddx::PhiloxRounds<7>()
+ curanddx::SM<800>());
using offset_type = typename RNG::offset_type;
is_generator_pseudo_random Trait#
RNG::is_generator_pseudo_random
The trait is true if the generator is pseudorandom, false otherwise. Determined by Generator Operator.
is_generator_sobol Trait#
RNG::is_generator_sobol
The trait is true if the generator is quasirandom, false otherwise. Determined by Generator Operator.
is_generator_32bits Trait#
RNG::is_generator_32bits
The trait is true if the generator is one of the 32-bit generators, which include all pseudorandom generators and 32-bit sobol generators, false otherwise.. Determined by Generator Operator.
is_generator_64bits Trait#
RNG::is_generator_64bits
The trait is true if the generator is either sobol64 or scrambled64, false otherwise. Determined by Generator Operator.
is_generator_philox Trait#
RNG::is_generator_philox
The trait is true for the philox generator, false otherwise. Determined by Generator Operator.
bitgenerator_result_type Trait#
RNG::bitgenerator_result_type
The result data type of the generated random bits. Determined by Generator Operator.
Bitgenerator result type is:
unsigned intfor 32-bit generators, includingxorwow,mrg32k3a,pcg,sobol32, andscrambled_sobol32,uint4forphiloxbecause four values are generated by the Philox generator at a time, andunsigned long longfor 64-bit generaotorssobol64andscrambled_sobol64.
offset_type Trait#
RNG::offset_type
Data type of the input offset. Determined by Generator Operator.
Offset data type is
unsigned intif both is_generator_sobol Trait and is_generator_32bits Trait are true, andunsigned long longotherwise.
direction_vector_type Trait#
RNG::direction_vector_type
Data type of the input direction vector used by the quasirandom sobol generators. Determined by Generator Operator.
Direction vector type is
curandDirectionVectors32_tforsobol32orscrambled_sobol32,curandDirectionVectors64_tforsobol64orscrambled_sobol64, andvoidotherwise.
scrambled_const_type Trait#
RNG::scrambled_const_type
Data type of the input scrambled constant used by the quasirandom scrambled sobol generator. Determined by Generator Operator.
Scrambled constant data type is
unsigned intif the generator isscrambled_sobol32,unsigned long longif the generator isscrambled_sobol64, andvoidotherwise.