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

Description::is_generator_pseudo_random

true if the generator is pseudorandom, false otherwise.

Description::is_generator_sobol

true if the generator is quasirandom, false otherwise.

Description::is_generator_32bits

true if the generator is a 32-bit generator, false otherwise.

Description::is_generator_64bits

true if the generator is a 64-bit generator, false otherwise.

Description::is_generator_philox

true if the generator is the counter-based Philox4_32 generator, false otherwise.

Description::bitgenerator_result_type

Data type of the output random bits generated by the generator, unsigned int for 32-bit generators other than Philox, uint4 for Philox, and unsigned long long for 64-bit generators.

Description::offset_type

Data type of the input offset, unsigned int for 32-bit quasirandom generators, and unsigned long long for other generators.

Description::direction_vector_type

Data type of the input direction vector, void if is_generator_sobol Trait is false.

Description::scrambled_const_type

Data type of the input scrambled const for scrambled SOBOL generators, void for any other 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<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 int for 32-bit generators, including xorwow, mrg32k3a, pcg, sobol32, and scrambled_sobol32,

  • uint4 for philox because four values are generated by the Philox generator at a time, and

  • unsigned long long for 64-bit generaotors sobol64 and scrambled_sobol64.

offset_type Trait#

RNG::offset_type

Data type of the input offset. Determined by Generator Operator.

Offset data type is

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_t for sobol32 or scrambled_sobol32,

  • curandDirectionVectors64_t for sobol64 or scrambled_sobol64, and

  • void otherwise.

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 int if the generator is scrambled_sobol32,

  • unsigned long long if the generator is scrambled_sobol64, and

  • void otherwise.