lol

miopengemm: init at 5.3.1

Madoura 6cdf1908 6aa9de9f

+133
+129
pkgs/development/libraries/miopengemm/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , cmake 5 + , rocm-cmake 6 + , rocm-opencl-runtime 7 + , clang 8 + , texlive ? null 9 + , doxygen ? null 10 + , sphinx ? null 11 + , python3Packages ? null 12 + , openblas ? null 13 + , buildDocs ? false 14 + , buildTests ? false 15 + , buildBenchmarks ? false 16 + }: 17 + 18 + assert buildDocs -> texlive != null; 19 + assert buildDocs -> doxygen != null; 20 + assert buildDocs -> sphinx != null; 21 + assert buildDocs -> python3Packages != null; 22 + assert buildTests -> openblas != null; 23 + 24 + let 25 + latex = lib.optionalAttrs buildDocs (texlive.combine { 26 + inherit (texlive) scheme-small 27 + latexmk 28 + tex-gyre 29 + fncychap 30 + wrapfig 31 + capt-of 32 + framed 33 + needspace 34 + tabulary 35 + varwidth 36 + titlesec; 37 + }); 38 + in stdenv.mkDerivation rec { 39 + pname = "miopengemm"; 40 + rocmVersion = "5.3.1"; 41 + version = rocmVersion; 42 + 43 + outputs = [ 44 + "out" 45 + ] ++ lib.optionals buildDocs [ 46 + "docs" 47 + ] ++ lib.optionals buildTests [ 48 + "test" 49 + ] ++ lib.optionals buildBenchmarks [ 50 + "benchmark" 51 + ]; 52 + 53 + src = fetchFromGitHub { 54 + owner = "ROCmSoftwarePlatform"; 55 + repo = "MIOpenGEMM"; 56 + rev = "rocm-${rocmVersion}"; 57 + hash = "sha256-AiRzOMYRA/0nbQomyq4oOEwNZdkPYWRA2W6QFlctvFc="; 58 + }; 59 + 60 + nativeBuildInputs = [ 61 + cmake 62 + rocm-cmake 63 + clang 64 + ]; 65 + 66 + buildInputs = [ 67 + rocm-opencl-runtime 68 + ] ++ lib.optionals buildDocs [ 69 + latex 70 + doxygen 71 + sphinx 72 + python3Packages.sphinx_rtd_theme 73 + python3Packages.breathe 74 + ] ++ lib.optionals buildTests [ 75 + openblas 76 + ]; 77 + 78 + cmakeFlags = [ 79 + "-DCMAKE_C_COMPILER=clang" 80 + "-DCMAKE_CXX_COMPILER=clang++" 81 + # Manually define CMAKE_INSTALL_<DIR> 82 + # See: https://github.com/NixOS/nixpkgs/pull/197838 83 + "-DCMAKE_INSTALL_BINDIR=bin" 84 + "-DCMAKE_INSTALL_LIBDIR=lib" 85 + "-DCMAKE_INSTALL_INCLUDEDIR=include" 86 + ] ++ lib.optionals buildTests [ 87 + "-DOPENBLAS=ON" 88 + ] ++ lib.optionals buildBenchmarks [ 89 + "-DAPI_BENCH_MIOGEMM=ON" 90 + # Needs https://github.com/CNugteren/CLBlast 91 + # "-DAPI_BENCH_CLBLAST=ON" 92 + # Needs https://github.com/openai/triton 93 + # "-DAPI_BENCH_ISAAC=ON" 94 + ]; 95 + 96 + # Unfortunately, it seems like we have to call make on these manually 97 + postBuild = lib.optionalString buildDocs '' 98 + export HOME=$(mktemp -d) 99 + make doc 100 + '' + lib.optionalString buildTests '' 101 + make check 102 + '' + lib.optionalString buildBenchmarks '' 103 + make examples 104 + ''; 105 + 106 + postInstall = lib.optionalString buildTests '' 107 + mkdir -p $test/bin 108 + find tests -executable -type f -exec mv {} $test/bin \; 109 + patchelf --set-rpath ${lib.makeLibraryPath buildInputs}:$out/lib $test/bin/* 110 + '' + lib.optionalString buildBenchmarks '' 111 + mkdir -p $benchmark/bin 112 + find examples -executable -type f -exec mv {} $benchmark/bin \; 113 + patchelf --set-rpath ${lib.makeLibraryPath buildInputs}:$out/lib $benchmark/bin/* 114 + ''; 115 + 116 + postFixup = lib.optionalString buildDocs '' 117 + mkdir -p $docs/share/doc/miopengemm 118 + mv ../doc/html $docs/share/doc/miopengemm 119 + mv ../doc/pdf/miopengemm.pdf $docs/share/doc/miopengemm 120 + ''; 121 + 122 + meta = with lib; { 123 + description = "OpenCL general matrix multiplication API for ROCm"; 124 + homepage = "https://github.com/ROCmSoftwarePlatform/MIOpenGEMM"; 125 + license = with licenses; [ mit ]; 126 + maintainers = with maintainers; [ Madouura ]; 127 + broken = rocmVersion != clang.version; 128 + }; 129 + }
+4
pkgs/top-level/all-packages.nix
··· 14895 14895 inherit (llvmPackages_rocm) llvm; 14896 14896 }; 14897 14897 14898 + miopengemm = callPackage ../development/libraries/miopengemm { 14899 + inherit (llvmPackages_rocm) clang; 14900 + }; 14901 + 14898 14902 rtags = callPackage ../development/tools/rtags { 14899 14903 inherit (darwin) apple_sdk; 14900 14904 };