mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 17:23:08 +00:00
nvidia-thrust: simplify parameters
This commit is contained in:
parent
6087a4301c
commit
2e5cb6f4d6
@ -4,32 +4,24 @@
|
|||||||
, stdenv
|
, stdenv
|
||||||
, cmake
|
, cmake
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, cudaSupport ? config.cudaSupport or false
|
|
||||||
, cudaPackages
|
, cudaPackages
|
||||||
, symlinkJoin
|
, symlinkJoin
|
||||||
, enableOpenmp ? true
|
|
||||||
, enableTbb ? false
|
|
||||||
, tbb
|
, tbb
|
||||||
|
# Upstream defaults:
|
||||||
, hostSystem ? "CPP"
|
, hostSystem ? "CPP"
|
||||||
, deviceSystem ? let
|
, deviceSystem ? if config.cudaSupport or false then "CUDA" else "CPP"
|
||||||
devices = lib.optional cudaSupport "CUDA"
|
|
||||||
++ lib.optional enableTbb "TBB"
|
|
||||||
++ lib.optional enableOpenmp "OMP"
|
|
||||||
++ [ "CPP" ];
|
|
||||||
in
|
|
||||||
builtins.head devices
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert builtins.elem deviceSystem [ "CPP" "OMP" "TBB" "CUDA" ];
|
assert builtins.elem deviceSystem [ "CPP" "OMP" "TBB" "CUDA" ];
|
||||||
assert builtins.elem hostSystem [ "CPP" "OMP" "TBB" ];
|
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
|
let
|
||||||
pname = "nvidia-thrust";
|
pname = "nvidia-thrust";
|
||||||
version = "1.16.0";
|
version = "1.16.0";
|
||||||
|
|
||||||
|
tbbSupport = builtins.elem "TBB" [ deviceSystem hostSystem ];
|
||||||
|
cudaSupport = deviceSystem == "CUDA";
|
||||||
|
|
||||||
# TODO: Would like to use this:
|
# TODO: Would like to use this:
|
||||||
cudaJoined = symlinkJoin {
|
cudaJoined = symlinkJoin {
|
||||||
name = "cuda-packages-unsplit";
|
name = "cuda-packages-unsplit";
|
||||||
@ -51,13 +43,13 @@ stdenv.mkDerivation {
|
|||||||
hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ=";
|
hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = lib.optional enableTbb tbb;
|
buildInputs = lib.optionals tbbSupport [ tbb ];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
pkg-config
|
pkg-config
|
||||||
] ++ lib.optionals cudaSupport [
|
] ++ 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...
|
# in a path relative to nvcc...
|
||||||
|
|
||||||
# Works when build=host, but we only support
|
# Works when build=host, but we only support
|
||||||
|
@ -10309,11 +10309,12 @@ with pkgs;
|
|||||||
nvidia-thrust = callPackage ../development/libraries/nvidia-thrust { };
|
nvidia-thrust = callPackage ../development/libraries/nvidia-thrust { };
|
||||||
|
|
||||||
nvidia-thrust-intel = 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 {
|
nvidia-thrust-cuda = callPackage ../development/libraries/nvidia-thrust {
|
||||||
cudaSupport = true;
|
deviceSystem = "CUDA";
|
||||||
};
|
};
|
||||||
|
|
||||||
miller = callPackage ../tools/text/miller { };
|
miller = callPackage ../tools/text/miller { };
|
||||||
|
Loading…
Reference in New Issue
Block a user