1 { lib, backendStdenv, fetchFromGitHub
2 , cmake, addOpenGLRunpath
8 rev = "5aab680905d853bce0dbad4c488e4f7e9f7b2302";
9 src = fetchFromGitHub {
11 repo = "CUDALibrarySamples";
13 sha256 = "0gwgbkq05ygrfgg5hk07lmap7n7ampxv0ha1axrv8qb748ph81xs";
16 version = lib.strings.substring 0 7 rev + "-" + lib.versions.majorMinor cudatoolkit.version;
17 nativeBuildInputs = [ cmake addOpenGLRunpath ];
18 buildInputs = [ cudatoolkit ];
20 for exe in $out/bin/*; do
25 description = "examples of using libraries using CUDA";
27 CUDA Library Samples contains examples demonstrating the use of
28 features in the math and image processing libraries cuBLAS, cuTENSOR,
29 cuSPARSE, cuSOLVER, cuFFT, cuRAND, NPP and nvJPEG.
31 license = lib.licenses.bsd3;
32 maintainers = with lib.maintainers; [ obsidian-systems-maintenance ];
38 cublas = backendStdenv.mkDerivation (commonAttrs // {
39 pname = "cuda-library-samples-cublas";
41 src = "${src}/cuBLASLt";
44 cusolver = backendStdenv.mkDerivation (commonAttrs // {
45 pname = "cuda-library-samples-cusolver";
47 src = "${src}/cuSOLVER";
49 sourceRoot = "cuSOLVER/gesv";
52 cutensor = backendStdenv.mkDerivation (commonAttrs // {
53 pname = "cuda-library-samples-cutensor";
55 src = "${src}/cuTENSOR";
57 buildInputs = [ cutensor ];
60 "-DCUTENSOR_EXAMPLE_BINARY_INSTALL_DIR=${builtins.placeholder "out"}/bin"
63 # CUTENSOR_ROOT is double escaped
65 substituteInPlace CMakeLists.txt \
66 --replace "\''${CUTENSOR_ROOT}/include" "${cutensor.dev}/include"
69 CUTENSOR_ROOT = cutensor;