diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix index 13f562f24d23..f8b7518cd081 100644 --- a/pkgs/development/libraries/nvidia-thrust/default.nix +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -4,32 +4,24 @@ , stdenv , cmake , pkg-config -, cudaSupport ? config.cudaSupport or false , cudaPackages , symlinkJoin -, enableOpenmp ? true -, enableTbb ? false , tbb + # Upstream defaults: , hostSystem ? "CPP" -, deviceSystem ? let - devices = lib.optional cudaSupport "CUDA" - ++ lib.optional enableTbb "TBB" - ++ lib.optional enableOpenmp "OMP" - ++ [ "CPP" ]; - in - builtins.head devices +, deviceSystem ? if config.cudaSupport or false then "CUDA" else "CPP" }: assert builtins.elem deviceSystem [ "CPP" "OMP" "TBB" "CUDA" ]; assert builtins.elem hostSystem [ "CPP" "OMP" "TBB" ]; -assert (deviceSystem == "CUDA") -> cudaSupport; -assert (builtins.elem "TBB" [ deviceSystem hostSystem ]) -> enableTbb; -assert (builtins.elem "OMP" [ deviceSystem hostSystem ]) -> enableOpenmp; let pname = "nvidia-thrust"; version = "1.16.0"; + tbbSupport = builtins.elem "TBB" [ deviceSystem hostSystem ]; + cudaSupport = deviceSystem == "CUDA"; + # TODO: Would like to use this: cudaJoined = symlinkJoin { name = "cuda-packages-unsplit"; @@ -51,13 +43,13 @@ stdenv.mkDerivation { hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ="; }; - buildInputs = lib.optional enableTbb tbb; + buildInputs = lib.optionals tbbSupport [ tbb ]; nativeBuildInputs = [ cmake pkg-config ] ++ lib.optionals cudaSupport [ - # goes in native build inputs because thrust looks for headers + # Goes in native build inputs because thrust looks for headers # in a path relative to nvcc... # Works when build=host, but we only support diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6db3ce73e06e..18bade5fc0ff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10309,11 +10309,12 @@ with pkgs; nvidia-thrust = callPackage ../development/libraries/nvidia-thrust { }; nvidia-thrust-intel = callPackage ../development/libraries/nvidia-thrust { - enableTbb = true; + hostSystem = "TBB"; + deviceSystem = if config.cudaSupport or false then "CUDA" else "TBB"; }; nvidia-thrust-cuda = callPackage ../development/libraries/nvidia-thrust { - cudaSupport = true; + deviceSystem = "CUDA"; }; miller = callPackage ../tools/text/miller { };