{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , rocm-smi , clr , openmp , gtest , rocblas , buildTests ? false # Will likely fail building because wavefront shifts are not supported for certain archs , buildExtendedTests ? false , buildBenchmarks ? false , buildSamples ? false , gpuTargets ? [ ] # gpuTargets = [ "gfx908:xnack-" "gfx90a:xnack-" "gfx90a:xnack+" ... ] }: stdenv.mkDerivation (finalAttrs: { pname = "rocwmma"; version = "5.7.1"; outputs = [ "out" ] ++ lib.optionals (buildTests || buildBenchmarks) [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ] ++ lib.optionals buildSamples [ "sample" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocWMMA"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-0otJxgVYLwvVYIWT/hjrrpuSj5jslP1dbJRt6GUOrDs="; }; patches = lib.optionals (buildTests || buildBenchmarks) [ ./0000-dont-fetch-googletest.patch ]; nativeBuildInputs = [ cmake rocm-cmake clr ]; buildInputs = [ openmp ] ++ lib.optionals (buildTests || buildBenchmarks) [ rocm-smi gtest rocblas ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" "-DROCWMMA_BUILD_TESTS=${if buildTests || buildBenchmarks then "ON" else "OFF"}" "-DROCWMMA_BUILD_SAMPLES=${if buildSamples then "ON" else "OFF"}" # Manually define CMAKE_INSTALL_