12 buildBenchmarks ? false,
16 stdenv.mkDerivation (finalAttrs: {
24 ++ lib.optionals buildTests [
27 ++ lib.optionals buildBenchmarks [
31 src = fetchFromGitHub {
34 rev = "rocm-${finalAttrs.version}";
35 hash = "sha256-+ukFWsWv3RhS+Z6tmR4TRT8QTYEDuAEk12F9Gv1eXGU=";
45 lib.optionals buildTests [
48 ++ lib.optionals buildBenchmarks [
54 "-DCMAKE_CXX_COMPILER=hipcc"
55 # Manually define CMAKE_INSTALL_<DIR>
56 # See: https://github.com/NixOS/nixpkgs/pull/197838
57 "-DCMAKE_INSTALL_BINDIR=bin"
58 "-DCMAKE_INSTALL_LIBDIR=lib"
59 "-DCMAKE_INSTALL_INCLUDEDIR=include"
61 ++ lib.optionals (gpuTargets != [ ]) [
62 "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
64 ++ lib.optionals buildTests [
67 ++ lib.optionals buildBenchmarks [
68 "-DBUILD_BENCHMARK=ON"
72 lib.optionalString buildTests ''
74 mv $out/bin/test_* $test/bin
75 mv $out/bin/rocprim $test/bin
77 + lib.optionalString buildBenchmarks ''
78 mkdir -p $benchmark/bin
79 mv $out/bin/benchmark_* $benchmark/bin
81 + lib.optionalString (buildTests || buildBenchmarks) ''
85 passthru.updateScript = rocmUpdateScript {
86 name = finalAttrs.pname;
87 owner = finalAttrs.src.owner;
88 repo = finalAttrs.src.repo;
92 description = "ROCm parallel primitives";
93 homepage = "https://github.com/ROCm/rocPRIM";
94 license = with licenses; [ mit ];
95 maintainers = teams.rocm.members;
96 platforms = platforms.linux;
98 versions.minor finalAttrs.version != versions.minor stdenv.cc.version
99 || versionAtLeast finalAttrs.version "6.0.0";