{ lib , stdenv , fetchFromGitHub , cmake , rocm-cmake , rocm-runtime , rocm-device-libs , rocm-comgr , hip , gtest ? null , gbenchmark ? null , buildTests ? false , buildBenchmarks ? false }: assert buildTests -> gtest != null; assert buildBenchmarks -> gbenchmark != null; stdenv.mkDerivation rec { pname = "rocprim"; rocmVersion = "5.3.1"; version = "2.11.0-${rocmVersion}"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "rocPRIM"; rev = "rocm-${rocmVersion}"; hash = "sha256-aapvj9bwwlg7VJfnH1PVR8DulMcJh1xR6B4rPPGU6Q4="; }; nativeBuildInputs = [ cmake rocm-cmake hip ]; buildInputs = [ rocm-runtime rocm-device-libs rocm-comgr ] ++ lib.optionals buildTests [ gtest ] ++ lib.optionals buildBenchmarks [ gbenchmark ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" # Manually define CMAKE_INSTALL_