Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

98 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rocmUpdateScript,
cmake,
rocm-cmake,
rocm-docs-core,
half,
clr,
openmp,
boost,
python3Packages,
buildDocs ? false, # Needs internet
useOpenCL ? false,
useCPU ? false,
gpuTargets ? [ ],
}:
stdenv.mkDerivation (finalAttrs: {
pname =
"rpp-"
+ (
if (!useOpenCL && !useCPU) then
"hip"
else if (!useOpenCL && !useCPU) then
"opencl"
else
"cpu"
);
version = "6.4.3";
src = fetchFromGitHub {
owner = "ROCm";
repo = "rpp";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-rccVjSrOVIe4ZDtloCoCCI3u9UIcUqdirHIzS7ffAas=";
};
nativeBuildInputs = [
cmake
rocm-cmake
clr
]
++ lib.optionals buildDocs [
rocm-docs-core
python3Packages.python
];
buildInputs = [
half
openmp
boost
];
cmakeFlags = [
"-DROCM_PATH=${clr}"
]
++ lib.optionals (gpuTargets != [ ]) [
"-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
]
++ lib.optionals (!useOpenCL && !useCPU) [
"-DBACKEND=HIP"
]
++ lib.optionals (useOpenCL && !useCPU) [
"-DBACKEND=OCL"
]
++ lib.optionals useCPU [
"-DBACKEND=CPU"
];
postPatch = lib.optionalString (!useOpenCL && !useCPU) ''
# Bad path
substituteInPlace CMakeLists.txt \
--replace "COMPILER_FOR_HIP \''${ROCM_PATH}/llvm/bin/clang++" "COMPILER_FOR_HIP ${clr}/bin/hipcc"
'';
postBuild = lib.optionalString buildDocs ''
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en ../docs _build/html
'';
passthru.updateScript = rocmUpdateScript {
name = finalAttrs.pname;
inherit (finalAttrs.src) owner;
inherit (finalAttrs.src) repo;
};
meta = with lib; {
description = "Comprehensive high-performance computer vision library for AMD processors";
homepage = "https://github.com/ROCm/rpp";
license = with licenses; [ mit ];
teams = [ teams.rocm ];
platforms = platforms.linux;
broken = useOpenCL;
};
})