{ lib, stdenv, fetchFromGitHub, rocmUpdateScript, cmake, rocm-cmake, clr, gtest, gbenchmark, buildTests ? false, buildBenchmarks ? false, gpuTargets ? clr.localGpuTargets or [ ], }: stdenv.mkDerivation (finalAttrs: { pname = "rocrand${clr.gpuArchSuffix}"; version = "7.1.1"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocRAND"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-QhHxpjr3SqeSSMS4QmnDq8zIxEeUtrgwb9JG84jfJgY="; }; nativeBuildInputs = [ cmake rocm-cmake clr ]; buildInputs = lib.optionals buildTests [ gtest ] ++ lib.optionals buildBenchmarks [ gbenchmark ]; cmakeFlags = [ "-DHIP_ROOT_DIR=${clr}" # Manually define CMAKE_INSTALL_