diff options
author | Ilya Elenskiy | 2019-03-24 00:32:39 +0100 |
---|---|---|
committer | Ilya Elenskiy | 2019-03-24 00:32:39 +0100 |
commit | 070f50d6cf3a7a19eedde40a7bb3f4a553f21461 (patch) | |
tree | 51e49d516a8eb84685614e45f1045bb14ff87862 | |
download | aur-070f50d6cf3a7a19eedde40a7bb3f4a553f21461.tar.gz |
initial
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | link_dynamic_fix_triplet.patch | 44 |
3 files changed, 126 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..27312be8128f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +# Generated by mksrcinfo v8 +# Sat Mar 23 23:18:32 UTC 2019 +pkgbase = python-numba-roctools-git + pkgdesc = Numba backend for ROCm HSA + pkgver = 0.0.0.r2.g31ab1ff + pkgrel = 1 + url = https://github.com/numba/roctools + arch = x86_64 + license = BSD + makedepends = git + makedepends = cmake + makedepends = make + makedepends = gcc + makedepends = gtest + makedepends = llvm>=7.0.0 + depends = python-numba + depends = llvm>=7.0.0 + depends = lld>=7.0.0 + depends = rocr-runtime>1.9.0 + provides = python-numba-roctools + source = roctools::git+https://github.com/numba/roctools.git#branch=wip/rocm_1_9 + source = http://repo.radeon.com/rocm/yum/rpm/rocm-opencl-devel-1.2.0-2019030851.x86_64.rpm + source = link_dynamic_fix_triplet.patch + sha256sums = SKIP + sha256sums = 173d9b73e65062e85b37b0671566fdae3e7433f4c7b3bbd1a1c4870d6ff98780 + sha256sums = 5a7a9df7dac923ec25a0a8d518f83cd9ad5805f33b4782ec3c212a5a8495e6cb + +pkgname = python-numba-roctools-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f069e3525154 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Ilya Elenskiy <elenskiy.ilya@gmail.com> + +pkgname=python-numba-roctools-git +pkgver=0.0.0.r2.g31ab1ff +pkgrel=1 +pkgdesc="Numba backend for ROCm HSA" +arch=('x86_64') +url="https://github.com/numba/roctools" +license=('BSD') +groups=() +depends=('python-numba' 'llvm>=7.0.0' 'lld>=7.0.0' 'rocr-runtime>1.9.0') +makedepends=(git cmake make gcc gtest 'llvm>=7.0.0') +provides=('python-numba-roctools') +opencl_devel_ver="1.2.0-2019030851" +source=( + "roctools::git+https://github.com/numba/roctools.git#branch=wip/rocm_1_9" + "http://repo.radeon.com/rocm/yum/rpm/rocm-opencl-devel-${opencl_devel_ver}.x86_64.rpm" + "link_dynamic_fix_triplet.patch" +) + +sha256sums=('SKIP' + '173d9b73e65062e85b37b0671566fdae3e7433f4c7b3bbd1a1c4870d6ff98780' + '5a7a9df7dac923ec25a0a8d518f83cd9ad5805f33b4782ec3c212a5a8495e6cb') + +pkgver() { + cd roctools + git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + # link LLVM dynamically and change triplet to amdgcn-amd-amdhsa + patch -p0 -d $srcdir < $srcdir/link_dynamic_fix_triplet.patch +} + +build() { + mkdir -p $srcdir/roctools/build + cd $srcdir/roctools/build + cmake .. -DCMAKE_BITCODE_ROOT:PATH=$srcdir/opt/rocm/opencl/lib/x86_64/bitcode -DCMAKE_CONDA_ROOT:PATH=/usr -DCMAKE_BUILD_TYPE=RELEASE + make +} + +check() { + cd $srcdir/roctools/build/rocmlite/test + ./test_rocmlite + ./test_rocmlite_functions +} + +package() { + mkdir -p $pkgdir/usr/share/rocmtools + cp $srcdir/opt/rocm/opencl/lib/x86_64/bitcode/*.amdgcn.bc $pkgdir/usr/share/rocmtools + mkdir -p $pkgdir/usr/lib + cp $srcdir/roctools/build/rocmlite/librocmlite.so* $pkgdir/usr/lib +} diff --git a/link_dynamic_fix_triplet.patch b/link_dynamic_fix_triplet.patch new file mode 100644 index 000000000000..990e4b2d9f44 --- /dev/null +++ b/link_dynamic_fix_triplet.patch @@ -0,0 +1,44 @@ +diff -ur roctools/rocmlite/CMakeLists.txt ../rocmlite_patch/CMakeLists.txt +--- roctools/rocmlite/CMakeLists.txt 2019-03-23 23:51:59.356874283 +0100 ++++ ../rocmlite_patch/CMakeLists.txt 2019-03-23 22:15:34.293884613 +0100 +@@ -32,7 +32,7 @@ + + + #Link against LLVM libraries +-target_link_libraries(rocmlite ${llvm_libs}) ++target_link_libraries(rocmlite LLVM) + + # include include/ + target_include_directories(rocmlite PUBLIC ${CMAKE_SOURCE_DIR}/include) +diff -ur roctools/rocmlite/rocmlite.cpp ../rocmlite_patch/rocmlite.cpp +--- roctools/rocmlite/rocmlite.cpp 2019-03-23 23:51:59.360207637 +0100 ++++ ../rocmlite_patch/rocmlite.cpp 2019-03-23 23:43:33.923731001 +0100 +@@ -396,7 +396,7 @@ + } + + +- M->setTargetTriple(Triple::normalize("amdgcn--amdhsa")); ++ M->setTargetTriple(Triple::normalize("amdgcn-amd-amdhsa")); + + + Triple ModuleTriple(M->getTargetTriple()); +@@ -494,7 +494,7 @@ + + Triple TheTriple;// = Triple(mod->getTargetTriple()); + +- TheTriple = Triple(Triple::normalize("amdgcn--amdhsa")); ++ TheTriple = Triple(Triple::normalize("amd-amdhsa")); + + // Get the target specific parser. + std::string Error; +diff -ur roctools/rocmlite/test/resources/demo_ir.ll ../rocmlite_patch/test/resources/demo_ir.ll +--- roctools/rocmlite/test/resources/demo_ir.ll 2019-03-23 23:51:59.356874283 +0100 ++++ ../rocmlite_patch/test/resources/demo_ir.ll 2019-03-23 23:47:04.055036783 +0100 +@@ -1,6 +1,6 @@ + ; ModuleID = 'copy_kernel_1d' + target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n32" +-target triple = "amdgcn--amdhsa" ++target triple = "amdgcn-amd-amdhsa" + + define internal spir_func i32 @hsapy_devfn__5F__5F_main_5F__5F__2E_copy_5F_kernel_5F_1d_24_1_2E_array_28_float32_2C__20_1d_2C__20_C_29__2E_array_28_float32_2C__20_1d_2C__20_C_29_(i8** %.ret, i8* %arg.out.0, i8* %arg.out.1, i64 %arg.out.2, i64 %arg.out.3, float addrspace(4)* %arg.out.4, i64 %arg.out.5.0, i64 %arg.out.6.0, i8* %arg.inp.0, i8* %arg.inp.1, i64 %arg.inp.2, i64 %arg.inp.3, float addrspace(4)* %arg.inp.4, i64 %arg.inp.5.0, i64 %arg.inp.6.0) { + entry: |