12 , buildBenchmarks ? false
16 stdenv.mkDerivation (finalAttrs: {
22 ] ++ lib.optionals buildTests [
24 ] ++ lib.optionals buildBenchmarks [
28 src = fetchFromGitHub {
31 rev = "rocm-${finalAttrs.version}";
32 hash = "sha256-nWvq26qRPZ6Au1rc5cR74TKArcdUFg7O9djFi8SvMeM=";
37 name = "arch-conversion-marco.patch";
38 url = "https://salsa.debian.org/rocm-team/rocprim/-/raw/70c8aaee3cf545d92685f4ed9bf8f41e3d4d570c/debian/patches/arch-conversion-macro.patch";
39 hash = "sha256-oXdmbCArOB5bKE8ozDFrSh4opbO+c4VI6PNhljeUSms=";
49 buildInputs = lib.optionals buildTests [
51 ] ++ lib.optionals buildBenchmarks [
56 "-DCMAKE_CXX_COMPILER=hipcc"
57 # Manually define CMAKE_INSTALL_<DIR>
58 # See: https://github.com/NixOS/nixpkgs/pull/197838
59 "-DCMAKE_INSTALL_BINDIR=bin"
60 "-DCMAKE_INSTALL_LIBDIR=lib"
61 "-DCMAKE_INSTALL_INCLUDEDIR=include"
62 ] ++ lib.optionals (gpuTargets != [ ]) [
63 "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
64 ] ++ lib.optionals buildTests [
66 ] ++ lib.optionals buildBenchmarks [
67 "-DBUILD_BENCHMARK=ON"
70 postInstall = lib.optionalString buildTests ''
72 mv $out/bin/test_* $test/bin
73 mv $out/bin/rocprim $test/bin
74 '' + lib.optionalString buildBenchmarks ''
75 mkdir -p $benchmark/bin
76 mv $out/bin/benchmark_* $benchmark/bin
77 '' + lib.optionalString (buildTests || buildBenchmarks) ''
81 passthru.updateScript = rocmUpdateScript {
82 name = finalAttrs.pname;
83 owner = finalAttrs.src.owner;
84 repo = finalAttrs.src.repo;
88 description = "ROCm parallel primitives";
89 homepage = "https://github.com/ROCm/rocPRIM";
90 license = with licenses; [ mit ];
91 maintainers = teams.rocm.members;
92 platforms = platforms.linux;
93 broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version || versionAtLeast finalAttrs.version "7.0.0";