Installation Guide#
cuRANDDx is distributed as a part of the MathDx package. Go to https://developer.nvidia.com/curanddx-downloads to download the latest release of the MathDx package with cuRANDDx.
Note
MathDx package contains:
cuBLASDx for selected linear algebra functions like General Matrix Multiplication (GEMM),
cuFFTDx for FFT calculations,
cuSolverDx for selected dense matrix factorization and solve routines,
cuRANDDx for random number generation.
MathDx libraries are designed to work together in a single project.
Note that for a project where multiple device extensions libraries are used all the libraries must come from the same MathDx release. Examples of such fusion are included in the package.
cuRANDDx In Your Project#
To use cuRANDDx library, users only need to include the directories with curanddx.hpp and its dependency commonDx
shipped with the MathDx package, into their compilation commands. Detailed requirements are listed
in the Requirements section.
The easiest way is to use the MathDx include directories:
nvcc -std=c++17 -arch sm_XY (...) -I<mathdx_include_dir> <your_source_file>.cu -o <your_binary>
When you unpack MathDx YY.MM package tarball into <your_directory>, curanddx.hpp file will be available at the following
location:
<your_directory>/nvidia/mathdx/yy.mm/include/
The commonDx headers will be available at the following location:
<your_directory>/nvidia/mathdx/yy.mm/include/
cuRANDDx In Your CMake Project#
The MathDx package provides configuration files that simplify using cuRANDDx in other CMake projects. After
finding mathdx using find_package, users have to link mathdx::curanddx to their target.
This propagates the include directory curanddx_INCLUDE_DIRS, commonDx, and the C++17 requirement to their target.
find_package(mathdx REQUIRED COMPONENTS curanddx CONFIG)
target_link_libraries(YourProgram mathdx::curanddx)
You can pass the path to MathDx package using PATHS option:
find_package(mathdx REQUIRED COMPONENTS curanddx CONFIG PATHS "<your_directory>/nvidia/mathdx/yy.mm/")
Alternatively, you can set mathdx_ROOT during cmake configuration of your project:
cmake -Dmathdx_ROOT="<your_directory>/nvidia/mathdx/yy.mm/" (...)
Defined Variables#
mathdx_curanddx_FOUND,curanddx_FOUNDTrue if cuRANDDx was found.
curanddx_INCLUDE_DIRScuRANDDx include directories.
mathdx_INCLUDE_DIRSMathDx include directories.
mathdx_VERSIONMathDx package version number in
major.minor.patchformat.curanddx_VERSIONcuRANDDx version number in
major.minor.patchformat.MathDx/cuRANDDx version matrix
MathDx
cuRANDDx
25.01
0.1.0
25.01.1
0.1.1