From 871bef56c4b82f23599b1971e53f15081b4d7d80 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Tue, 1 Oct 2024 11:36:42 +0200 Subject: [PATCH] peakperf: Initial CUDA support --- pkgs/peakperf/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/peakperf/default.nix b/pkgs/peakperf/default.nix index 6a48284..ed837ea 100644 --- a/pkgs/peakperf/default.nix +++ b/pkgs/peakperf/default.nix @@ -1,11 +1,16 @@ { + config, lib, stdenv, fetchFromGitHub, cmake, + enableCuda ? config.cudaSupport, + cudaPackages ? { }, }: - -stdenv.mkDerivation (finalAttrs: { +let + effectiveStdenv = if enableCuda then cudaPackages.backendStdenv else stdenv; +in +effectiveStdenv.mkDerivation (finalAttrs: { pname = "peakperf"; version = "1.17"; @@ -16,6 +21,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-bP38oo0tHDvzbWHiNwbkQoM7ZQ4nwTimVYfbPh0FUd4="; }; + buildInputs = + [ ] + ++ lib.optionals enableCuda [ + cudaPackages.cudart + ]; + nativeBuildInputs = [ cmake ];