{ lib , stdenv , fetchFromGitHub , cmake , rocm-cmake , rocm-opencl-runtime , clang , texlive ? null , doxygen ? null , sphinx ? null , python3Packages ? null , openblas ? null , buildDocs ? false , buildTests ? false , buildBenchmarks ? false }: assert buildDocs -> texlive != null; assert buildDocs -> doxygen != null; assert buildDocs -> sphinx != null; assert buildDocs -> python3Packages != null; assert buildTests -> openblas != null; 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 rec { pname = "miopengemm"; rocmVersion = "5.3.1"; version = rocmVersion; outputs = [ "out" ] ++ lib.optionals buildDocs [ "docs" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "MIOpenGEMM"; rev = "rocm-${rocmVersion}"; 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_