{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , rocm-opencl-runtime , clang , texlive , doxygen , sphinx , openblas , python3Packages , buildDocs ? true , buildTests ? false , buildBenchmarks ? false }: let latex = lib.optionalAttrs buildDocs texlive.combine { inherit (texlive) scheme-small latexmk tex-gyre fncychap wrapfig capt-of framed needspace tabulary varwidth titlesec; }; in stdenv.mkDerivation (finalAttrs: { pname = "miopengemm"; version = "5.4.0"; outputs = [ "out" ] ++ lib.optionals buildDocs [ "doc" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "MIOpenGEMM"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-AiRzOMYRA/0nbQomyq4oOEwNZdkPYWRA2W6QFlctvFc="; }; nativeBuildInputs = [ cmake rocm-cmake clang ]; buildInputs = [ rocm-opencl-runtime ] ++ lib.optionals buildDocs [ latex doxygen sphinx python3Packages.sphinx-rtd-theme python3Packages.breathe ] ++ lib.optionals buildTests [ openblas ]; cmakeFlags = [ "-DCMAKE_C_COMPILER=clang" "-DCMAKE_CXX_COMPILER=clang++" # Manually define CMAKE_INSTALL_