depot/third_party/nixpkgs/pkgs/development/cuda-modules/saxpy/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

57 lines
1.3 KiB
Nix

{
cmake,
cudaPackages,
lib,
}:
let
inherit (cudaPackages)
autoAddOpenGLRunpathHook
backendStdenv
cuda_cccl
cuda_cudart
cuda_nvcc
cudatoolkit
cudaVersion
flags
libcublas
setupCudaHook
;
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;
};
}