{ lib , stdenv , fetchFromGitHub , fetchurl , rocmUpdateScript , pkg-config , cmake , rocm-cmake , rocm-runtime , rocm-device-libs , rocm-comgr , rocm-opencl-runtime , rocblas , rocmlir , hip , clang , clang-ocl , llvm , miopengemm , composable_kernel , half , boost , sqlite , bzip2 , nlohmann_json , texlive , doxygen , sphinx , zlib , python3Packages , buildDocs ? true , buildTests ? false # LFS isn't working, so we will manually fetch these # This isn't strictly required, but is recommended to enable # https://github.com/ROCmSoftwarePlatform/MIOpen/issues/1373 # # MIOpen will produce a very large output due to KDBs fetched # Also possibly in the future because of KDB generation # This is disabled by default so we can cache on hydra , fetchKDBs ? false , useOpenCL ? false }: let latex = lib.optionalAttrs buildDocs texlive.combine { inherit (texlive) scheme-small latexmk tex-gyre fncychap wrapfig capt-of framed needspace tabulary varwidth titlesec; }; kdbs = lib.optionalAttrs fetchKDBs import ./deps.nix { inherit fetchurl; mirror = "https://repo.radeon.com/rocm/miopen-kernel/rel-5.0"; }; in stdenv.mkDerivation (finalAttrs: { pname = "miopen"; version = "5.4.0"; outputs = [ "out" ] ++ lib.optionals buildDocs [ "doc" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "MIOpen"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-EOe3LUafOeVLzRoahPdS6DMZ/+6WWeVI7jG25zfPrx8="; }; nativeBuildInputs = [ pkg-config cmake rocm-cmake hip clang llvm ]; buildInputs = [ rocm-runtime rocm-device-libs rocm-comgr rocm-opencl-runtime rocblas rocmlir clang-ocl miopengemm composable_kernel half boost sqlite bzip2 nlohmann_json ] ++ lib.optionals buildDocs [ latex doxygen sphinx python3Packages.sphinx-rtd-theme python3Packages.breathe python3Packages.myst-parser ] ++ lib.optionals buildTests [ zlib ]; cmakeFlags = [ "-DMIOPEN_USE_MIOPENGEMM=ON" # Manually define CMAKE_INSTALL_