Date: Sunday, January 8, 2023 @ 14:11:42 Author: tpkessler Revision: 1382008
Migrate miopen-hip from AUR to community Added: miopen-hip/ miopen-hip/repos/ miopen-hip/trunk/ miopen-hip/trunk/PKGBUILD miopen-hip/trunk/test.cpp miopen-hip/trunk/test.sh ----------+ PKGBUILD | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ test.cpp | 16 +++++++++++++ test.sh | 5 ++++ 3 files changed, 93 insertions(+) Added: miopen-hip/trunk/PKGBUILD =================================================================== --- miopen-hip/trunk/PKGBUILD (rev 0) +++ miopen-hip/trunk/PKGBUILD 2023-01-08 14:11:42 UTC (rev 1382008) @@ -0,0 +1,72 @@ +# Maintainer: Torsten Keßler <tpkessler at archlinux dot org> +# Contributor: acxz <akashpatel at yahoo dot com> +# Contributor: JP-Ellis <[email protected]> + +pkgname=miopen-hip +pkgver=5.4.1 +pkgrel=1 +pkgdesc="AMD's Machine Intelligence Library (HIP backend)" +arch=('x86_64') +url='https://rocmsoftwareplatform.github.io/MIOpen/doc/html/' +license=('MIT') +depends=('rocblas' 'rocm-clang-ocl' 'hip' 'composable-kernel' 'sqlite') +makedepends=('rocm-cmake' 'miopengemm' 'boost' 'nlohmann-json' 'half' 'ninja') +provides=('miopen') +conflicts=('miopen') +_git='https://github.com/ROCmSoftwarePlatform/MIOpen' +_mlir='https://github.com/ROCmSoftwarePlatform/rocMLIR' +_mlirver=5.4.0 #No changes between 5.4.0 and 5.4.1, so no upstream tag +source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz" + "$pkgname-rocmlir-$pkgver.tar.gz::$_mlir/archive/rocm-$_mlirver.tar.gz") +sha256sums=('073b50e4ef4f75626d51b6ca6337e50adee3a81b64620c22a230548e2ba59504' + '3823f455ee392118c3281e27d45fa0e5381f3c4070eb4e06ba13bc6b34a90a60') +_dirname="$(basename "$_git")-$(basename "${source[0]}" .tar.gz)" +_mlirname="$(basename "$_mlir")-$(basename "${source[1]}" .tar.gz)" + +prepare() { + # Disable tests as they require a AMD GPU at build time + sed -i '/add_subdirectory(test)/d' "$_dirname/CMakeLists.txt" +} + +build() { + export CC=/opt/rocm/llvm/bin/clang + export CXX=/opt/rocm/llvm/bin/clang++ + # -fcf-protection is not supported by HIP, see + # https://docs.amd.com/bundle/ROCm-Compiler-Reference-Guide-v5.4/page/Appendix_A.html + export CXXFLAGS="${CXXFLAGS} -fcf-protection=none" + + # Set ROCm test chipset to Vega in order to pass the configuration step. + cmake \ + -Wno-dev \ + -G Ninja \ + -B build-mlir \ + -S "$_mlirname" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DMLIR_MIOPEN_SQLITE_ENABLED=ON \ + -DROCM_TEST_CHIPSET=gfx900 \ + -DBUILD_FAT_LIBROCKCOMPILER=ON + cmake --build build-mlir --target librockCompiler + DESTDIR="$srcdir/deps" cmake --install build-mlir --component librockCompiler + + cmake \ + -Wno-dev \ + -G Ninja \ + -B build \ + -S "$_dirname" \ + -DMIOPEN_BACKEND=HIP \ + -DCMAKE_BUILD_TYPE=None \ + -DHALF_INCLUDE_DIR=/usr/include/half \ + -DCMAKE_PREFIX_PATH="$srcdir/deps/usr/lib/cmake" \ + -DCMAKE_INSTALL_PREFIX=/opt/rocm + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build + + echo '/opt/rocm/miopen/lib' > 'miopen.conf' + install -Dm644 "miopen.conf" "$pkgdir/etc/ld.so.conf.d/miopen.conf" + + install -Dm644 "$_dirname/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} Added: miopen-hip/trunk/test.cpp =================================================================== --- miopen-hip/trunk/test.cpp (rev 0) +++ miopen-hip/trunk/test.cpp 2023-01-08 14:11:42 UTC (rev 1382008) @@ -0,0 +1,16 @@ +#include <miopen/miopen.h> +#include <stdio.h> +#include <stdlib.h> + +int main() +{ + miopenHandle_t handle; + miopenStatus_t s = miopenCreate(&handle); + + if(s != miopenStatusSuccess){ + printf("Cannot create handle for MIOpen!\n"); + return EXIT_FAILURE; + } + miopenDestroy(handle); + printf("TESTS PASSED!\n"); +} Added: miopen-hip/trunk/test.sh =================================================================== --- miopen-hip/trunk/test.sh (rev 0) +++ miopen-hip/trunk/test.sh 2023-01-08 14:11:42 UTC (rev 1382008) @@ -0,0 +1,5 @@ +#! /usr/bin/env sh + +OUT=$(mktemp -d) +/opt/rocm/bin/hipcc -o "$OUT"/test test.cpp -lMIOpen +"$OUT"/test Property changes on: miopen-hip/trunk/test.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property
