From 95d21285bd596cd2adc11f516d6a989599863440 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 12 Apr 2022 16:57:03 +0300 Subject: [PATCH] nvidia-thrust: init at 1.16.0 --- .../libraries/nvidia-thrust/default.nix | 61 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/development/libraries/nvidia-thrust/default.nix diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix new file mode 100644 index 000000000000..ea83b083d1b4 --- /dev/null +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -0,0 +1,61 @@ +{ lib +, fetchFromGitHub +, stdenv +, cmake +, cudaPackages +, symlinkJoin +}: +let + pname = "nvidia-thrust"; + version = "1.16.0"; + + # TODO: Would like to use this: + cudaJoined = symlinkJoin { + name = "cuda-packages-unsplit"; + paths = with cudaPackages; [ + cuda_nvcc + cuda_cudart # cuda_runtime.h + libcublas + ]; + }; +in +stdenv.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "NVIDIA"; + repo = "thrust"; + rev = version; + fetchSubmodules = true; + hash = "sha256-/EyznxWKuHuvHNjq+SQg27IaRbtkjXR2zlo2YgCWmUQ="; + }; + + nativeBuildInputs = [ + cmake + + # goes in native build inputs because thrust looks for headers + # in a path relative to nvcc... + # + # Works when build=host, but we only support + # cuda on x86_64 anyway + + # TODO: but instead using this + # cudaJoined + cudaPackages.cudatoolkit + ]; + + cmakeFlags = [ + "-DTHRUST_INCLUDE_CUB_CMAKE=ON" + ]; + + meta = with lib; { + description = '' + A high-level C++ parallel algorithms library + that builds on top of CUDA, TBB, OpenMP, etc. + ''; + homepage = "https://github.com/NVIDIA/thrust"; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = with maintainers; [ SomeoneSerge ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fca8efb5b8fc..2e16e72f19c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10306,6 +10306,8 @@ with pkgs; nvfetcher = haskell.lib.compose.justStaticExecutables haskellPackages.nvfetcher; + nvidia-thrust = callPackage ../development/libraries/nvidia-thrust { }; + miller = callPackage ../tools/text/miller { }; milu = callPackage ../applications/misc/milu { };