depot/third_party/nixpkgs/pkgs/development/cuda-modules/saxpy/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

68 lines
1.5 KiB
Nix

{
autoAddDriverRunpath,
cmake,
cudaPackages,
lib,
}:
let
inherit (cudaPackages)
backendStdenv
cuda_cccl
cuda_cudart
cuda_nvcc
cudaAtLeast
cudaOlder
cudatoolkit
flags
libcublas
setupCudaHook
;
inherit (lib) getDev getLib getOutput;
fs = lib.fileset;
in
backendStdenv.mkDerivation {
pname = "saxpy";
version = "unstable-2023-07-11";
src = fs.toSource {
root = ./.;
fileset = fs.unions [
./CMakeLists.txt
./saxpy.cu
];
};
__structuredAttrs = true;
strictDeps = true;
nativeBuildInputs =
[
cmake
autoAddDriverRunpath
]
++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ]
++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ];
buildInputs =
lib.optionals (cudaOlder "11.4") [ cudatoolkit ]
++ lib.optionals (cudaAtLeast "11.4") [
(getDev libcublas)
(getLib libcublas)
(getOutput "static" libcublas)
cuda_cudart
]
++ lib.optionals (cudaAtLeast "12.0") [ cuda_cccl ];
cmakeFlagsArray = [
(lib.cmakeBool "CMAKE_VERBOSE_MAKEFILE" true)
(lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" flags.cmakeCudaArchitecturesString)
];
meta = rec {
description = "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;
badPlatforms = lib.optionals (flags.isJetsonBuild && cudaOlder "11.4") platforms;
};
}