{ 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 ? [ ], }: stdenv.mkDerivation (finalAttrs: { pname = "rocwmma"; version = "6.3.3"; 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-kih3hn6QhcMmyj9n8f8eO+RIgKQgWKIuzg8fb0eoRPE="; }; 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 = [ "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" "-DOpenMP_omp_LIBRARY=${openmp}/lib" "-DROCWMMA_BUILD_TESTS=${if buildTests || buildBenchmarks then "ON" else "OFF"}" "-DROCWMMA_BUILD_SAMPLES=${if buildSamples then "ON" else "OFF"}" # Manually define CMAKE_INSTALL_