Description Operators#

Description operators define the problem we want to solve. Combined with execution operators, they form a complete function descriptor that can be executed on a GPU.

Operator

Default Value

Description

Generator<gen>

curanddx::philox4_32

The type of generator requested, choice of (xorwow, mrg32k3a, philox4_32, pcg, sobol32, scrambled_sobol32, sobol64, scrambled_sobol64).

PhiloxRounds<N>

10

Round count of iterated bijections for the Philox4_32 generator. The operator is ignored if the generator is other than Philox.

SM<CC>

Not set

Target CUDA architecture for which the cuRANDDx function should be generated.

Operators can be added, in arbitrary order, to construct the operation descriptor type. For example, to describe random number generation using Philox4_32 generator with 7-round bijections, executed on Ampere architecture, one would write:

#include <curanddx.hpp>

using RNG = decltype(curanddx::Generator<curanddx::philox4_32>()
                   + curanddx::PhiloxRounds<7>()
                   + curanddx::SM<800>());

For a function descriptor to be complete, the following is required:

Generator Operator#

curanddx::Generator<gen>();

The type of random number generator requested. Supported gen values are:

  • xorwow: XORWOR pseudorandom generator, same as CURAND_RNG_PSEUDO_XORWOW generator type in cuRAND.

  • mrg32k3a: MRG32K3A pseudorandom generator, same as CURAND_RNG_PSEUDO_MRG32K3A generator type in cuRAND.

  • philox4_32: counter-based Philox-4x32 pseudorandom generator with user-defined round count. If the number of rounds is 10, the default number, then the generator is the same as CURAND_RNG_PSEUDO_PHILOX4_32_10 generator type in cuRAND.

  • pcg: PCG pseudorandom generator.

  • sobol32: SOBOL32 quasirandom generator, same as CURAND_RNG_QUASI_SOBOL32 generator type in cuRAND.

  • scrambled_sobol32: Scrambled SOBOL32 quasirandom generator, same as CURAND_RNG_QUASI_SCRAMBLED_SOBOL32 generator type in cuRAND.

  • sobol64: SOBOL32 quasirandom generator, same as CURAND_RNG_QUASI_SOBOL64 generator type in cuRAND.

  • scrambled_sobol32: Scrambled SOBOL64 quasirandom generator, same as CURAND_RNG_QUASI_SCRAMBLED_SOBOL64 generator type in cuRAND.

If the generator operator is not defined, the Philox4_32 generator is the default.

PhiloxRounds Operator#

cubladx::PhiloxRounds<N>;

Sets the number of rounds to run non-cryptographic bijections for the Philox generator. Combing the PhiloxRounds operator with non-Philox generator operator is not allowed, leading to compilation errors.

Acceptable N is [6, 7, 8, 9, 10]. These rounds values guarantee Crush-resistance with safety margin while achieving good performance.

Note

In rare cases where the round count outside of [6, 10] is appropriate for some use cases, user can compile with -DCURANDDX_PHILOX_ROUNDS_CHECK_DISABLED to disable the bound verification.

SM Operator#

curanddx::SM<unsigned int CC>()

Sets the target architecture CC for the underlying RNG function to use. Supported architectures are:

  • Volta: 700 and 720 (sm_70, sm_72).

  • Turing: 750 (sm_75).

  • Ampere: 800, 860 and 870 (sm_80, sm_86, sm_87).

  • Ada: 890 (sm_89).

  • Hopper: 900 (sm_90, sm_90a).

  • Blackwell: 1000, 1010, 1030, 1200, 1210 (sm_100, sm_101, sm_103, sm_120, sm_121).

Warning

Starting with cuSolverDx 0.2.0, support for NVIDIA Xavier Tegra SoC (SM<720> or sm_72) is deprecated.

Warning

Support for architectures sm_103, and sm_121 is experimental in this release.

Note

When compiling for XYa or XYf compute capability use XY0 in the SM operator (see also CUDA C++ Programming Guide: Feature Availability).

Warning

It is not guaranteed that executions of exactly the same complete function description on GPUs of different CUDA architectures will produce bit-identical floating point random values for certain distributions.