diff options
Diffstat (limited to 'pkgs/development/cuda-modules/saxpy/default.nix')
-rw-r--r-- | pkgs/development/cuda-modules/saxpy/default.nix | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/cuda-modules/saxpy/default.nix b/pkgs/development/cuda-modules/saxpy/default.nix new file mode 100644 index 0000000000000..fff52801e3cca --- /dev/null +++ b/pkgs/development/cuda-modules/saxpy/default.nix @@ -0,0 +1,56 @@ +{ + cmake, + cudaPackages, + lib, +}: +let + inherit (cudaPackages) + autoAddOpenGLRunpathHook + backendStdenv + cuda_cccl + cuda_cudart + cuda_nvcc + cudatoolkit + cudaVersion + flags + libcublas + ; +in +backendStdenv.mkDerivation { + pname = "saxpy"; + version = "unstable-2023-07-11"; + + src = ./.; + + strictDeps = true; + + nativeBuildInputs = + [ + cmake + autoAddOpenGLRunpathHook + ] + ++ lib.optionals (lib.versionOlder cudaVersion "11.4") [cudatoolkit] + ++ lib.optionals (lib.versionAtLeast cudaVersion "11.4") [cuda_nvcc]; + + buildInputs = + lib.optionals (lib.versionOlder cudaVersion "11.4") [cudatoolkit] + ++ lib.optionals (lib.versionAtLeast cudaVersion "11.4") [ + libcublas + cuda_cudart + ] + ++ lib.optionals (lib.versionAtLeast cudaVersion "12.0") [cuda_cccl]; + + cmakeFlags = [ + (lib.cmakeBool "CMAKE_VERBOSE_MAKEFILE" true) + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" ( + with flags; lib.concatStringsSep ";" (lib.lists.map dropDot cudaCapabilities) + )) + ]; + + meta = { + description = "A simple (Single-precision AX Plus Y) FindCUDAToolkit.cmake example for testing cross-compilation"; + license = lib.licenses.mit; + maintainers = lib.teams.cuda.members; + platforms = lib.platforms.unix; + }; +} |