{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , clr , rocrand , gtest , buildTests ? false , gpuTargets ? [ ] }: stdenv.mkDerivation (finalAttrs: { pname = "hiprand"; version = "6.0.2"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "hipRAND"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-uGHzOhUX5JEknVFwhHhWFdPmwLS/TuaXYMeItS7tXIg="; }; nativeBuildInputs = [ cmake rocm-cmake clr ]; buildInputs = [ rocrand ] ++ (lib.optionals buildTests [ gtest ]); cmakeFlags = [ "-DCMAKE_C_COMPILER=hipcc" "-DCMAKE_CXX_COMPILER=hipcc" "-DHIP_ROOT_DIR=${clr}" # Manually define CMAKE_INSTALL_