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 |
|---|---|---|
curanddx::philox4_32 |
The type of generator requested, choice of ( |
|
10 |
Round count of iterated bijections for the Philox4_32 generator. The operator is ignored if the generator is other than Philox. |
|
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:
A single instance of Generator Operator.
A single instance of SM Operator.
Generator Operator#
curanddx::Generator<gen>();
The type of random number generator requested. Supported gen values are:
xorwow: XORWOR pseudorandom generator, same asCURAND_RNG_PSEUDO_XORWOWgenerator type in cuRAND.mrg32k3a: MRG32K3A pseudorandom generator, same asCURAND_RNG_PSEUDO_MRG32K3Agenerator 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 asCURAND_RNG_PSEUDO_PHILOX4_32_10generator type in cuRAND.pcg: PCG pseudorandom generator.sobol32: SOBOL32 quasirandom generator, same asCURAND_RNG_QUASI_SOBOL32generator type in cuRAND.scrambled_sobol32: Scrambled SOBOL32 quasirandom generator, same asCURAND_RNG_QUASI_SCRAMBLED_SOBOL32generator type in cuRAND.sobol64: SOBOL32 quasirandom generator, same asCURAND_RNG_QUASI_SOBOL64generator type in cuRAND.scrambled_sobol32: Scrambled SOBOL64 quasirandom generator, same asCURAND_RNG_QUASI_SCRAMBLED_SOBOL64generator 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:
Turing:
750(sm_75).Ampere:
800,860and870(sm_80, sm_86, sm_87).Ada:
890(sm_89).Hopper:
900(sm_90, sm_90a).Blackwell:
1000,1030,1100,1200,1210(sm_100, sm_103, sm_110, sm_120, sm_121).
Warning
Support for architectures sm_103, and sm_121 is experimental in cuRANDDx 0.2.3.
Note
Starting with cuRANDDx 0.2.3 support for CTK 12 and architectures below Turing (SM75) is removed.
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.