umpire: Add cuda support

This commit is contained in:
Jonas 2024-08-30 13:37:35 +02:00
parent c2f9a2c471
commit 585af9ec70

View File

@ -2,8 +2,13 @@
, lib
, fetchFromGitHub
, cmake
, config
, cudaSupport ? config.cudaSupport
, cudaPackages ? null
}:
assert cudaSupport -> cudaPackages != null;
stdenv.mkDerivation rec {
pname = "umpire";
version = "2024.07.0";
@ -16,7 +21,22 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [
cmake
] ++ lib.optionals cudaSupport [
cudaPackages.cuda_nvcc
];
buildInputs = lib.optionals cudaSupport (with cudaPackages; [
cudatoolkit
cuda_cudart
]);
cmakeFlags = lib.optionals cudaSupport [
"-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}"
"-DENABLE_CUDA=ON"
(lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString)
];
meta = with lib; {
description = "Application-focused API for memory management on NUMA & GPU architectures";