NVIDIA cuRANDDx Documentation#

The cuRAND Device Extensions (cuRANDDx) library enables random number generations (RNG) to be conducted inside CUDA kernels, aiming to replace cuRAND RNG device APIs which are out-dated and no longer being updated.

cuRANDDx is a part of MathDx package which also includes cuFFTDx for FFT calculations, cuBLASDx for Genernal Matrix Multiplications (GEMM), and cuSolverDx for dense linear algebra operations. Check MathDx project page for the list of supported device extension libraries included in the latest release.

Fusing RNG computations with other operations can decrease latency and improve overall performance of your application. cuRANDDx aims for performance portability between GPU generations by providing simple, compossible APIs, and being out-of-the-box compatible with other MathDx libraries.

The cuRANDDx library provides:

  • Most of the random number generators available in cuRAND, including:
    • three pseudorandom generators: XORWOW, MRG32k3a, and Philox4_32,

    • 32- and 64-bit SOBOL and Scrambled SOBOL quasirandom generators.

  • More flexible Philox4_32 generator with use-defined round count value for better performance.

  • A new pseudorandom generator, Permuted Congruential Generator (PCG), which is fast, statistically sound, and less predictable than most generators.

  • Four distributions, including uniform, normal, log normal, and Poisson distribution.

  • High performance, no unnecessary data movement from and to global memory.

  • Customizability, options to adjust RNG routine for different needs (generator type, distribution type, data type, targeted CUDA architecture, etc.).

  • Ability to fuse cuRANDDx kernels with other operations in order to save global memory trips.

  • Compatibility with future versions of the CUDA Toolkit.