* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-03-02 17:46 罗百科
0 siblings, 0 replies; 17+ messages in thread
From: 罗百科 @ 2023-03-02 17:46 UTC (permalink / raw
To: gentoo-commits
commit: dfd6445cf1acf78f133028f3e17494702346f464
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 2 17:29:46 2023 +0000
Commit: 罗百科 <patrick <AT> gentoo <DOT> org>
CommitDate: Thu Mar 2 17:45:50 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfd6445c
dev-util/hip: add 5.4.3
Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>
dev-util/hip/Manifest | 4 +
dev-util/hip/files/hip-5.4.3-clang-include.patch | 30 +++++
dev-util/hip/files/hip-5.4.3-clang-version.patch | 70 ++++++++++
dev-util/hip/files/hip-5.4.3-correct-ldflag.patch | 20 +++
dev-util/hip/hip-5.4.3.ebuild | 151 ++++++++++++++++++++++
5 files changed, 275 insertions(+)
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 91fbbb7d722a..8cb4cece793c 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,10 +1,14 @@
DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a
DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca
DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827eeea59f4312b788e868265dcb42197181fd5ef411416da2e11662c7f665f578aa750ab88c3a5405bcc58ee449 SHA512 3f85532cffc09c2ca8e7cd1770263d1c1a38633ed2bc5cfe62072e12a6f8f669db400519950718be31f6b77693d372e2ef905f06c7f02e126aa9ff7d2da97924
+DIST rocclr-5.4.3.tar.gz 640557 BLAKE2B 9ab91bab7ffb06c9c0d1c2ae79533fccc597071dda289ac375e32eb2965c638a7029951d2a49d46eeead9d7d242fe3a0cedb3e444d877af1bbf0e2d801c91e11 SHA512 c1d1a2ca08c2d762a221c04d394469aa7aff46086151333b145e0db9a7c7eb3dbbf8b9693e50d816aa9a13c16b4ebacf5ff3d5d8ff3393a8a764728ef5172d3a
DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24
DIST rocm-hip-5.3.3.tar.gz 1151858 BLAKE2B 5f460b2078c850b3eb4414fcec4a6f951a3b282aa9828f77ba5d5adfdc0ee8d2e62c856e112a154c340daaf7dad49f4871412edd7b38f7fae2e6b17840ee144b SHA512 e747cc10e78cd09009cac762f0e060be13f3447af7ec2a4a2889cbdc09cd76ecb1b5b58c89f09a3b45a8296c2c71e1c55baf113e58a5a12434af3de7168b8d87
+DIST rocm-hip-5.4.3.tar.gz 1195173 BLAKE2B 7452ee7a874bc4703b0d3aaaf9fa2a51e223d5650c65c34982a9981dbe14e8ec70c93d7e70c5ad36a8d02c3d2214fa6a393e20502a01418fb3320d8cfe363feb SHA512 1f4100e114576dcbad83aae453e21ab85cf25bd8a6ada380bb11cfc30e5f92ba903055b7257a099321a84b65adb444dd52b8258e82567f4bc882e65d89369b43
DIST rocm-hipamd-5.1.3.tar.gz 331996 BLAKE2B 176121fe199d53c02a0fc407015681c2f08c8a72104738b457581fd81b37d16efb8170a46d687fb85a45242ba8564246cdd5746e78d9b73dd0bdc9b24eb8378c SHA512 daa6f4da97f71a5fd1f79d8c9e5fc43324743aec91362a05fa62e08966397a637d794abc7e14230eccf5f1271f9fac58d1336aaad1f2cded6cd10792845a494b
DIST rocm-hipamd-5.3.3.tar.gz 383179 BLAKE2B 45c4fbf28d639095db3cec0632e1b1d872104b3755bdca818ed37ac46caab399fcd2224330e6ac8df7ab155fb146b6272b3ed2efe00d7358b47f31ca2cb1e4f5 SHA512 34c62d915990b6742a2df9b37b6b2bad09f7383e561009519911095e8b65f6f1d79486f7f9b97fa76d7a9755b59fca5a5dff321d8c8b15fd83f2fd22ce08834c
+DIST rocm-hipamd-5.4.3.tar.gz 387070 BLAKE2B c5f30b606227692eea4bf9e35d35bff861648ef44357994996b7f1fb798ffe8b3ccf909bedd47d5486049c9742e426002f2d6636daabc679bae1b70e9ee5e89b SHA512 f2e36ceeca2580fd85f6847dc8320640bd43382bcd584f67362b11580a1d429c36596adbde252967a96d3a2dfc2bdca4d34bd23f5fb0d5e5e73e7844f925b03b
DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa666785699f6b4ec0584a927904a94bf830883050943503f8bdd7c97438a2fb11c71686a330d526f633959916c5c6c8da2e037841e79 SHA512 b83c3ae0bfad80f867bacce36710a8964f6dd7e64bf50da3ec6ce842217d6de63299d9ceaab9dc25a22252484520a85d02859809463dad5dda9b1f00a86863e0
DIST rocm-opencl-runtime-5.3.3.tar.gz 1007773 BLAKE2B a3f600a68183337f92b152a123241cb7025889cca2ef6814d9d5b5a2146a78703b171d20bcb432bc7a2cdd1f24ad349408c17816b25a66702e9f0f5345af9082 SHA512 391f0f244b7f02972df8cada821e69ee8d81d96b9cff3c14f1d0838da583d8fb136ec4bd5ee820f6dd261968e9eef5e9a5b10b7bb76b1b64625c399d79bcb03f
+DIST rocm-opencl-runtime-5.4.3.tar.gz 1005268 BLAKE2B f9398e4c2b0f045f1b5d8df9f31b7f2bef6a9201885aa6ee5fc5d71632cfde26a078d9a5ea38c3da12d3c187faf04c7bdcf1a8ecb9927cdba56b1efdfcdc44ee SHA512 f65d4622ce8721a6b91ab5b5b306d142ba507d3e631ac3ab0b76c5bc6d8d18455e02debd954c82e7eb609f232b509f1ec1a013dc2fad467c2c2ad31fdf15755d
DIST rocm-tracer-5.1.3.tar.gz 511617 BLAKE2B 4142979b3b7d649798a7ac0b2a04b42aa7fbcbf82f2cf51b0e5363ec0da538046d6e59283d0ce1bfd341317bf24ac2f694d5c8a7d1f132f9b21caea5caf7eda3 SHA512 e73b0c921ffbdcac571d8b0825de39bd8a4fd5f2720ecdd0c189951db85efb607a0b1cd7a9bb02b3dbf329b277cb5e197525216a8e8927eea4e6ce290b7e7c7b
diff --git a/dev-util/hip/files/hip-5.4.3-clang-include.patch b/dev-util/hip/files/hip-5.4.3-clang-include.patch
new file mode 100644
index 000000000000..21b2c5bac8e8
--- /dev/null
+++ b/dev-util/hip/files/hip-5.4.3-clang-include.patch
@@ -0,0 +1,30 @@
+diff --git a/bin/hipcc.pl b/bin/hipcc.pl
+index a143983..331881e 100755
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -180,9 +180,6 @@ if ($HIP_PLATFORM eq "amd") {
+ $HIP_CLANG_RT_LIB = `$HIPCC --print-runtime-dir`;
+ chomp($HIP_CLANG_RT_LIB);
+
+- if (! defined $HIP_CLANG_INCLUDE_PATH) {
+- $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");
+- }
+ if (! defined $HIP_INCLUDE_PATH) {
+ $HIP_INCLUDE_PATH = "$HIP_PATH/include";
+ }
+@@ -195,15 +192,12 @@ if ($HIP_PLATFORM eq "amd") {
+ print ("HIP_ROCCLR_HOME=$HIP_ROCCLR_HOME\n");
+ }
+ print ("HIP_CLANG_PATH=$HIP_CLANG_PATH\n");
+- print ("HIP_CLANG_INCLUDE_PATH=$HIP_CLANG_INCLUDE_PATH\n");
+ print ("HIP_INCLUDE_PATH=$HIP_INCLUDE_PATH\n");
+ print ("HIP_LIB_PATH=$HIP_LIB_PATH\n");
+ print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n");
+ print ("HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB\n");
+ }
+
+- $HIPCXXFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
+- $HIPCFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
+ $HIPLDFLAGS .= " -L\"$HIP_LIB_PATH\"";
+ if ($isWindows) {
+ $HIPLDFLAGS .= " -lamdhip64";
diff --git a/dev-util/hip/files/hip-5.4.3-clang-version.patch b/dev-util/hip/files/hip-5.4.3-clang-version.patch
new file mode 100644
index 000000000000..88290db66af0
--- /dev/null
+++ b/dev-util/hip/files/hip-5.4.3-clang-version.patch
@@ -0,0 +1,70 @@
+From 73430b62a5437d1ba6c36a1d812a1434d1ad9df7 Mon Sep 17 00:00:00 2001
+From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com>
+Date: Tue, 20 Dec 2022 06:51:12 +0530
+Subject: [PATCH 1/3] SWDEV-344620 - hipcc fails to parse version of clang in
+ some cases (#3119)
+
+Change-Id: I46f716c82a7500b9a2bcaf5f9ff4ad8a8f982770
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+---
+ bin/hipcc.pl | 22 +++++++---------------
+ 1 file changed, 7 insertions(+), 15 deletions(-)
+
+diff --git a/bin/hipcc.pl b/bin/hipcc.pl
+index 645ae62d..2a01dcc3 100755
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -144,7 +144,7 @@ if ($HIP_PLATFORM eq "amd") {
+ $execExtension = "";
+ if($isWindows) {
+ $execExtension = ".exe";
+- }
++ }
+ $HIPCC="$HIP_CLANG_PATH/clang++" . $execExtension;
+
+ # If $HIPCC clang++ is not compiled, use clang instead
+@@ -176,13 +176,9 @@ if ($HIP_PLATFORM eq "amd") {
+ $HIPLDFLAGS .= " -fuse-ld=lld";
+ $HIPLDFLAGS .= " --ld-path=$HIP_CLANG_PATH/lld-link.exe";
+ }
+- $HIP_CLANG_VERSION = `$HIPCC --version`;
+- $HIP_CLANG_VERSION=~/.*clang version (\S+).*/;
+- $HIP_CLANG_VERSION=$1;
+-
+- # Figure out the target with which llvm is configured
+- $HIP_CLANG_TARGET = `$HIPCC -print-target-triple`;
+- chomp($HIP_CLANG_TARGET);
++ # get Clang RT Builtin path
++ $HIP_CLANG_RT_LIB = `$HIPCC --print-runtime-dir`;
++ chomp($HIP_CLANG_RT_LIB);
+
+ if (! defined $HIP_CLANG_INCLUDE_PATH) {
+ $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");
+@@ -184,7 +181,7 @@ if ($HIP_PLATFORM eq "amd") {
+ print ("HIP_INCLUDE_PATH=$HIP_INCLUDE_PATH\n");
+ print ("HIP_LIB_PATH=$HIP_LIB_PATH\n");
+ print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n");
+- print ("HIP_CLANG_TARGET=$HIP_CLANG_TARGET\n");
++ print ("HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB\n");
+ }
+
+ if ($isWindows) {
+@@ -715,13 +712,8 @@ if ($HIP_PLATFORM eq "amd") {
+ } else {
+ $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 ";
+ }
+- # To support __fp16 and _Float16, explicitly link with compiler-rt
+- $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
+- if (-e $HIP_CLANG_BUILTIN_LIB) {
+- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET -lclang_rt.builtins "
+- } else {
+- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/linux -lclang_rt.builtins-x86_64 "
+- }
++
++ $toolArgs .= " -L$HIP_CLANG_RT_LIB -lclang_rt.builtins-x86_64 "
+ }
+ }
+
+--
+2.38.1
+
diff --git a/dev-util/hip/files/hip-5.4.3-correct-ldflag.patch b/dev-util/hip/files/hip-5.4.3-correct-ldflag.patch
new file mode 100644
index 000000000000..3dbbb6721f3b
--- /dev/null
+++ b/dev-util/hip/files/hip-5.4.3-correct-ldflag.patch
@@ -0,0 +1,20 @@
+This removes ldflag -L"/usr/lib" and -Wl,-rpath=/usr/lib:/usr/lib which
+causes `ld: skipping incompatible /usr/lib/libm.so when searching for -lm`
+Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1166193820
+===================================================================
+Index: HIP-rocm-5.3.3/bin/hipcc.pl
+===================================================================
+--- HIP-rocm-5.3.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.3.3/bin/hipcc.pl
+@@ -711,9 +711,9 @@ if ($HIP_PLATFORM eq "amd") {
+
+ if (not $isWindows and not $compileOnly) {
+ if ($linkType eq 0) {
+- $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
++ $toolArgs = " -lamdhip64 -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
+ } else {
+- $toolArgs = ${toolArgs} . " -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 ";
++ $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -lamdhip64 ";
+ }
+ # To support __fp16 and _Float16, explicitly link with compiler-rt
+ $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
diff --git a/dev-util/hip/hip-5.4.3.ebuild b/dev-util/hip/hip-5.4.3.ebuild
new file mode 100644
index 000000000000..417b2b6c3290
--- /dev/null
+++ b/dev-util/hip/hip-5.4.3.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DOCS_BUILDER="doxygen"
+DOCS_DEPEND="media-gfx/graphviz"
+
+inherit cmake docs llvm prefix
+
+LLVM_MAX_SLOT=15
+
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
+SRC_URI="https://github.com/ROCm-Developer-Tools/hipamd/archive/rocm-${PV}.tar.gz -> rocm-hipamd-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz
+ https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug"
+
+DEPEND="
+ >=dev-util/rocminfo-5
+ sys-devel/clang:${LLVM_MAX_SLOT}
+ dev-libs/rocm-comgr:${SLOT}
+ virtual/opengl
+"
+RDEPEND="${DEPEND}
+ dev-perl/URI-Encode
+ sys-devel/clang-runtime:=
+ >=dev-libs/roct-thunk-interface-5"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
+ "${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
+ "${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
+ "${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
+ "${FILESDIR}/${PN}-5.3.3-disable-Werror.patch"
+ "${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
+)
+
+S="${WORKDIR}/hipamd-rocm-${PV}"
+HIP_S="${WORKDIR}"/HIP-rocm-${PV}
+OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
+CLR_S="${WORKDIR}"/ROCclr-rocm-${PV}
+RTC_S="${WORKDIR}"/roctracer-rocm-${PV}
+DOCS_DIR="${HIP_S}"/docs/doxygen-input
+DOCS_CONFIG_NAME=doxy.cfg
+
+pkg_setup() {
+ # Ignore QA FLAGS check for library compiled from assembly sources
+ QA_FLAGS_IGNORED="/usr/$(get_libdir)/libhiprtc-builtins.so.$(ver_cut 1-2)"
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ eapply_user
+
+ # Use Gentoo slot number, otherwise git hash is attempted in vain.
+ sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
+
+ # correctly find HIP_CLANG_INCLUDE_PATH using cmake
+ local LLVM_PREFIX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+ sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":${LLVM_PREFIX}:" -i hip-config.cmake.in || die
+
+ # correct libs and cmake install dir
+ sed -e "/\${HIP_COMMON_DIR}/s:cmake DESTINATION .):cmake/ DESTINATION share/cmake/Modules):" -i CMakeLists.txt || die
+
+ sed -e "/\.hip/d" \
+ -e "/CPACK_RESOURCE_FILE_LICENSE/d" -i packaging/CMakeLists.txt || die
+
+ pushd ${HIP_S} || die
+ eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
+ eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
+ eapply "${FILESDIR}/${PN}-5.4.3-correct-ldflag.patch"
+ eapply "${FILESDIR}/${PN}-5.4.3-clang-version.patch"
+ eapply "${FILESDIR}/${PN}-5.4.3-clang-include.patch"
+ eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+
+ # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
+ # which makes "stdlib.h" not found when using "#include_next" in header files;
+ sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
+ -e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'${EPREFIX}/usr/lib/amdgcn/bitcode':" \
+ -e "s:\$ENV{'HIP_LIB_PATH'}:'${EPREFIX}/usr/$(get_libdir)':" \
+ -e "/rpath/s,--rpath=[^ ]*,," -i bin/hipcc.pl || die
+
+ # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:${EPREFIX}/usr/lib/amdgcn/bitcode:" \
+ -i "${S}/hip-config.cmake.in" || die
+
+ einfo "prefixing hipcc and its utils..."
+ hprefixify $(grep -rl --exclude-dir=build/ --exclude="hip-config.cmake.in" "/usr" "${S}")
+ hprefixify $(grep -rl --exclude-dir=build/ --exclude="hipcc.pl" "/usr" "${HIP_S}")
+
+ cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.3.3.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm"
+ sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
+ -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," \
+ -e "s,@CLANG_PATH@,${LLVM_PREFIX}/bin," -i bin/hipvars.pm || die
+ popd || die
+
+ pushd ${CLR_S} || die
+ eapply "${FILESDIR}/rocclr-5.3.3-gcc13.patch"
+}
+
+src_configure() {
+ use debug && CMAKE_BUILD_TYPE="Debug"
+
+ # TODO: Currently a GENTOO configuration is build,
+ # this is also used in the cmake configuration files
+ # which will be installed to find HIP;
+ # Other ROCm packages expect a "RELEASE" configuration,
+ # see "hipBLAS"
+ local mycmakeargs=(
+ -DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+ -DCMAKE_BUILD_TYPE=${buildtype}
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_SKIP_RPATH=ON
+ -DBUILD_HIPIFY_CLANG=OFF
+ -DHIP_PLATFORM=amd
+ -DHIP_COMPILER=clang
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API=0
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ -DROCCLR_PATH=${CLR_S}
+ -DHIP_COMMON_DIR=${HIP_S}
+ -DAMD_OPENCL_PATH=${OCL_S}
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ HIP_PATH=${HIP_S} docs_compile
+ cmake_src_compile
+}
+
+src_install() {
+
+ cmake_src_install
+
+ rm "${ED}/usr/include/hip/hcc_detail" || die
+
+ # Don't install .hipInfo and .hipVersion to bin/lib
+ rm "${ED}/usr/bin/.hipVersion" || die
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2024-06-26 9:21 Sam James
0 siblings, 0 replies; 17+ messages in thread
From: Sam James @ 2024-06-26 9:21 UTC (permalink / raw
To: gentoo-commits
commit: cd5841411628af6aa1ea693b9d477e06658cfec8
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Tue Jun 25 20:58:01 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 09:19:28 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd584141
dev-util/hip: 6.1.1 reuse patch
The extend-isa-compatibility-check patch already exists, so reuse it to safe
some space in /files
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
...p-6.1.0-extend-isa-compatibility-check-v2.patch | 35 ++++++++++++++++++++++
dev-util/hip/hip-6.1.1.ebuild | 11 ++++++-
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check-v2.patch b/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check-v2.patch
new file mode 100644
index 000000000000..d6e95c994c8f
--- /dev/null
+++ b/dev-util/hip/files/hip-6.1.0-extend-isa-compatibility-check-v2.patch
@@ -0,0 +1,35 @@
+From e188c092a987c45caf2ea4651686ea631ca47c3d Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Tue, 25 Jun 2024 15:22:33 +0200
+Subject: [PATCH] prepare usage of old patch
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+---
+ hipamd/src/hip_code_object.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/hipamd/src/hip_code_object.cpp b/hipamd/src/hip_code_object.cpp
+index 6b3a6d0..fef89df 100644
+--- a/hipamd/src/hip_code_object.cpp
++++ b/hipamd/src/hip_code_object.cpp
+@@ -410,7 +410,7 @@ static bool isCodeObjectCompatibleWithDevice(std::string co_triple_target_id,
+ if (co_triple_target_id == agent_triple_target_id) return true;
+
+ // Parse code object triple target id
+- if (!consume(co_triple_target_id, std::string(kAmdgcnTargetTriple) + '-')) {
++ if (!consume(co_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + '-')) {
+ return false;
+ }
+
+@@ -423,7 +423,7 @@ static bool isCodeObjectCompatibleWithDevice(std::string co_triple_target_id,
+ if (!co_triple_target_id.empty()) return false;
+
+ // Parse agent isa triple target id
+- if (!consume(agent_triple_target_id, std::string(kAmdgcnTargetTriple) + '-')) {
++ if (!consume(agent_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + '-')) {
+ return false;
+ }
+
+--
+2.45.2
+
diff --git a/dev-util/hip/hip-6.1.1.ebuild b/dev-util/hip/hip-6.1.1.ebuild
index ecdf174fed4b..12f75f31f339 100644
--- a/dev-util/hip/hip-6.1.1.ebuild
+++ b/dev-util/hip/hip-6.1.1.ebuild
@@ -48,7 +48,6 @@ RDEPEND="${DEPEND}
PATCHES=(
"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
"${FILESDIR}/${PN}-6.1.0-install.patch"
- "${FILESDIR}/${PN}-6.1.0-extend-isa-compatibility-check.patch"
"${FILESDIR}/${PN}-6.1.1-fix-musl.patch"
)
@@ -60,6 +59,16 @@ hip_test_wrapper() {
}
src_prepare() {
+ # NOTE We do this head stand to safe the patch size.
+ # NOTE Adjust when we drop 5.7.1
+ sed \
+ -e 's:kAmdgcnTargetTriple:AMDGCN_TARGET_TRIPLE:g' \
+ -i hipamd/src/hip_code_object.cpp || die
+ eapply "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
+ sed \
+ -e 's:AMDGCN_TARGET_TRIPLE:kAmdgcnTargetTriple:g' \
+ -i hipamd/src/hip_code_object.cpp || die
+
# hipamd is itself built by cmake, and should never provide a
# FindHIP.cmake module. But the reality is some package relies on it.
# Set HIP and HIP Clang paths directly, don't search using heuristics
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-12-14 15:02 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2023-12-14 15:02 UTC (permalink / raw
To: gentoo-commits
commit: 5297819d6d04e8608d329a12afa05dd68ea4f10f
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 18 14:54:50 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Dec 14 15:01:47 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5297819d
dev-util/hip: include test suit.
The dev-util/hip upstream has separated its test cases into a full git
repository with an independent build system. To run the test cases,
we have to call cmake twice in every src_* phase. I come up with a
wrapper to hack CMAKE_USE_DIR and BUILD_DIR values.
Ignore vulkan tests before someone could figure out how to properly
run them.
Reference: https://github.com/ROCm-Developer-Tools/HIP/issues/3292
Closes: https://github.com/gentoo/gentoo/pull/33906
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
dev-util/hip/Manifest | 1 +
...test-5.7.0-rocm_agent_enumerator-location.patch | 15 +++++
dev-util/hip/hip-5.7.1-r1.ebuild | 75 +++++++++++++++++++---
3 files changed, 82 insertions(+), 9 deletions(-)
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index d84cbf43fe2e..13df1e2aaa2d 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -4,6 +4,7 @@ DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f
DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827eeea59f4312b788e868265dcb42197181fd5ef411416da2e11662c7f665f578aa750ab88c3a5405bcc58ee449 SHA512 3f85532cffc09c2ca8e7cd1770263d1c1a38633ed2bc5cfe62072e12a6f8f669db400519950718be31f6b77693d372e2ef905f06c7f02e126aa9ff7d2da97924
DIST rocclr-5.4.3.tar.gz 640557 BLAKE2B 9ab91bab7ffb06c9c0d1c2ae79533fccc597071dda289ac375e32eb2965c638a7029951d2a49d46eeead9d7d242fe3a0cedb3e444d877af1bbf0e2d801c91e11 SHA512 c1d1a2ca08c2d762a221c04d394469aa7aff46086151333b145e0db9a7c7eb3dbbf8b9693e50d816aa9a13c16b4ebacf5ff3d5d8ff3393a8a764728ef5172d3a
DIST rocclr-5.5.1.tar.gz 634330 BLAKE2B e6383a6b6b09f274a944d66effd345e38a191ec73ee5c5240f8ec8bb62a4df97b80835ce57f8f78c3834602b9da425b49289b5c7cd7e4c7071147ff409c6a6c9 SHA512 4c12011d22a4f14d9e93250b2a38716eb973139afa1adbbbd51c0e0ed13c0b7c1f45a37c71ef937c5fdabf09e928d7913ca3332fc61b7a2c10d21421306a228f
+DIST rocm-5.7.0.tar.gz 845881 BLAKE2B 08255edc1407e5ef85895336b11496319695318fce265565728ad75175b5e1dfab98f696fee2d27e60c48e862f721fad4c53118cc70b807353fff5f97ed72ac2 SHA512 72420e16c7cfe9687e030331838666dabaa43d686bdad1d109431e44db99070a2cf6dd64b59e3275019abedd6612f6008c798a79275e7225b6b122fb9f644660
DIST rocm-clr-5.7.1.tar.gz 2008647 BLAKE2B 3db0760d6f83504e60caf88a2dd5e0bc02c7db9d6f263ad0eb2cfc79aa0f88a3699c412844a0158a796d9d02e79660287e791edad787d814eefffea4fd2298b4 SHA512 d79323481d82fc02c12a32cdcc0d14437d512af023e7737db0387b7eecb27fe6e4ae7c71d6adce57932a04bb24c880440d9dc10aeb5af11a4f2ca64d44330965
DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24
DIST rocm-hip-5.3.3.tar.gz 1151858 BLAKE2B 5f460b2078c850b3eb4414fcec4a6f951a3b282aa9828f77ba5d5adfdc0ee8d2e62c856e112a154c340daaf7dad49f4871412edd7b38f7fae2e6b17840ee144b SHA512 e747cc10e78cd09009cac762f0e060be13f3447af7ec2a4a2889cbdc09cd76ecb1b5b58c89f09a3b45a8296c2c71e1c55baf113e58a5a12434af3de7168b8d87
diff --git a/dev-util/hip/files/hip-test-5.7.0-rocm_agent_enumerator-location.patch b/dev-util/hip/files/hip-test-5.7.0-rocm_agent_enumerator-location.patch
new file mode 100644
index 000000000000..1d967212ac9a
--- /dev/null
+++ b/dev-util/hip/files/hip-test-5.7.0-rocm_agent_enumerator-location.patch
@@ -0,0 +1,15 @@
+In Gentoo rocm_agent_enumerator is installed by rocminfo and is in PATH.
+
+--- catch/CMakeLists.txt~ 2023-11-18 13:56:08.000000000 +0800
++++ catch/CMakeLists.txt 2023-11-18 13:59:28.136170638 +0800
+@@ -182,9 +182,8 @@
+ # rocm_agent_enumerator
+ if(NOT DEFINED OFFLOAD_ARCH_STR
+ AND NOT DEFINED ENV{HCC_AMDGPU_TARGET}
+- AND EXISTS "${ROCM_PATH}/bin/rocm_agent_enumerator"
+ AND HIP_PLATFORM STREQUAL "amd" AND UNIX)
+- execute_process(COMMAND ${ROCM_PATH}/bin/rocm_agent_enumerator
++ execute_process(COMMAND rocm_agent_enumerator
+ OUTPUT_VARIABLE HIP_GPU_ARCH
+ RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT)
+ # Trim out gfx000
diff --git a/dev-util/hip/hip-5.7.1-r1.ebuild b/dev-util/hip/hip-5.7.1-r1.ebuild
index 8eb15a833e66..2bc703093df9 100644
--- a/dev-util/hip/hip-5.7.1-r1.ebuild
+++ b/dev-util/hip/hip-5.7.1-r1.ebuild
@@ -5,21 +5,26 @@ EAPI=8
DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
+ROCM_SKIP_GLOBALS=1
-inherit cmake docs llvm
+inherit cmake docs llvm rocm
LLVM_MAX_SLOT=17
+TEST_PV=5.7.0 # No hip-test-5.7.1 release
+
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
SRC_URI="https://github.com/ROCm-Developer-Tools/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz
- https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz"
+ https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz
+ test? ( https://github.com/ROCm-Developer-Tools/hip-tests/archive/refs/tags/rocm-${TEST_PV}.tar.gz )"
KEYWORDS="~amd64"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
-IUSE="debug"
+RESTRICT="!test? ( test )"
+IUSE="debug test"
DEPEND="
dev-util/hipcc
@@ -45,18 +50,35 @@ PATCHES=(
S="${WORKDIR}/clr-rocm-${PV}/"
+hip_test_wrapper() {
+ local S="${WORKDIR}/hip-tests-rocm-${TEST_PV}/catch"
+ local CMAKE_USE_DIR="${S}"
+ local BUILD_DIR="${S}_build"
+ cd "${S}" || die
+ $@
+}
+
+src_prepare() {
+ # https://github.com/ROCm-Developer-Tools/HIP/commit/405d029422ba8bb6be5a233d5eebedd2ad2e8bd3
+ # https://github.com/ROCm-Developer-Tools/clr/commit/ab6d34ae773f4d151e04170c0f4e46c1135ddf3e
+ # Migrated to hip-test, but somehow the change is not applied to the tarball.
+ rm -rf "${WORKDIR}"/HIP-rocm-${PV}/tests || die
+ sed -e '/tests.*cmake/d' -i hipamd/CMakeLists.txt || die
+
+ cmake_src_prepare
+
+ if use test; then
+ PATCHES=${FILESDIR}/hip-test-5.7.0-rocm_agent_enumerator-location.patch \
+ hip_test_wrapper cmake_src_prepare
+ fi
+}
+
src_configure() {
use debug && CMAKE_BUILD_TYPE="Debug"
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
local mycmakeargs=(
-DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
-DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
-DCMAKE_SKIP_RPATH=ON
-DBUILD_HIPIFY_CLANG=OFF
-DHIP_PLATFORM=amd
@@ -70,10 +92,45 @@ src_configure() {
)
cmake_src_configure
+
+ if use test; then
+ local mycmakeargs=(
+ -DROCM_PATH="${BUILD_DIR}"/hipamd
+ -DHIP_PLATFORM=amd
+ )
+ hip_test_wrapper cmake_src_configure
+ fi
}
src_compile() {
cmake_src_compile
+
+ if use test; then
+ HIP_PATH="${BUILD_DIR}"/hipamd \
+ hip_test_wrapper cmake_src_compile build_tests
+ fi
+}
+
+src_test() {
+ check_amdgpu
+ export LD_LIBRARY_PATH="${BUILD_DIR}/hipamd/lib"
+
+ # TODO: research how to test Vulkan-related features.
+ local CMAKE_SKIP_TESTS=(
+ Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write
+ Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters
+ Unit_hipImportExternalMemory_Vulkan_Negative_Parameters
+ Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
+ Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
+ Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters
+ Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore
+ Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores
+ Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters
+ Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters
+ Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters
+ )
+
+ MAKEOPTS="-j1" hip_test_wrapper cmake_src_test
}
src_install() {
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-12-14 15:02 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2023-12-14 15:02 UTC (permalink / raw
To: gentoo-commits
commit: 093aafa4f80f05873a812a69f072413609da50ac
Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Fri Oct 20 22:02:59 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Thu Dec 14 15:01:59 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=093aafa4
dev-util/hip: add extend-isa-compatibility-check patch
Bug: https://github.com/gentoo/gentoo/pull/33400
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
.../hip-5.7.1-extend-isa-compatibility-check.patch | 236 +++++++++++++++++++++
dev-util/hip/hip-5.7.1-r1.ebuild | 1 +
2 files changed, 237 insertions(+)
diff --git a/dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch b/dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch
new file mode 100644
index 000000000000..7853de693cde
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch
@@ -0,0 +1,236 @@
+Combined with matching changes within rocr-runtime ebuild, this patch allows
+to load compatible kernels whenever possible.
+For example if AMDGPU_TARGETS is set to gfx1030 and some application
+was started on gfx1036, it loads gfx1030 kernel.
+
+Author: Cordell Bloor <cgmb@slerp.xyz>
+https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0025-improve-rocclr-isa-compatibility-check.patch
+https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026-extend-hip-isa-compatibility-check.patch
+--- a/hipamd/src/hip_code_object.cpp
++++ b/hipamd/src/hip_code_object.cpp
+@@ -390,47 +390,123 @@ static bool getTripleTargetID(std::string bundled_co_entry_id, const void* code_
+ return true;
+ }
+
+-static bool isCodeObjectCompatibleWithDevice(std::string co_triple_target_id,
+- std::string agent_triple_target_id) {
++struct GfxPattern {
++ std::string root;
++ std::string suffixes;
++};
++
++static bool matches(const GfxPattern& p, const std::string& s) {
++ if (p.root.size() + 1 != s.size()) {
++ return false;
++ }
++ if (0 != std::memcmp(p.root.data(), s.data(), p.root.size())) {
++ return false;
++ }
++ return p.suffixes.find(s[p.root.size()]) != std::string::npos;
++}
++
++static bool isGfx900EquivalentProcessor(const std::string& processor) {
++ return matches(GfxPattern{"gfx90", "029c"}, processor);
++}
++
++static bool isGfx900SupersetProcessor(const std::string& processor) {
++ return matches(GfxPattern{"gfx90", "0269c"}, processor);
++}
++
++static bool isGfx1030EquivalentProcessor(const std::string& processor) {
++ return matches(GfxPattern{"gfx103", "0123456"}, processor);
++}
++
++static bool isGfx1010EquivalentProcessor(const std::string& processor) {
++ return matches(GfxPattern{"gfx101", "02"}, processor);
++}
++
++static bool isGfx1010SupersetProcessor(const std::string& processor) {
++ return matches(GfxPattern{"gfx101", "0123"}, processor);
++}
++
++enum CompatibilityScore {
++ CS_EXACT_MATCH = 1 << 4,
++ CS_PROCESSOR_MATCH = 1 << 3,
++ CS_PROCESSOR_COMPATIBLE = 1 << 2,
++ CS_XNACK_SPECIALIZED = 1 << 1,
++ CS_SRAM_ECC_SPECIALIZED = 1 << 0,
++ CS_INCOMPATIBLE = 0,
++};
++
++static int getProcessorCompatibilityScore(const std::string& co_processor,
++ const std::string& agent_processor) {
++ if (co_processor == agent_processor)
++ return CS_PROCESSOR_MATCH;
++
++ if (isGfx900SupersetProcessor(agent_processor))
++ return isGfx900EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE;
++
++ if (isGfx1010SupersetProcessor(agent_processor))
++ return isGfx1010EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE;
++
++ if (isGfx1030EquivalentProcessor(agent_processor))
++ return isGfx1030EquivalentProcessor(co_processor) ? CS_PROCESSOR_COMPATIBLE : CS_INCOMPATIBLE;
++
++ return CS_INCOMPATIBLE;
++}
++
++static int getCompatiblityScore(std::string co_triple_target_id,
++ std::string agent_triple_target_id) {
+ // Primitive Check
+- if (co_triple_target_id == agent_triple_target_id) return true;
++ if (co_triple_target_id == agent_triple_target_id) return CS_EXACT_MATCH;
+
+ // Parse code object triple target id
+ if (!consume(co_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + '-')) {
+- return false;
++ return CS_INCOMPATIBLE;
+ }
+
+ std::string co_processor;
+ char co_sram_ecc, co_xnack;
+ if (!getTargetIDValue(co_triple_target_id, co_processor, co_sram_ecc, co_xnack)) {
+- return false;
++ return CS_INCOMPATIBLE;
+ }
+
+- if (!co_triple_target_id.empty()) return false;
++ if (!co_triple_target_id.empty()) return CS_INCOMPATIBLE;
+
+ // Parse agent isa triple target id
+ if (!consume(agent_triple_target_id, std::string(AMDGCN_TARGET_TRIPLE) + '-')) {
+- return false;
++ return CS_INCOMPATIBLE;
+ }
+
+ std::string agent_isa_processor;
+ char isa_sram_ecc, isa_xnack;
+ if (!getTargetIDValue(agent_triple_target_id, agent_isa_processor, isa_sram_ecc, isa_xnack)) {
+- return false;
++ return CS_INCOMPATIBLE;
+ }
+
+- if (!agent_triple_target_id.empty()) return false;
++ if (!agent_triple_target_id.empty()) return CS_INCOMPATIBLE;
+
+ // Check for compatibility
+- if (agent_isa_processor != co_processor) return false;
+- if (co_sram_ecc != ' ') {
+- if (co_sram_ecc != isa_sram_ecc) return false;
++ int processor_score = getProcessorCompatibilityScore(co_processor, agent_isa_processor);
++ if (processor_score == CS_INCOMPATIBLE) {
++ return CS_INCOMPATIBLE;
+ }
+- if (co_xnack != ' ') {
+- if (co_xnack != isa_xnack) return false;
++
++ int xnack_bonus;
++ if (co_xnack == ' ') {
++ xnack_bonus = 0;
++ } else if (co_xnack == isa_xnack) {
++ xnack_bonus = CS_XNACK_SPECIALIZED;
++ } else {
++ return CS_INCOMPATIBLE;
+ }
+
+- return true;
++ int sram_ecc_bonus;
++ if (co_sram_ecc == ' ') {
++ sram_ecc_bonus = 0;
++ } else if (co_sram_ecc == isa_sram_ecc) {
++ sram_ecc_bonus = CS_SRAM_ECC_SPECIALIZED;
++ } else {
++ return CS_INCOMPATIBLE;
++ }
++
++ return processor_score + xnack_bonus + sram_ecc_bonus;
+ }
+
+ // This will be moved to COMGR eventually
+@@ -483,6 +559,7 @@ hipError_t CodeObject::extractCodeObjectFromFatBinary(
+ for (size_t i = 0; i < agent_triple_target_ids.size(); i++) {
+ code_objs.push_back(std::make_pair(nullptr, 0));
+ }
++ std::vector<int> compatibility_score(agent_triple_target_ids.size());
+
+ const auto obheader = reinterpret_cast<const __ClangOffloadBundleHeader*>(data);
+ const auto* desc = &obheader->desc[0];
+@@ -495,17 +572,19 @@ hipError_t CodeObject::extractCodeObjectFromFatBinary(
+ reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(obheader) + desc->offset);
+ const size_t image_size = desc->size;
+
+- if (num_code_objs == 0) break;
+ std::string bundleEntryId{desc->bundleEntryId, desc->bundleEntryIdSize};
+
+ std::string co_triple_target_id;
+ if (!getTripleTargetID(bundleEntryId, image, co_triple_target_id)) continue;
+
+ for (size_t dev = 0; dev < agent_triple_target_ids.size(); ++dev) {
+- if (code_objs[dev].first) continue;
+- if (isCodeObjectCompatibleWithDevice(co_triple_target_id, agent_triple_target_ids[dev])) {
++ if (compatibility_score[dev] >= CS_PROCESSOR_MATCH) continue;
++ int score = getCompatiblityScore(co_triple_target_id, agent_triple_target_ids[dev]);
++ if (score > compatibility_score[dev]) {
++ compatibility_score[dev] = score;
++ if (!code_objs[dev].first)
++ --num_code_objs;
+ code_objs[dev] = std::make_pair(image, image_size);
+- --num_code_objs;
+ }
+ }
+ }
+--- a/rocclr/device/device.cpp
++++ b/rocclr/device/device.cpp
+@@ -232,10 +232,49 @@ std::string Isa::isaName() const {
+ return std::string(hsaIsaNamePrefix) + targetId();
+ }
+
++template <class T, std::size_t N>
++static bool Contains(const std::array<T, N>& arr, const T& value) {
++ return std::find(std::begin(arr), std::end(arr), value) != std::end(arr);
++}
++
++static bool IsVersionCompatible(const Isa &codeObjectIsa,
++ const Isa &agentIsa) {
++ if (codeObjectIsa.versionMajor() == agentIsa.versionMajor() &&
++ codeObjectIsa.versionMinor() == agentIsa.versionMinor()) {
++
++ if (codeObjectIsa.versionStepping() == agentIsa.versionStepping()) {
++ return true; // exact match
++ }
++
++ // The code object and the agent may sometimes be compatible if
++ // they differ only by stepping version.
++ if (codeObjectIsa.versionMajor() == 9 &&
++ codeObjectIsa.versionMinor() == 0) {
++ const std::array<uint32_t, 4> gfx900_equivalent = { 0, 2, 9, 12 };
++ const std::array<uint32_t, 5> gfx900_superset = { 0, 2, 6, 9, 12 };
++ if (Contains(gfx900_equivalent, codeObjectIsa.versionStepping()) &&
++ Contains(gfx900_superset, agentIsa.versionStepping())) {
++ return true; // gfx900 compatible object and agent
++ }
++ } else if (codeObjectIsa.versionMajor() == 10) {
++ if (codeObjectIsa.versionMinor() == 1) {
++ const std::array<uint32_t, 2> gfx1010_equivalent = { 0, 2 };
++ const std::array<uint32_t, 4> gfx1010_superset = { 0, 1, 2, 3 };
++ if (Contains(gfx1010_equivalent, codeObjectIsa.versionStepping()) &&
++ Contains(gfx1010_superset, agentIsa.versionStepping())) {
++ return true; // gfx1010 compatible object and agent
++ }
++ } else if (codeObjectIsa.versionMinor() == 3) {
++ return true; // gfx1030 compatible object and agent
++ }
++ }
++ }
++
++ return false;
++}
++
+ bool Isa::isCompatible(const Isa &codeObjectIsa, const Isa &agentIsa) {
+- if (codeObjectIsa.versionMajor() != agentIsa.versionMajor() ||
+- codeObjectIsa.versionMinor() != agentIsa.versionMinor() ||
+- codeObjectIsa.versionStepping() != agentIsa.versionStepping())
++ if (!IsVersionCompatible(codeObjectIsa, agentIsa))
+ return false;
+
+ assert(codeObjectIsa.isSrameccSupported() == agentIsa.isSrameccSupported() &&
diff --git a/dev-util/hip/hip-5.7.1-r1.ebuild b/dev-util/hip/hip-5.7.1-r1.ebuild
index 25601091075f..7b1a593f23e5 100644
--- a/dev-util/hip/hip-5.7.1-r1.ebuild
+++ b/dev-util/hip/hip-5.7.1-r1.ebuild
@@ -46,6 +46,7 @@ PATCHES=(
"${FILESDIR}/${PN}-5.7.1-exec-stack.patch"
"${FILESDIR}/${PN}-5.7.1-disable-stack-protector.patch"
"${FILESDIR}/${PN}-5.7.1-no_asan_doc.patch"
+ "${FILESDIR}/${PN}-5.7.1-extend-isa-compatibility-check.patch"
)
S="${WORKDIR}/clr-rocm-${PV}/"
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-10-09 16:27 罗百科
0 siblings, 0 replies; 17+ messages in thread
From: 罗百科 @ 2023-10-09 16:27 UTC (permalink / raw
To: gentoo-commits
commit: 78d2ff1e77aa11557868517248f67c1bdde3181a
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 9 16:25:26 2023 +0000
Commit: 罗百科 <patrick <AT> gentoo <DOT> org>
CommitDate: Mon Oct 9 16:27:42 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78d2ff1e
dev-util/hip: add 5.7.0
Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>
dev-util/hip/Manifest | 2 +
dev-util/hip/files/hip-5.7.0-install.patch | 13 +++++
dev-util/hip/hip-5.7.0.ebuild | 85 ++++++++++++++++++++++++++++++
3 files changed, 100 insertions(+)
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index 61341cfb54ec..b3a6181bb24a 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,8 +1,10 @@
DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a
+DIST hip-5.7.0.tar.gz 553784 BLAKE2B bb22d46b04888301f45892380cf559f8b607215d0820431a9ecbf912af2c352d145a66d4d82c7485eb21d94c71d324d806be5f0c87d2a0ad501f223571b1a2d6 SHA512 02d42f0abb81c21a6929eff2257975eca4a022e6f9fc84e7ff46b84c8f40a69074bf3cad9f09ecd05a26c7a3bde30c67ef44cb028a5206e0738535a0dc4f6145
DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca
DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827eeea59f4312b788e868265dcb42197181fd5ef411416da2e11662c7f665f578aa750ab88c3a5405bcc58ee449 SHA512 3f85532cffc09c2ca8e7cd1770263d1c1a38633ed2bc5cfe62072e12a6f8f669db400519950718be31f6b77693d372e2ef905f06c7f02e126aa9ff7d2da97924
DIST rocclr-5.4.3.tar.gz 640557 BLAKE2B 9ab91bab7ffb06c9c0d1c2ae79533fccc597071dda289ac375e32eb2965c638a7029951d2a49d46eeead9d7d242fe3a0cedb3e444d877af1bbf0e2d801c91e11 SHA512 c1d1a2ca08c2d762a221c04d394469aa7aff46086151333b145e0db9a7c7eb3dbbf8b9693e50d816aa9a13c16b4ebacf5ff3d5d8ff3393a8a764728ef5172d3a
DIST rocclr-5.5.1.tar.gz 634330 BLAKE2B e6383a6b6b09f274a944d66effd345e38a191ec73ee5c5240f8ec8bb62a4df97b80835ce57f8f78c3834602b9da425b49289b5c7cd7e4c7071147ff409c6a6c9 SHA512 4c12011d22a4f14d9e93250b2a38716eb973139afa1adbbbd51c0e0ed13c0b7c1f45a37c71ef937c5fdabf09e928d7913ca3332fc61b7a2c10d21421306a228f
+DIST rocm-clr-5.7.0.tar.gz 2008521 BLAKE2B 2edc6955a8b8bfd419f3e77e553081816fc3d8b8147d485f47006eb1aa2480dcc1aefa6641ca2ee610d855970946d194db13aa529830d09e74e411636b845bf2 SHA512 2c36e44ce488c01deaae4a73daad2b18d34c0a23a8ad1b72cee0936e6e3651f47275a84190f4f92eadd1dceb153cd4dd3746dd40066055bda65902aec40b8071
DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24
DIST rocm-hip-5.3.3.tar.gz 1151858 BLAKE2B 5f460b2078c850b3eb4414fcec4a6f951a3b282aa9828f77ba5d5adfdc0ee8d2e62c856e112a154c340daaf7dad49f4871412edd7b38f7fae2e6b17840ee144b SHA512 e747cc10e78cd09009cac762f0e060be13f3447af7ec2a4a2889cbdc09cd76ecb1b5b58c89f09a3b45a8296c2c71e1c55baf113e58a5a12434af3de7168b8d87
DIST rocm-hip-5.4.3.tar.gz 1195173 BLAKE2B 7452ee7a874bc4703b0d3aaaf9fa2a51e223d5650c65c34982a9981dbe14e8ec70c93d7e70c5ad36a8d02c3d2214fa6a393e20502a01418fb3320d8cfe363feb SHA512 1f4100e114576dcbad83aae453e21ab85cf25bd8a6ada380bb11cfc30e5f92ba903055b7257a099321a84b65adb444dd52b8258e82567f4bc882e65d89369b43
diff --git a/dev-util/hip/files/hip-5.7.0-install.patch b/dev-util/hip/files/hip-5.7.0-install.patch
new file mode 100644
index 000000000000..668e24af7c52
--- /dev/null
+++ b/dev-util/hip/files/hip-5.7.0-install.patch
@@ -0,0 +1,13 @@
+diff --git a/hipamd/CMakeLists.txt b/hipamd/CMakeLists.txt
+index a472c5b7a..ac6fdc2ab 100755
+--- a/hipamd/CMakeLists.txt
++++ b/hipamd/CMakeLists.txt
+@@ -396,8 +396,6 @@ if (NOT ${HIPCC_BIN_DIR} STREQUAL "")
+ install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.pl DESTINATION bin)
+ install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.pl DESTINATION bin)
+ install(PROGRAMS ${HIPCC_BIN_DIR}/hipvars.pm DESTINATION bin)
+- install(PROGRAMS ${HIPCC_BIN_DIR}/hipcc.bat DESTINATION bin)
+- install(PROGRAMS ${HIPCC_BIN_DIR}/hipconfig.bat DESTINATION bin)
+ endif()
+
+ #############################
diff --git a/dev-util/hip/hip-5.7.0.ebuild b/dev-util/hip/hip-5.7.0.ebuild
new file mode 100644
index 000000000000..bf7dd830e283
--- /dev/null
+++ b/dev-util/hip/hip-5.7.0.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DOCS_BUILDER="doxygen"
+DOCS_DEPEND="media-gfx/graphviz"
+
+inherit cmake docs llvm
+
+LLVM_MAX_SLOT=17
+
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
+SRC_URI="https://github.com/ROCm-Developer-Tools/clr/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-clr-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-${PV}.tar.gz -> hip-${PV}.tar.gz"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug"
+
+DEPEND="
+ dev-util/hipcc
+ >=dev-util/rocminfo-5
+ sys-devel/clang:${LLVM_MAX_SLOT}
+ dev-libs/rocm-comgr:${SLOT}
+ virtual/opengl
+"
+RDEPEND="${DEPEND}
+ dev-perl/URI-Encode
+ sys-devel/clang-runtime:=
+ >=dev-libs/roct-thunk-interface-5"
+
+PATCHES=(
+ "${FILESDIR}/hip-5.7.0-install.patch"
+ )
+
+S="${WORKDIR}/clr-rocm-${PV}/"
+
+src_configure() {
+ use debug && CMAKE_BUILD_TYPE="Debug"
+
+ # TODO: Currently a GENTOO configuration is build,
+ # this is also used in the cmake configuration files
+ # which will be installed to find HIP;
+ # Other ROCm packages expect a "RELEASE" configuration,
+ # see "hipBLAS"
+ local mycmakeargs=(
+ -DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+ -DCMAKE_BUILD_TYPE=${buildtype}
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_SKIP_RPATH=ON
+ -DBUILD_HIPIFY_CLANG=OFF
+ -DHIP_PLATFORM=amd
+ -DHIP_COMMON_DIR="${WORKDIR}/HIP-rocm-${PV}"
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API=0
+ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ -DCLR_BUILD_HIP=ON
+ -DHIPCC_BIN_DIR=/usr/bin
+ -DOpenGL_GL_PREFERENCE="GLVND"
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+}
+
+src_install() {
+
+ cmake_src_install
+
+ rm "${ED}/usr/include/hip/hcc_detail" || die
+
+ # files already installed by hipcc, which is a build dep
+ rm "${ED}/usr/bin/hipconfig.pl" || die
+ rm "${ED}/usr/bin/hipcc.pl" || die
+ rm "${ED}/usr/bin/hipcc" || die
+ rm "${ED}/usr/bin/hipconfig" || die
+ rm "${ED}/usr/bin/hipvars.pm" || die
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-04-05 16:10 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2023-04-05 16:10 UTC (permalink / raw
To: gentoo-commits
commit: 8039d6fb841d9bf4841574000b43c12ff9d30f37
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Sun Mar 19 15:25:18 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Wed Apr 5 16:09:29 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8039d6fb
dev-util/hip: fix HIP_CLANG_PATH detection in FindHIP.cmake
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/29973
.../hip-5.4.3-fix-HIP_CLANG_PATH-detection.patch | 26 ++++++++++++++++++++++
dev-util/hip/hip-5.3.3-r3.ebuild | 1 +
dev-util/hip/hip-5.4.3.ebuild | 1 +
3 files changed, 28 insertions(+)
diff --git a/dev-util/hip/files/hip-5.4.3-fix-HIP_CLANG_PATH-detection.patch b/dev-util/hip/files/hip-5.4.3-fix-HIP_CLANG_PATH-detection.patch
new file mode 100644
index 000000000000..28277d9d880c
--- /dev/null
+++ b/dev-util/hip/files/hip-5.4.3-fix-HIP_CLANG_PATH-detection.patch
@@ -0,0 +1,26 @@
+From 03a7fd2937c146142fa95d22a0ee10df40442788 Mon Sep 17 00:00:00 2001
+From: Yiyang Wu <xgreenlandforwyy@gmail.com>
+Date: Sun, 19 Mar 2023 22:32:01 +0800
+Subject: [PATCH] FindHIP.cmake: fix HIP_CLANG_PATH detection via
+ HIP_CLANG_INSTALL_DIR
+
+---
+ cmake/FindHIP.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake
+index 109c9f65..5dc4c632 100644
+--- a/cmake/FindHIP.cmake
++++ b/cmake/FindHIP.cmake
+@@ -255,7 +255,7 @@ elseif("${HIP_COMPILER}" STREQUAL "clang")
+ if("x${HIP_CLANG_PATH}" STREQUAL "x")
+ # IF HIP_CLANG_INSTALL_DIR is Found
+ if( HIP_CLANG_INSTALL_DIR )
+- set(HIP_CLANG_PATH ${HIP_CLANG_INSTALL_DIR})
++ set(HIP_CLANG_PATH "${HIP_CLANG_INSTALL_DIR}/bin")
+ else() # IF HIP_CLANG_INSTALL_DIR is not found
+ if(DEFINED ENV{HIP_CLANG_PATH})
+ set(HIP_CLANG_PATH $ENV{HIP_CLANG_PATH})
+--
+2.40.0
+
diff --git a/dev-util/hip/hip-5.3.3-r3.ebuild b/dev-util/hip/hip-5.3.3-r3.ebuild
index e73675209ae1..c03da0d6effc 100644
--- a/dev-util/hip/hip-5.3.3-r3.ebuild
+++ b/dev-util/hip/hip-5.3.3-r3.ebuild
@@ -81,6 +81,7 @@ src_prepare() {
eapply "${FILESDIR}/0001-SWDEV-344620-hipcc-fails-to-parse-version-of-clang-i.patch"
eapply "${FILESDIR}/0002-SWDEV-355608-Remove-clang-include-path-2996.patch"
eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+ eapply "${FILESDIR}/${PN}-5.4.3-fix-HIP_CLANG_PATH-detection.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
diff --git a/dev-util/hip/hip-5.4.3.ebuild b/dev-util/hip/hip-5.4.3.ebuild
index 417b2b6c3290..7798aab3e444 100644
--- a/dev-util/hip/hip-5.4.3.ebuild
+++ b/dev-util/hip/hip-5.4.3.ebuild
@@ -81,6 +81,7 @@ src_prepare() {
eapply "${FILESDIR}/${PN}-5.4.3-clang-version.patch"
eapply "${FILESDIR}/${PN}-5.4.3-clang-include.patch"
eapply "${FILESDIR}/0003-SWDEV-352878-Removed-relative-path-based-CLANG-inclu.patch"
+ eapply "${FILESDIR}/${PN}-5.4.3-fix-HIP_CLANG_PATH-detection.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-02-20 4:33 Sam James
0 siblings, 0 replies; 17+ messages in thread
From: Sam James @ 2023-02-20 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 1d983277e4fcd3db3a723bf3eeba896eadd67c2c
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Mon Feb 20 01:59:55 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 04:26:02 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d983277
dev-util/hip: backport patch to fix gcc-13 compile issue
Closes: https://bugs.gentoo.org/895396
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-util/hip/files/rocclr-5.3.3-gcc13.patch | 25 +++++++++++++++++++++++++
dev-util/hip/hip-5.3.3-r3.ebuild | 1 +
2 files changed, 26 insertions(+)
diff --git a/dev-util/hip/files/rocclr-5.3.3-gcc13.patch b/dev-util/hip/files/rocclr-5.3.3-gcc13.patch
new file mode 100644
index 000000000000..17a64d20bf1e
--- /dev/null
+++ b/dev-util/hip/files/rocclr-5.3.3-gcc13.patch
@@ -0,0 +1,25 @@
+From ca70cd7c3d63b1036e604116f3b269ca123e7904 Mon Sep 17 00:00:00 2001
+From: Jeremy Newton <Jeremy.Newton@amd.com>
+Date: Wed, 8 Feb 2023 14:03:58 -0500
+Subject: [PATCH] SWDEV-1 - device: Add missing include
+
+Newer GCC's seem to require this.
+
+Change-Id: I85926d4fa552b772f2eb9f8ede7863a546c47f54
+Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
+---
+ device/devhcprintf.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/device/devhcprintf.cpp b/device/devhcprintf.cpp
+index b36f7758..a5aba4a4 100644
+--- a/device/devhcprintf.cpp
++++ b/device/devhcprintf.cpp
+@@ -23,6 +23,7 @@
+
+ #include <assert.h>
+ #include <cstdarg>
++#include <cstdint>
+ #include <cstdio>
+ #include <cstring>
+ #include <string>
diff --git a/dev-util/hip/hip-5.3.3-r3.ebuild b/dev-util/hip/hip-5.3.3-r3.ebuild
index b4f51b3ef7b0..e73675209ae1 100644
--- a/dev-util/hip/hip-5.3.3-r3.ebuild
+++ b/dev-util/hip/hip-5.3.3-r3.ebuild
@@ -105,6 +105,7 @@ src_prepare() {
pushd ${CLR_S} || die
eapply "${FILESDIR}/rocclr-${PV}-fix-include.patch"
+ eapply "${FILESDIR}/rocclr-5.3.3-gcc13.patch"
}
src_configure() {
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-02-10 4:26 Sam James
0 siblings, 0 replies; 17+ messages in thread
From: Sam James @ 2023-02-10 4:26 UTC (permalink / raw
To: gentoo-commits
commit: f98177a3fe2ea8cf1818daec64268f9377176902
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Fri Feb 10 04:00:28 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 10 04:25:42 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f98177a3
dev-util/hip: fix rocclr compile issue
Due to bbff88f734f62381b0a0624b4b2d182a8d4b8589, /usr/include/hsa.h is
gone, so backport patch for rocclr to fix compile error.
Bug: https://bugs.gentoo.org/893602
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/29513
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-util/hip/files/rocclr-5.3.3-fix-include.patch | 218 ++++++++++++++++++++++
dev-util/hip/hip-5.3.3-r3.ebuild | 4 +
2 files changed, 222 insertions(+)
diff --git a/dev-util/hip/files/rocclr-5.3.3-fix-include.patch b/dev-util/hip/files/rocclr-5.3.3-fix-include.patch
new file mode 100644
index 000000000000..e014fe374bec
--- /dev/null
+++ b/dev-util/hip/files/rocclr-5.3.3-fix-include.patch
@@ -0,0 +1,218 @@
+For https://bugs.gentoo.org/893602
+==================================
+From 197ea6f76f34e0b3c8ab46d96c2fa5014e467e37 Mon Sep 17 00:00:00 2001
+From: Maneesh Gupta <maneesh.gupta@amd.com>
+Date: Fri, 5 Aug 2022 05:42:39 +0000
+Subject: [PATCH] SWDEV-350289 - Fix build warnings due to file re-org
+
+Change-Id: I0066fa163b9f25fdde4c5b3baed1ef0654390c06
+---
+ device/comgrctx.hpp | 2 +-
+ device/devkernel.hpp | 2 +-
+ device/devprogram.hpp | 2 +-
+ device/rocm/pro/prodevice.cpp | 2 +-
+ device/rocm/pro/prodriver.hpp | 2 +-
+ device/rocm/roccounters.hpp | 2 +-
+ device/rocm/rocdevice.hpp | 8 ++++----
+ device/rocm/rocglinterop.hpp | 2 +-
+ device/rocm/rockernel.cpp | 2 +-
+ device/rocm/rocprogram.cpp | 2 +-
+ device/rocm/rocsignal.hpp | 4 ++--
+ device/rocm/rocvirtual.cpp | 4 ++--
+ device/rocm/rocvirtual.hpp | 8 ++++----
+ 13 files changed, 21 insertions(+), 21 deletions(-)
+
+diff --git a/device/comgrctx.hpp b/device/comgrctx.hpp
+index d69506e2..31ee24e1 100644
+--- a/device/comgrctx.hpp
++++ b/device/comgrctx.hpp
+@@ -23,7 +23,7 @@
+ #include <mutex>
+ #if defined(USE_COMGR_LIBRARY)
+ #include "top.hpp"
+-#include "amd_comgr.h"
++#include "amd_comgr/amd_comgr.h"
+
+ namespace amd {
+ typedef void (*t_amd_comgr_get_version)(size_t *major, size_t *minor);
+diff --git a/device/devkernel.hpp b/device/devkernel.hpp
+index 19b3212d..b256abf3 100644
+--- a/device/devkernel.hpp
++++ b/device/devkernel.hpp
+@@ -105,7 +105,7 @@ struct RuntimeHandle {
+ uint32_t group_segment_size; //!< From GROUP_SEGMENT_FIXED_SIZE
+ };
+
+-#include "amd_comgr.h"
++#include "amd_comgr/amd_comgr.h"
+
+ // for Code Object V3
+ enum class ArgField : uint8_t {
+diff --git a/device/devprogram.hpp b/device/devprogram.hpp
+index 099d6a37..741d81b0 100644
+--- a/device/devprogram.hpp
++++ b/device/devprogram.hpp
+@@ -29,7 +29,7 @@
+ #include "devwavelimiter.hpp"
+
+ #if defined(USE_COMGR_LIBRARY)
+-#include "amd_comgr.h"
++#include "amd_comgr/amd_comgr.h"
+ #endif // defined(USE_COMGR_LIBRARY)
+
+ namespace amd {
+diff --git a/device/rocm/pro/prodevice.cpp b/device/rocm/pro/prodevice.cpp
+index a0e49461..1e366cd2 100644
+--- a/device/rocm/pro/prodevice.cpp
++++ b/device/rocm/pro/prodevice.cpp
+@@ -20,7 +20,7 @@
+
+ #ifndef WITHOUT_HSA_BACKEND
+
+-#include "hsa_ext_amd.h"
++#include "hsa/hsa_ext_amd.h"
+ #include "lnxheaders.h"
+ #include "prodevice.hpp"
+ #include "amdgpu_drm.h"
+diff --git a/device/rocm/pro/prodriver.hpp b/device/rocm/pro/prodriver.hpp
+index bc420697..819ade27 100644
+--- a/device/rocm/pro/prodriver.hpp
++++ b/device/rocm/pro/prodriver.hpp
+@@ -23,7 +23,7 @@
+ #ifndef WITHOUT_HSA_BACKEND
+
+ #include "top.hpp"
+-#include "hsa.h"
++#include "hsa/hsa.h"
+
+ /*! \addtogroup HSA
+ * @{
+diff --git a/device/rocm/roccounters.hpp b/device/rocm/roccounters.hpp
+index ffc9fad0..45ebbe66 100644
+--- a/device/rocm/roccounters.hpp
++++ b/device/rocm/roccounters.hpp
+@@ -24,7 +24,7 @@
+ #include "top.hpp"
+ #include "device/device.hpp"
+ #include "device/rocm/rocdevice.hpp"
+-#include "hsa_ven_amd_aqlprofile.h"
++#include "hsa/hsa_ven_amd_aqlprofile.h"
+
+ namespace roc {
+
+diff --git a/device/rocm/rocdevice.hpp b/device/rocm/rocdevice.hpp
+index d8cb4c6c..44339bb9 100644
+--- a/device/rocm/rocdevice.hpp
++++ b/device/rocm/rocdevice.hpp
+@@ -40,10 +40,10 @@
+ #include "device/rocm/rocprintf.hpp"
+ #include "device/rocm/rocglinterop.hpp"
+
+-#include "hsa.h"
+-#include "hsa_ext_image.h"
+-#include "hsa_ext_amd.h"
+-#include "hsa_ven_amd_loader.h"
++#include "hsa/hsa.h"
++#include "hsa/hsa_ext_image.h"
++#include "hsa/hsa_ext_amd.h"
++#include "hsa/hsa_ven_amd_loader.h"
+
+ #include <atomic>
+ #include <iostream>
+diff --git a/device/rocm/rocglinterop.hpp b/device/rocm/rocglinterop.hpp
+index a539cc6f..588d8a6f 100644
+--- a/device/rocm/rocglinterop.hpp
++++ b/device/rocm/rocglinterop.hpp
+@@ -34,7 +34,7 @@ typedef __GLXcontextRec* GLXContext;
+
+ #include "device/rocm/mesa_glinterop.h"
+ #include "device/rocm/rocregisters.hpp"
+-#include "hsa_ext_amd.h"
++#include "hsa/hsa_ext_amd.h"
+
+ namespace roc {
+
+diff --git a/device/rocm/rockernel.cpp b/device/rocm/rockernel.cpp
+index 76ab76ad..5624c877 100644
+--- a/device/rocm/rockernel.cpp
++++ b/device/rocm/rockernel.cpp
+@@ -19,7 +19,7 @@
+ THE SOFTWARE. */
+
+ #include "rockernel.hpp"
+-#include "amd_hsa_kernel_code.h"
++#include "hsa/amd_hsa_kernel_code.h"
+
+ #include <algorithm>
+
+diff --git a/device/rocm/rocprogram.cpp b/device/rocm/rocprogram.cpp
+index e4559645..4f77026d 100644
+--- a/device/rocm/rocprogram.cpp
++++ b/device/rocm/rocprogram.cpp
+@@ -25,7 +25,7 @@
+ #include "utils/options.hpp"
+ #include "rockernel.hpp"
+
+-#include "amd_hsa_kernel_code.h"
++#include "hsa/amd_hsa_kernel_code.h"
+
+ #include <string>
+ #include <vector>
+diff --git a/device/rocm/rocsignal.hpp b/device/rocm/rocsignal.hpp
+index 3e8c1e6e..fff310d5 100644
+--- a/device/rocm/rocsignal.hpp
++++ b/device/rocm/rocsignal.hpp
+@@ -22,7 +22,7 @@
+
+ #include "device/devsignal.hpp"
+
+-#include <hsa.h>
++#include "hsa/hsa.h"
+
+ namespace roc {
+
+@@ -44,4 +44,4 @@ public:
+ }
+ };
+
+-};
+\ No newline at end of file
++};
+diff --git a/device/rocm/rocvirtual.cpp b/device/rocm/rocvirtual.cpp
+index 63b96378..1b6287e9 100644
+--- a/device/rocm/rocvirtual.cpp
++++ b/device/rocm/rocvirtual.cpp
+@@ -33,8 +33,8 @@
+ #include "platform/sampler.hpp"
+ #include "utils/debug.hpp"
+ #include "os/os.hpp"
+-#include "amd_hsa_kernel_code.h"
+-#include "amd_hsa_queue.h"
++#include "hsa/amd_hsa_kernel_code.h"
++#include "hsa/amd_hsa_queue.h"
+
+ #include <fstream>
+ #include <limits>
+diff --git a/device/rocm/rocvirtual.hpp b/device/rocm/rocvirtual.hpp
+index 6c738776..1bb0868c 100644
+--- a/device/rocm/rocvirtual.hpp
++++ b/device/rocm/rocvirtual.hpp
+@@ -24,11 +24,11 @@
+ #include "rocdefs.hpp"
+ #include "rocdevice.hpp"
+ #include "utils/util.hpp"
+-#include "hsa.h"
+-#include "hsa_ext_image.h"
+-#include "hsa_ext_amd.h"
++#include "hsa/hsa.h"
++#include "hsa/hsa_ext_image.h"
++#include "hsa/hsa_ext_amd.h"
+ #include "rocprintf.hpp"
+-#include "hsa_ven_amd_aqlprofile.h"
++#include "hsa/hsa_ven_amd_aqlprofile.h"
+ #include "rocsched.hpp"
+
+ namespace roc {
+--
+2.39.1
+
diff --git a/dev-util/hip/hip-5.3.3-r3.ebuild b/dev-util/hip/hip-5.3.3-r3.ebuild
index c11b85e3f2ec..b4f51b3ef7b0 100644
--- a/dev-util/hip/hip-5.3.3-r3.ebuild
+++ b/dev-util/hip/hip-5.3.3-r3.ebuild
@@ -101,6 +101,10 @@ src_prepare() {
sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
-e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," \
-e "s,@CLANG_PATH@,${LLVM_PREFIX}/bin," -i bin/hipvars.pm || die
+ popd || die
+
+ pushd ${CLR_S} || die
+ eapply "${FILESDIR}/rocclr-${PV}-fix-include.patch"
}
src_configure() {
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-02-01 9:53 Andreas Sturmlechner
0 siblings, 0 replies; 17+ messages in thread
From: Andreas Sturmlechner @ 2023-02-01 9:53 UTC (permalink / raw
To: gentoo-commits
commit: ca58d5dcf2f0fa62f9bcda56f1c13f89f557afac
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 24 22:21:23 2023 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Feb 1 09:52:48 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca58d5dc
dev-util/hip: drop 5.0.2-r3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-util/hip/Manifest | 6 --
dev-util/hip/files/hipvars-5.0.2.pm | 20 ------
dev-util/hip/hip-5.0.2-r3.ebuild | 138 ------------------------------------
3 files changed, 164 deletions(-)
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index b1a87a900106..91fbbb7d722a 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,16 +1,10 @@
-DIST 5.0.2-update-header.patch.gz 5136 BLAKE2B 290b9e250e3004a1147ad28606d7d205078affbd809c6a429744767ebabf35bd8df6395dc135984d345ae2f23fa457dcb2524bcbf31c5bf16903d3ee2007bf5d SHA512 41b1025c403e874026a712ec6f6571c873203b08ddadf68848f6d1f63924c21b206677b330f79edad2c4b85e2ba5053b1d33f70c7c09ff9c17bc5905b849da0c
DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a
-DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73
DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca
DIST rocclr-5.3.3.tar.gz 625944 BLAKE2B 0cdbc1415a355e1d56628834846aaa8587c9827eeea59f4312b788e868265dcb42197181fd5ef411416da2e11662c7f665f578aa750ab88c3a5405bcc58ee449 SHA512 3f85532cffc09c2ca8e7cd1770263d1c1a38633ed2bc5cfe62072e12a6f8f669db400519950718be31f6b77693d372e2ef905f06c7f02e126aa9ff7d2da97924
-DIST rocm-hip-5.0.2.tar.gz 958496 BLAKE2B 9c8bb1eacd982203e3bd6c24560672c4a9aaf5606608635d7da5a60f613d9be50998f990c1ea3e0e6f5581e0efcba09af736a77bbc9469b2898e0974d063e8d6 SHA512 4a99e86a4594c15509a1bbfec0678cd05469eb14dcf35ce650e1eb7c2415f57f59071b1b8add2f8566ccf06242bead77abd275987fe79fe6031dea90d5693805
DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24
DIST rocm-hip-5.3.3.tar.gz 1151858 BLAKE2B 5f460b2078c850b3eb4414fcec4a6f951a3b282aa9828f77ba5d5adfdc0ee8d2e62c856e112a154c340daaf7dad49f4871412edd7b38f7fae2e6b17840ee144b SHA512 e747cc10e78cd09009cac762f0e060be13f3447af7ec2a4a2889cbdc09cd76ecb1b5b58c89f09a3b45a8296c2c71e1c55baf113e58a5a12434af3de7168b8d87
-DIST rocm-hipamd-5.0.2.tar.gz 319973 BLAKE2B ca19938eeca66f0d2614ff933e1d0e75b6b8dbc8d996fd4369e5649897b9948271ac88f2a66f0a40ef586d6185b30d01132decac95d1615c1ee419996050ed07 SHA512 056acab082b5073e81f9e5de00ae12c85021d1c297cdcfc45b85f191dcc68603f64fe5d0e75f9523120657947eb125beaa9c3ce26234968c43b200e638f9afa3
DIST rocm-hipamd-5.1.3.tar.gz 331996 BLAKE2B 176121fe199d53c02a0fc407015681c2f08c8a72104738b457581fd81b37d16efb8170a46d687fb85a45242ba8564246cdd5746e78d9b73dd0bdc9b24eb8378c SHA512 daa6f4da97f71a5fd1f79d8c9e5fc43324743aec91362a05fa62e08966397a637d794abc7e14230eccf5f1271f9fac58d1336aaad1f2cded6cd10792845a494b
DIST rocm-hipamd-5.3.3.tar.gz 383179 BLAKE2B 45c4fbf28d639095db3cec0632e1b1d872104b3755bdca818ed37ac46caab399fcd2224330e6ac8df7ab155fb146b6272b3ed2efe00d7358b47f31ca2cb1e4f5 SHA512 34c62d915990b6742a2df9b37b6b2bad09f7383e561009519911095e8b65f6f1d79486f7f9b97fa76d7a9755b59fca5a5dff321d8c8b15fd83f2fd22ce08834c
-DIST rocm-opencl-runtime-5.0.2.tar.gz 1004855 BLAKE2B e2c2beb987053204fbe8fda562ae65d6c1a58447e9e88bf1081aabeee6c9a10738fd8562114b564b647682438fdbd2c535db1008ac6e1cc4eb9a915998eeb3c7 SHA512 fa01d1fafc890181b9e67070353ee7c9100619494b7509cae1a3659f24ef1d00f650024cb24bdb0e6e7eacfdec1115e4683ec6f320228a19f41ae83321780780
DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa666785699f6b4ec0584a927904a94bf830883050943503f8bdd7c97438a2fb11c71686a330d526f633959916c5c6c8da2e037841e79 SHA512 b83c3ae0bfad80f867bacce36710a8964f6dd7e64bf50da3ec6ce842217d6de63299d9ceaab9dc25a22252484520a85d02859809463dad5dda9b1f00a86863e0
DIST rocm-opencl-runtime-5.3.3.tar.gz 1007773 BLAKE2B a3f600a68183337f92b152a123241cb7025889cca2ef6814d9d5b5a2146a78703b171d20bcb432bc7a2cdd1f24ad349408c17816b25a66702e9f0f5345af9082 SHA512 391f0f244b7f02972df8cada821e69ee8d81d96b9cff3c14f1d0838da583d8fb136ec4bd5ee820f6dd261968e9eef5e9a5b10b7bb76b1b64625c399d79bcb03f
-DIST rocm-tracer-5.0.2.tar.gz 474669 BLAKE2B b350111590140e1282338e4f134caf6228677c49361ceb9bc7ba0da8709346daa4fd014644c04adff0e903dba6014a84edd2eb3a5c132a8f91b479e4d5b085e5 SHA512 3fc1449cc9c9bf83e5233a7a0e83c0e3fa9da225d5ee4427b7d6fa15e3580497e1b9fbcd63892e4a99df01582aecd3ccfd66d2a19af2d8c25949ee705894ea44
DIST rocm-tracer-5.1.3.tar.gz 511617 BLAKE2B 4142979b3b7d649798a7ac0b2a04b42aa7fbcbf82f2cf51b0e5363ec0da538046d6e59283d0ce1bfd341317bf24ac2f694d5c8a7d1f132f9b21caea5caf7eda3 SHA512 e73b0c921ffbdcac571d8b0825de39bd8a4fd5f2720ecdd0c189951db85efb607a0b1cd7a9bb02b3dbf329b277cb5e197525216a8e8927eea4e6ce290b7e7c7b
diff --git a/dev-util/hip/files/hipvars-5.0.2.pm b/dev-util/hip/files/hipvars-5.0.2.pm
deleted file mode 100644
index 88d3c27bab99..000000000000
--- a/dev-util/hip/files/hipvars-5.0.2.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/perl -w
-package hipvars;
-
-$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@";
-$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@";
-
-$isWindows = 0;
-$HIP_PATH='/usr';
-$ROCM_PATH='/usr';
-$CUDA_PATH='/opt/cuda';
-$HSA_PATH='/usr';
-$HIP_CLANG_PATH='/usr/lib/llvm/roc/bin';
-$HIP_ROCCLR_HOME=$HIP_PATH;
-$HIP_PLATFORM='amd';
-$HIP_COMPILER = "clang";
-$HIP_RUNTIME = "rocclr";
-$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR;
-$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR;
-$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@";
-$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
diff --git a/dev-util/hip/hip-5.0.2-r3.ebuild b/dev-util/hip/hip-5.0.2-r3.ebuild
deleted file mode 100644
index cf695cc6f6fc..000000000000
--- a/dev-util/hip/hip-5.0.2-r3.ebuild
+++ /dev/null
@@ -1,138 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..11} )
-
-inherit cmake prefix python-any-r1
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
-SRC_URI="https://github.com/ROCm-Developer-Tools/hipamd/archive/rocm-${PV}.tar.gz -> rocm-hipamd-${PV}.tar.gz
- https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
- https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz
- https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz
- profile? ( https://github.com/ROCm-Developer-Tools/roctracer/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz
- https://github.com/ROCm-Developer-Tools/hipamd/files/8311148/hip_prof_str_diff.gz -> ${PV}-update-header.patch.gz
- )"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-DEPEND="
- dev-util/rocminfo:${SLOT}
- =sys-devel/llvm-roc-${PV}*[runtime]
- dev-libs/rocm-comgr:${SLOT}
- virtual/opengl
-"
-RDEPEND="${DEPEND}
- dev-perl/URI-Encode
- dev-libs/roct-thunk-interface:${SLOT}"
-BDEPEND="profile? ( $(python_gen_any_dep '
- dev-python/CppHeaderParser[${PYTHON_USEDEP}]
- ') )
-"
-
-PATCHES=(
- "${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
- "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
- "${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
- "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
- "${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
-)
-
-python_check_deps() {
- if use profile; then
- python_has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]"
- fi
-}
-
-S="${WORKDIR}/hipamd-rocm-${PV}"
-HIP_S="${WORKDIR}"/HIP-rocm-${PV}
-OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
-CLR_S="${WORKDIR}"/ROCclr-rocm-${PV}
-RTC_S="${WORKDIR}"/roctracer-rocm-${PV}
-
-src_prepare() {
- cmake_src_prepare
- use profile && eapply "${WORKDIR}/${PV}-update-header.patch"
-
- eapply_user
-
- # Use Gentoo slot number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # correct libs and cmake install dir
- sed -e "/LIB_INSTALL_DIR/s:PREFIX}/lib:PREFIX}/$(get_libdir):" \
- -e "/\${HIP_COMMON_DIR}/s:cmake DESTINATION .):cmake/ DESTINATION share/cmake/Modules):" -i CMakeLists.txt || die
- sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die
-
- cd ${HIP_S} || die
- eapply "${FILESDIR}/${PN}-5.0.2-correct-ldflag.patch"
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -e "s:\$ENV{'HIP_LIB_PATH'}:'/usr/$(get_libdir)':" \
- -e "/rpath/s,--rpath=[^ ]*,," \
- -i bin/hipcc.pl || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${HIP_S}")
-
- cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.0.2.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm"
- sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
- -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
-}
-
-src_configure() {
- use debug && CMAKE_BUILD_TYPE="Debug"
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=amd
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DPROF_API_HEADER_PATH="${RTC_S}"/inc/ext
- -DROCCLR_PATH=${CLR_S}
- -DHIP_COMMON_DIR=${HIP_S}
- -DAMD_OPENCL_PATH=${OCL_S}
- )
-
- cmake_src_configure
-}
-
-src_install() {
-
- cmake_src_install
-
- rm "${ED}/usr/include/hip/hcc_detail" || die
-
- # Don't install .hipInfo and .hipVersion to bin/lib
- rm "${ED}/usr/lib/.hipInfo" "${ED}/usr/bin/.hipVersion" || die
-}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-01-31 13:32 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2023-01-31 13:32 UTC (permalink / raw
To: gentoo-commits
commit: 7c334e7ba3bc8c4acaad5d94fe1e248eb1a9db0a
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Wed Jan 25 03:17:30 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Jan 31 13:31:02 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c334e7b
dev-util/hip: bump patch "remove-cmake-doxygen-commands"
Closes: https://bugs.gentoo.org/887375
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
.../hip-5.3.3-remove-cmake-doxygen-commands.patch | 21 +++++++++++++++++++++
dev-util/hip/hip-5.3.3-r2.ebuild | 1 +
2 files changed, 22 insertions(+)
diff --git a/dev-util/hip/files/hip-5.3.3-remove-cmake-doxygen-commands.patch b/dev-util/hip/files/hip-5.3.3-remove-cmake-doxygen-commands.patch
new file mode 100644
index 000000000000..c4cd955bed90
--- /dev/null
+++ b/dev-util/hip/files/hip-5.3.3-remove-cmake-doxygen-commands.patch
@@ -0,0 +1,21 @@
+Index: hipamd-rocm-5.3.3/packaging/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.3.3.orig/packaging/CMakeLists.txt
++++ hipamd-rocm-5.3.3/packaging/CMakeLists.txt
+@@ -94,16 +94,6 @@ install(FILES ${CMAKE_BINARY_DIR}/.hipVe
+ install(DIRECTORY ${HIP_COMMON_DIR}/cmake/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/hip COMPONENT dev)
+ #End dev files install
+
+-#Begin doc files install
+-find_program(DOXYGEN_EXE doxygen)
+-if(DOXYGEN_EXE)
+- add_custom_target(build_doxygen ALL
+- COMMAND HIP_PATH=${HIP_COMMON_DIR} doxygen ${HIP_COMMON_DIR}/docs/doxygen-input/doxy.cfg)
+- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/RuntimeAPI/html
+- DESTINATION ${CMAKE_INSTALL_DOCDIR}/RuntimeAPI COMPONENT doc)
+-endif()
+-#End doc files install
+-
+ #Begin samples files install
+ install(DIRECTORY ${HIP_COMMON_DIR}/samples DESTINATION ${CMAKE_INSTALL_DATADIR}/hip COMPONENT samples)
+ #End samples files install
diff --git a/dev-util/hip/hip-5.3.3-r2.ebuild b/dev-util/hip/hip-5.3.3-r2.ebuild
index b842e9362711..23778ce69cb9 100644
--- a/dev-util/hip/hip-5.3.3-r2.ebuild
+++ b/dev-util/hip/hip-5.3.3-r2.ebuild
@@ -46,6 +46,7 @@ PATCHES=(
"${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
"${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
+ "${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
)
python_check_deps() {
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-01-31 13:32 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2023-01-31 13:32 UTC (permalink / raw
To: gentoo-commits
commit: 02e622b72fd4770f699859a7b6433ea8a92c648a
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Wed Jan 25 04:12:24 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Jan 31 13:31:33 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02e622b7
dev-util/hip: remove -Werror added by src/CMakeLists.txt
Closes: https://bugs.gentoo.org/887383
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
dev-util/hip/files/hip-5.3.3-disable-Werror.patch | 16 ++++++++++++++++
dev-util/hip/hip-5.3.3-r2.ebuild | 1 +
2 files changed, 17 insertions(+)
diff --git a/dev-util/hip/files/hip-5.3.3-disable-Werror.patch b/dev-util/hip/files/hip-5.3.3-disable-Werror.patch
new file mode 100644
index 000000000000..bed46bd144f4
--- /dev/null
+++ b/dev-util/hip/files/hip-5.3.3-disable-Werror.patch
@@ -0,0 +1,16 @@
+Index: hipamd-rocm-5.3.3/src/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.3.3.orig/src/CMakeLists.txt
++++ hipamd-rocm-5.3.3/src/CMakeLists.txt
+@@ -44,11 +44,6 @@ if(ADDRESS_SANITIZER)
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ASAN_LINKER_FLAGS} -Wl,--build-id=sha1")
+ endif()
+
+-if(CMAKE_COMPILER_IS_GNUCC)
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+-endif()
+-
+ option(DISABLE_DIRECT_DISPATCH "Disable Direct Dispatch" OFF)
+
+ option(BUILD_SHARED_LIBS "Build the shared library" ON)
diff --git a/dev-util/hip/hip-5.3.3-r2.ebuild b/dev-util/hip/hip-5.3.3-r2.ebuild
index 94f21e6e965b..8d41b2af630f 100644
--- a/dev-util/hip/hip-5.3.3-r2.ebuild
+++ b/dev-util/hip/hip-5.3.3-r2.ebuild
@@ -39,6 +39,7 @@ PATCHES=(
"${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
"${FILESDIR}/${PN}-5.3.3-remove-cmake-doxygen-commands.patch"
+ "${FILESDIR}/${PN}-5.3.3-disable-Werror.patch"
"${FILESDIR}/0001-SWDEV-352878-LLVM-pkg-search-directly-using-find_dep.patch"
)
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2023-01-21 3:32 Sam James
0 siblings, 0 replies; 17+ messages in thread
From: Sam James @ 2023-01-21 3:32 UTC (permalink / raw
To: gentoo-commits
commit: bb6386121107a5a6f108a429e6042a237e07e371
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Fri Jan 20 10:12:16 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 21 03:32:16 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb638612
dev-util/hip: append -fno-stack-protector for hipcc
Closes: https://bugs.gentoo.org/890377
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/29188
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch | 16 ++++++++++++++++
.../hip/{hip-5.1.3-r2.ebuild => hip-5.1.3-r3.ebuild} | 1 +
dev-util/hip/{hip-5.3.3.ebuild => hip-5.3.3-r1.ebuild} | 1 +
3 files changed, 18 insertions(+)
diff --git a/dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch b/dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch
new file mode 100644
index 000000000000..c5957edba734
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch
@@ -0,0 +1,16 @@
+Since 1e9b3a08b9243daae1bebd6bac3da939d924df1f /etc/clang/gentoo-hardened.cfg
+has -fstack-protector-strong which may cause build issues for HIP programs (bug
+#890377) Disable this by adding -fno-stack-protector into c/cxx flags in hipcc.
+===================================================================
+--- HIP-rocm-5.3.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.3.3/bin/hipcc.pl
+@@ -687,6 +687,9 @@ if ($rdc and !$compileOnly and $HIP_PLAT
+ # pass-through CPP mode.
+
+ if ($HIP_PLATFORM eq "amd") {
++ # Append -fno-stack-protector due to stack protection for HIP is not supported
++ $HIPCXXFLAGS .= " -fno-stack-protector";
++ $HIPCFLAGS .= " -fno-stack-protector";
+ # Set default optimization level to -O3 for hip-clang.
+ if ($optArg eq "") {
+ $HIPCXXFLAGS .= " -O3";
diff --git a/dev-util/hip/hip-5.1.3-r2.ebuild b/dev-util/hip/hip-5.1.3-r3.ebuild
similarity index 99%
rename from dev-util/hip/hip-5.1.3-r2.ebuild
rename to dev-util/hip/hip-5.1.3-r3.ebuild
index 34d925ed2342..56090c5077df 100644
--- a/dev-util/hip/hip-5.1.3-r2.ebuild
+++ b/dev-util/hip/hip-5.1.3-r3.ebuild
@@ -100,6 +100,7 @@ src_prepare() {
eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch"
eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
eapply "${FILESDIR}/${PN}-5.0.2-correct-ldflag.patch"
+ eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
diff --git a/dev-util/hip/hip-5.3.3.ebuild b/dev-util/hip/hip-5.3.3-r1.ebuild
similarity index 98%
rename from dev-util/hip/hip-5.3.3.ebuild
rename to dev-util/hip/hip-5.3.3-r1.ebuild
index 7ec79ed705eb..07b7709afbc2 100644
--- a/dev-util/hip/hip-5.3.3.ebuild
+++ b/dev-util/hip/hip-5.3.3-r1.ebuild
@@ -92,6 +92,7 @@ src_prepare() {
pushd ${HIP_S} || die
eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch"
eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
+ eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2022-12-19 14:00 Andreas Sturmlechner
0 siblings, 0 replies; 17+ messages in thread
From: Andreas Sturmlechner @ 2022-12-19 14:00 UTC (permalink / raw
To: gentoo-commits
commit: 6a3c76e5a7d7f1519b5a943e3ae725c127f2675d
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 18 12:15:19 2022 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 19 14:00:01 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a3c76e5
dev-util/hip: drop versions 3* and 4*
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-util/hip/Manifest | 5 -
dev-util/hip/files/hip-3.5.1-config-cmake-in.patch | 28 -----
...p-3.5.1-detect_offload-arch_for_clang-roc.patch | 21 ----
.../hip/files/hip-3.5.1-hip_vector_types.patch | 10 --
dev-util/hip/files/hip-3.9.0-DisableTest.patch | 87 ----------------
.../files/hip-3.9.0-add-include-directories.patch | 13 ---
.../hip/files/hip-3.9.0-lpl_ca-add-include.patch | 10 --
dev-util/hip/files/hip-4.1.0-DisableTest.patch | 37 -------
.../hip/files/hip-4.3.0-hip_vector_types.patch | 11 --
dev-util/hip/hip-4.0.0-r1.ebuild | 116 ---------------------
dev-util/hip/hip-4.0.0.ebuild | 107 -------------------
dev-util/hip/hip-4.1.0-r1.ebuild | 105 -------------------
dev-util/hip/hip-4.1.0.ebuild | 109 -------------------
dev-util/hip/hip-4.2.0.ebuild | 108 -------------------
dev-util/hip/hip-4.3.0-r1.ebuild | 108 -------------------
dev-util/hip/hip-4.3.0-r2.ebuild | 112 --------------------
dev-util/hip/hip-4.3.0.ebuild | 107 -------------------
17 files changed, 1094 deletions(-)
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index de73421d0c04..48b4b11a54db 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -2,15 +2,10 @@ DIST 5.0.2-update-header.patch.gz 5136 BLAKE2B 290b9e250e3004a1147ad28606d7d2050
DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a
DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73
DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca
-DIST rocm-hip-4.0.0.tar.gz 1012154 BLAKE2B 02343239a5b27c42dafd241f2c9b6f5195c50f78bfd717ae72bcb16d384bd6cf97ff6f2b86bfcf323aaaf022d6897f46d0987826c80d6f6279be4cb4792e15be SHA512 cf840dbe28a9a15e3be14351bfa22d3c81e1654813a7aee55f53e71b2ee183f8dd0de14a79791617fabb5b357cadbf2ce2f476f78884b2843d30f206d65088f6
-DIST rocm-hip-4.1.0.tar.gz 954215 BLAKE2B c4b75ab2158e6921be1c34820ab5d1a5e2eb36112834b0143c50023caa27de384e0497f4837947cc7fe05554c6c95201340b1979eb916b31ebb4ffec8c923735 SHA512 420ffd7b79e2b4506873cbfc56e96395f8ed9d9375ce28df51626601199d4d8dca6920528e255d39a48ad66ee11f4b653f3b9f659df489d32b21886fb86c64b5
-DIST rocm-hip-4.2.0.tar.gz 918281 BLAKE2B 45c28289c8ff9e600bfd9daff8af162c897fcfdf41ce65d91d1761d58253d87a6385fd4a15e818619ca39d3413479bf043ab2758fead349a243105e979b64f7c SHA512 e620507321c949ded2eab6159099eef0eab267eb686b6ee0ed86022fffaa51fb8714a7f344b79acf76c876c55919360905d1bb3a7c00a87f40174774d6682ce8
-DIST rocm-hip-4.3.0.tar.gz 967550 BLAKE2B 263e8bbaa86198d3cb6a29f5597b56a3fe1e9338a8c485935070e6253816ccdba9671f33d8142c260aa3c36f43a71de7f2c1b7a15e1227f97aaf03ed10ce10dd SHA512 bc2d9597200405397387cc8f626f0cc734ee450c462bd7c7a0c655e3dfe2d1e09780328cbfa1c0d1e0db836e561fc450c5d514a6ad1a5828cb913c4c3c535ef1
DIST rocm-hip-5.0.2.tar.gz 958496 BLAKE2B 9c8bb1eacd982203e3bd6c24560672c4a9aaf5606608635d7da5a60f613d9be50998f990c1ea3e0e6f5581e0efcba09af736a77bbc9469b2898e0974d063e8d6 SHA512 4a99e86a4594c15509a1bbfec0678cd05469eb14dcf35ce650e1eb7c2415f57f59071b1b8add2f8566ccf06242bead77abd275987fe79fe6031dea90d5693805
DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24
DIST rocm-hipamd-5.0.2.tar.gz 319973 BLAKE2B ca19938eeca66f0d2614ff933e1d0e75b6b8dbc8d996fd4369e5649897b9948271ac88f2a66f0a40ef586d6185b30d01132decac95d1615c1ee419996050ed07 SHA512 056acab082b5073e81f9e5de00ae12c85021d1c297cdcfc45b85f191dcc68603f64fe5d0e75f9523120657947eb125beaa9c3ce26234968c43b200e638f9afa3
DIST rocm-hipamd-5.1.3.tar.gz 331996 BLAKE2B 176121fe199d53c02a0fc407015681c2f08c8a72104738b457581fd81b37d16efb8170a46d687fb85a45242ba8564246cdd5746e78d9b73dd0bdc9b24eb8378c SHA512 daa6f4da97f71a5fd1f79d8c9e5fc43324743aec91362a05fa62e08966397a637d794abc7e14230eccf5f1271f9fac58d1336aaad1f2cded6cd10792845a494b
-DIST rocm-opencl-runtime-4.3.0.tar.gz 1006792 BLAKE2B 29fd5843bb0153c7d3fe5250898f0fbdd089db6304122698c9ec9a5436e3a6845916f241f1a1e79a614e369f000297ac12413620edec0660d859ccddaa978d07 SHA512 a514d626700350f2c663db468427479eaa9e39dd912266ac2db6830d712351ffbc18737b208fd37f7ab5afdc2c9f6412d8d765973d6c72759bf51f864fc6bf1d
DIST rocm-opencl-runtime-5.0.2.tar.gz 1004855 BLAKE2B e2c2beb987053204fbe8fda562ae65d6c1a58447e9e88bf1081aabeee6c9a10738fd8562114b564b647682438fdbd2c535db1008ac6e1cc4eb9a915998eeb3c7 SHA512 fa01d1fafc890181b9e67070353ee7c9100619494b7509cae1a3659f24ef1d00f650024cb24bdb0e6e7eacfdec1115e4683ec6f320228a19f41ae83321780780
DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa666785699f6b4ec0584a927904a94bf830883050943503f8bdd7c97438a2fb11c71686a330d526f633959916c5c6c8da2e037841e79 SHA512 b83c3ae0bfad80f867bacce36710a8964f6dd7e64bf50da3ec6ce842217d6de63299d9ceaab9dc25a22252484520a85d02859809463dad5dda9b1f00a86863e0
DIST rocm-tracer-5.0.2.tar.gz 474669 BLAKE2B b350111590140e1282338e4f134caf6228677c49361ceb9bc7ba0da8709346daa4fd014644c04adff0e903dba6014a84edd2eb3a5c132a8f91b479e4d5b085e5 SHA512 3fc1449cc9c9bf83e5233a7a0e83c0e3fa9da225d5ee4427b7d6fa15e3580497e1b9fbcd63892e4a99df01582aecd3ccfd66d2a19af2d8c25949ee705894ea44
diff --git a/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch b/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch
deleted file mode 100644
index f3b5ac9c19ef..000000000000
--- a/dev-util/hip/files/hip-3.5.1-config-cmake-in.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/hip-config.cmake.in 2020-06-21 21:17:35.576297760 +0200
-+++ b/hip-config.cmake.in 2020-06-21 21:17:59.861296628 +0200
-@@ -123,8 +123,10 @@
- )
- set_target_properties(hip::device PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "__HIP_ROCclr__=1"
-- INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
-- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
-+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
-+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
-+# INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
-+# INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../include"
- )
- else()
- set_target_properties(hip::hip_hcc_static PROPERTIES
-@@ -156,9 +158,9 @@
- INTERFACE_LINK_LIBRARIES --hip-device-lib-path=${AMD_DEVICE_LIBS_PREFIX}/lib --hip-link
- )
-
-- set_property(TARGET hip::device APPEND PROPERTY
-- INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
-- )
-+# set_property(TARGET hip::device APPEND PROPERTY
-+# INTERFACE_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
-+# )
-
- set_property(TARGET hip::device APPEND PROPERTY
- INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${HIP_CLANG_INCLUDE_PATH}/.."
diff --git a/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch b/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch
deleted file mode 100644
index 7997e2929666..000000000000
--- a/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -uprN HIP-rocm-3.5.1/bin/hipcc patched/bin/hipcc
---- HIP-rocm-3.5.1/bin/hipcc 2020-07-21 14:29:11.625878447 +0800
-+++ patched/bin/hipcc 2020-07-21 14:34:11.454395203 +0800
-@@ -675,7 +675,7 @@ foreach $arg (@ARGV)
- $prevArg = $arg;
- }
-
--if($HIP_PLATFORM eq "hcc"){
-+if($HIP_PLATFORM eq "hcc" || $HIP_PLATFORM eq "rocclr"){
- # No AMDGPU target specified at commandline. So look for HCC_AMDGPU_TARGET
- if($default_amdgpu_target eq 1) {
- if (defined $ENV{HCC_AMDGPU_TARGET}) {
-@@ -694,6 +694,8 @@ if($HIP_PLATFORM eq "hcc"){
-
- if($HIP_COMPILER eq "hcc") {
- $GPU_ARCH_OPT = " --amdgpu-target=";
-+ } elsif($HIP_COMPILER eq "clang") {
-+ $GPU_ARCH_OPT = " --offload-arch=";
- } else {
- $GPU_ARCH_OPT = " --cuda-gpu-arch=";
- }
diff --git a/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch b/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch
deleted file mode 100644
index 382ed52f6923..000000000000
--- a/dev-util/hip/files/hip-3.5.1-hip_vector_types.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/include/hip/hcc_detail/hip_vector_types.h
-+++ b/include/hip/hcc_detail/hip_vector_types.h
-@@ -42,6 +42,7 @@
- #endif
-
- #if defined(__cplusplus)
-+ #include <new>
- #include <array>
- #include <iosfwd>
- #include <type_traits>
diff --git a/dev-util/hip/files/hip-3.9.0-DisableTest.patch b/dev-util/hip/files/hip-3.9.0-DisableTest.patch
deleted file mode 100644
index 3fc787a7354e..000000000000
--- a/dev-util/hip/files/hip-3.9.0-DisableTest.patch
+++ /dev/null
@@ -1,87 +0,0 @@
---- a/CMakeLists.txt 2020-11-15 11:26:09.747793881 +0100
-+++ b/CMakeLists.txt 2020-11-15 11:28:45.289793287 +0100
-@@ -676,45 +676,45 @@
- # Target: test
- set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR})
- set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
--if(HIP_PLATFORM STREQUAL "nvcc")
-- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
--endif()
--execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
--if(${RUN_HIT} EQUAL 0)
-- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
--endif()
--if(${RUN_HIT} EQUAL 0)
-- set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
-- include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
--
-- # Add tests
-- include_directories(${HIP_SRC_PATH}/tests/src)
-- hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/src "directed_tests")
--
-- # Add unit tests
-- include_directories(${HIP_SRC_PATH}/tests/unit)
-- hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/unit "unit_tests")
--
-- # Add performance tests
-- include_directories(${HIP_SRC_PATH}/tests/performance)
-- hit_add_directory_recursive(${HIP_CTEST_CONFIG_PERFORMANCE} ${HIP_SRC_PATH}/tests/performance "performance_tests")
--
-- # Add top-level tests to build_tests
-- add_custom_target(build_tests DEPENDS directed_tests unit_tests)
--
-- # Add top-level tests to build performance_tests.
-- # To build performance tests, just run "make build_perf"
-- add_custom_target(build_perf DEPENDS performance_tests)
--
-- # Add custom target: perf.
-- # To run performance tests, just run "make perf"
-- add_custom_target(perf COMMAND "${CMAKE_CTEST_COMMAND}" -C "${HIP_CTEST_CONFIG_PERFORMANCE}" -R "performance_tests/" --verbose)
--
-- # Add custom target: check
-- add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests)
--else()
-- message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
--endif()
-+#if(HIP_PLATFORM STREQUAL "nvcc")
-+# execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${CMAKE_CURRENT_BINARY_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-+#endif()
-+#execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-+#if(${RUN_HIT} EQUAL 0)
-+# execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-+#endif()
-+#if(${RUN_HIT} EQUAL 0)
-+# set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
-+# include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
-+#
-+# # Add tests
-+# include_directories(${HIP_SRC_PATH}/tests/src)
-+# hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/src "directed_tests")
-+#
-+# # Add unit tests
-+# include_directories(${HIP_SRC_PATH}/tests/unit)
-+# hit_add_directory_recursive(${HIP_CTEST_CONFIG_DEFAULT} ${HIP_SRC_PATH}/tests/unit "unit_tests")
-+#
-+# # Add performance tests
-+# include_directories(${HIP_SRC_PATH}/tests/performance)
-+# hit_add_directory_recursive(${HIP_CTEST_CONFIG_PERFORMANCE} ${HIP_SRC_PATH}/tests/performance "performance_tests")
-+#
-+# # Add top-level tests to build_tests
-+# add_custom_target(build_tests DEPENDS directed_tests unit_tests)
-+#
-+# # Add top-level tests to build performance_tests.
-+# # To build performance tests, just run "make build_perf"
-+# add_custom_target(build_perf DEPENDS performance_tests)
-+#
-+# # Add custom target: perf.
-+# # To run performance tests, just run "make perf"
-+# add_custom_target(perf COMMAND "${CMAKE_CTEST_COMMAND}" -C "${HIP_CTEST_CONFIG_PERFORMANCE}" -R "performance_tests/" --verbose)
-+#
-+# # Add custom target: check
-+# add_custom_target(check COMMAND "${CMAKE_COMMAND}" --build . --target test DEPENDS build_tests)
-+#else()
-+# message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
-+#endif()
-
- #############################
- # Code analysis
diff --git a/dev-util/hip/files/hip-3.9.0-add-include-directories.patch b/dev-util/hip/files/hip-3.9.0-add-include-directories.patch
deleted file mode 100644
index 42bd9736ee2c..000000000000
--- a/dev-util/hip/files/hip-3.9.0-add-include-directories.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/rocclr/CMakeLists.txt 2020-08-23 11:45:13.148817894 +0200
-+++ b/rocclr/CMakeLists.txt 2020-08-23 11:50:12.409816752 +0200
-@@ -139,6 +139,10 @@
- target_compile_definitions(hip64
- PRIVATE
- $<TARGET_PROPERTY:amdrocclr_static,INTERFACE_COMPILE_DEFINITIONS>)
-+
-+ include_directories(/usr/include/rocclr)
-+ include_directories(/usr/include/rocclr/elf)
-+ include_directories(/usr/include/rocclr/compiler/lib/include/)
- endif()
-
- # Enable profiling API
diff --git a/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch b/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch
deleted file mode 100644
index bebe6f0f4ecc..000000000000
--- a/dev-util/hip/files/hip-3.9.0-lpl_ca-add-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/lpl_ca/CMakeLists.txt 2020-11-15 11:47:55.091788901 +0100
-+++ b/lpl_ca/CMakeLists.txt 2020-11-15 11:49:14.881788597 +0100
-@@ -17,6 +17,7 @@
- ${PROJECT_SOURCE_DIR}/src
- PRIVATE
- $<TARGET_PROPERTY:amdrocclr_static,INTERFACE_INCLUDE_DIRECTORIES>)
-+target_include_directories(lpl SYSTEM PUBLIC /usr/include/rocclr/elf)
-
- target_compile_options(lpl PUBLIC -Wall)
- target_link_libraries(lpl PUBLIC pthread)
diff --git a/dev-util/hip/files/hip-4.1.0-DisableTest.patch b/dev-util/hip/files/hip-4.1.0-DisableTest.patch
deleted file mode 100644
index 49e7171b2f0d..000000000000
--- a/dev-util/hip/files/hip-4.1.0-DisableTest.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- a/CMakeLists.txt 2021-03-28 18:02:34.755857717 +0200
-+++ b/CMakeLists.txt 2021-03-28 18:04:54.217854203 +0200
-@@ -474,20 +474,20 @@
- #############################
- set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR})
- set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
--if(HIP_PLATFORM STREQUAL "nvidia")
-- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${HIP_ROOT_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
--endif()
--execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
--if(${RUN_HIT} EQUAL 0)
-- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
--endif()
--if(${RUN_HIT} EQUAL 0)
-- set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
-- include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
-- include(${HIP_SRC_PATH}/tests/Tests.cmake)
--else()
-- message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
--endif()
-+#if(HIP_PLATFORM STREQUAL "nvidia")
-+# execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${HIP_ROOT_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-+#endif()
-+#execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-+#if(${RUN_HIT} EQUAL 0)
-+# execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/bin" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
-+#endif()
-+#if(${RUN_HIT} EQUAL 0)
-+# set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
-+# include(${HIP_SRC_PATH}/tests/hit/HIT.cmake)
-+# include(${HIP_SRC_PATH}/tests/Tests.cmake)
-+#else()
-+# message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
-+#endif()
-
- #############################
- # Code analysis
diff --git a/dev-util/hip/files/hip-4.3.0-hip_vector_types.patch b/dev-util/hip/files/hip-4.3.0-hip_vector_types.patch
deleted file mode 100644
index faad9629740f..000000000000
--- a/dev-util/hip/files/hip-4.3.0-hip_vector_types.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-mitigate compilation error
---- a/include/hip/amd_detail/hip_vector_types.h
-+++ b/include/hip/amd_detail/hip_vector_types.h
-@@ -45,6 +45,7 @@ THE SOFTWARE.
-
- #if defined(__cplusplus)
- #if !defined(__HIPCC_RTC__)
-+ #include <new>
- #include <array>
- #include <iosfwd>
- #include <type_traits>
diff --git a/dev-util/hip/hip-4.0.0-r1.ebuild b/dev-util/hip/hip-4.0.0-r1.ebuild
deleted file mode 100644
index 9252cfffc779..000000000000
--- a/dev-util/hip/hip-4.0.0-r1.ebuild
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit cmake flag-o-matic prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-# Don't strip to prevent some tests from failing.
-RESTRICT="strip"
-
-DEPEND=">=dev-libs/rocclr-$(ver_cut 1-2)
- >=dev-util/rocminfo-$(ver_cut 1-2)
- =sys-devel/llvm-roc-${PV}*[runtime]"
-RDEPEND="${DEPEND}"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.9.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch"
- "${FILESDIR}/${PN}-3.5.1-hip_vector_types.patch"
- "${FILESDIR}/${PN}-3.5.1-detect_offload-arch_for_clang-roc.patch"
- "${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch"
-)
-
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-src_prepare() {
- cmake_src_prepare
- eapply_user
-
- # Use Gentoo version number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${PVR})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i "${S}/CMakeLists.txt" || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/HIP_PLATFORM.*HIP_COMPILER.*clang/s:hcc:rocclr:" \
- -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -i bin/hipcc || die
-
- # replace hcc remnants with modern rocclr.
- sed -e "/HIP_PLATFORM.*STREQUAL/s:hcc:rocclr:" -i cmake/FindHIP/run_hipcc.cmake || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-}
-
-src_configure() {
- strip-flags
- if ! use debug; then
- append-cflags "-DNDEBUG"
- append-cxxflags "-DNDEBUG"
- buildtype="Release"
- else
- buildtype="Debug"
- fi
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_RUNTIME=ROCclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "HSA_PATH=${EPREFIX}/usr" > 99hip || die
- echo "ROCM_PATH=${EPREFIX}/usr" >> 99hip || die
- echo "HIP_PLATFORM=rocclr" >> 99hip || die
- echo "HIP_RUNTIME=ROCclr" >> 99hip || die
- echo "HIP_COMPILER=clang" >> 99hip || die
- echo "HIP_CLANG_PATH=${EPREFIX}/usr/lib/llvm/roc/bin" >> 99hip || die
-
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "HIP_PATH=${EPREFIX}/usr/lib/hip" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-}
diff --git a/dev-util/hip/hip-4.0.0.ebuild b/dev-util/hip/hip-4.0.0.ebuild
deleted file mode 100644
index ae96dbdc84e7..000000000000
--- a/dev-util/hip/hip-4.0.0.ebuild
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit cmake flag-o-matic prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-# Don't strip to prevent some tests from failing.
-RESTRICT="strip"
-
-DEPEND=">=dev-libs/rocclr-$(ver_cut 1-2)
- >=dev-util/rocminfo-$(ver_cut 1-2)
- =sys-devel/llvm-roc-${PV}*[runtime]"
-RDEPEND="${DEPEND}"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.9.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch"
- "${FILESDIR}/${PN}-3.5.1-hip_vector_types.patch"
- "${FILESDIR}/${PN}-3.5.1-detect_offload-arch_for_clang-roc.patch"
- "${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch"
-)
-
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-src_prepare() {
- cmake_src_prepare
- eapply_user
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i "${S}/CMakeLists.txt" || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Due to setting HAS_PATH to "/usr", this results in setting "-isystem /usr/include"
- # which results in a e.g. "stdlib.h" not found when using "#include_next" in header files;
- sed -e "s:\$HIP_PLATFORM eq \"hcc\" and \$HIP_COMPILER eq \"clang\":\$HIP_PLATFORM eq \"rocclr\" and \$HIP_COMPILER eq \"clang\":" \
- -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -i bin/hipcc || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-}
-
-src_configure() {
- strip-flags
- if ! use debug; then
- append-cflags "-DNDEBUG"
- append-cxxflags "-DNDEBUG"
- buildtype="Release"
- else
- buildtype="Debug"
- fi
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_RUNTIME=ROCclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "HSA_PATH=${EPREFIX}/usr" > 99hip || die
- echo "ROCM_PATH=${EPREFIX}/usr" >> 99hip || die
- echo "HIP_PLATFORM=rocclr" >> 99hip || die
- echo "HIP_RUNTIME=ROCclr" >> 99hip || die
- echo "HIP_COMPILER=clang" >> 99hip || die
- echo "HIP_CLANG_PATH=${EPREFIX}/usr/lib/llvm/roc/bin" >> 99hip || die
-
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "HIP_PATH=${EPREFIX}/usr/lib/hip" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-}
diff --git a/dev-util/hip/hip-4.1.0-r1.ebuild b/dev-util/hip/hip-4.1.0-r1.ebuild
deleted file mode 100644
index 15d5bfcd3e35..000000000000
--- a/dev-util/hip/hip-4.1.0-r1.ebuild
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit cmake flag-o-matic prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-# Don't strip to prevent some tests from failing.
-RESTRICT="strip"
-
-DEPEND="dev-libs/rocclr:${SLOT}
- dev-util/rocminfo:${SLOT}
- =sys-devel/llvm-roc-${PV}*[runtime]"
-RDEPEND="${DEPEND}"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch"
- "${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch"
-)
-
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-src_prepare() {
- cmake_src_prepare
- eapply_user
-
- # Use Gentoo slot number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -i bin/hipcc || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-
- cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
- sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
- -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
-}
-
-src_configure() {
- strip-flags
- if ! use debug; then
- append-cflags "-DNDEBUG"
- append-cxxflags "-DNDEBUG"
- buildtype="Release"
- else
- buildtype="Debug"
- fi
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-}
diff --git a/dev-util/hip/hip-4.1.0.ebuild b/dev-util/hip/hip-4.1.0.ebuild
deleted file mode 100644
index c5b5027b241c..000000000000
--- a/dev-util/hip/hip-4.1.0.ebuild
+++ /dev/null
@@ -1,109 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit cmake flag-o-matic prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-# Don't strip to prevent some tests from failing.
-RESTRICT="strip"
-
-DEPEND=">=dev-libs/rocclr-$(ver_cut 1-2)
- >=dev-util/rocminfo-$(ver_cut 1-2)
- =sys-devel/llvm-roc-${PV}*[runtime]"
-RDEPEND="${DEPEND}"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-3.5.1-config-cmake-in.patch"
- "${FILESDIR}/${PN}-3.9.0-lpl_ca-add-include.patch"
-)
-
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-src_prepare() {
- cmake_src_prepare
- eapply_user
-
- # Use Gentoo version number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${PVR})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -i bin/hipcc || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-}
-
-src_configure() {
- strip-flags
- if ! use debug; then
- append-cflags "-DNDEBUG"
- append-cxxflags "-DNDEBUG"
- buildtype="Release"
- else
- buildtype="Debug"
- fi
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "HSA_PATH=${EPREFIX}/usr" > 99hip || die
- echo "ROCM_PATH=${EPREFIX}/usr" >> 99hip || die
- echo "HIP_PLATFORM=amd" >> 99hip || die
- echo "HIP_RUNTIME=rocclr" >> 99hip || die
- echo "HIP_COMPILER=clang" >> 99hip || die
- echo "HIP_CLANG_PATH=${EPREFIX}/usr/lib/llvm/roc/bin" >> 99hip || die
-
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "HIP_PATH=${EPREFIX}/usr/lib/hip" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-}
diff --git a/dev-util/hip/hip-4.2.0.ebuild b/dev-util/hip/hip-4.2.0.ebuild
deleted file mode 100644
index 20017c515343..000000000000
--- a/dev-util/hip/hip-4.2.0.ebuild
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit cmake flag-o-matic prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-# Don't strip to prevent some tests from failing.
-RESTRICT="strip"
-
-DEPEND="dev-libs/rocclr:${SLOT}
- dev-util/rocminfo:${SLOT}
- =sys-devel/llvm-roc-${PV}*[runtime]
- profile? ( dev-util/roctracer:${SLOT} )"
-RDEPEND="${DEPEND}"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
- "${FILESDIR}/${PN}-3.5.1-hip_vector_types.patch"
- "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
-)
-
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-src_prepare() {
- cmake_src_prepare
- eapply_user
-
- # Use Gentoo slot number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
- # remove forcing set USE_PROF_API to 1
- sed -e '/set(USE_PROF_API "1")/d' -i rocclr/CMakeLists.txt || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -e "/rpath/s,--rpath=[^ ]*,," \
- -i bin/hipcc || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-
- cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
- sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
- -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
-}
-
-src_configure() {
- strip-flags
- use debug && CMAKE_BUILD_TYPE="Debug"
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-
- rm "${ED}/usr/lib/hip/include/hip/hcc_detail" || die
-}
diff --git a/dev-util/hip/hip-4.3.0-r1.ebuild b/dev-util/hip/hip-4.3.0-r1.ebuild
deleted file mode 100644
index 59e92546583b..000000000000
--- a/dev-util/hip/hip-4.3.0-r1.ebuild
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit cmake flag-o-matic prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
- https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-DEPEND="dev-libs/rocclr:${SLOT}
- dev-util/rocminfo:${SLOT}
- =sys-devel/llvm-roc-${PV}*[runtime]
- profile? ( dev-util/roctracer:${SLOT} )"
-RDEPEND="${DEPEND}
- dev-perl/URI-Encode"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
- "${FILESDIR}/${PN}-4.3.0-hip_vector_types.patch"
- "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
-)
-
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-src_prepare() {
- cmake_src_prepare
- eapply_user
-
- # Use Gentoo slot number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
- # remove forcing set USE_PROF_API to 1
- sed -e '/set(USE_PROF_API "1")/d' -i rocclr/CMakeLists.txt || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -e "/rpath/s,--rpath=[^ ]*,," \
- -i bin/hipcc || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-
- cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
- sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
- -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
-
- cp -a "${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}/amdocl/cl_vk_amd.hpp amdocl/ || die
-}
-
-src_configure() {
- use debug && CMAKE_BUILD_TYPE="Debug"
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-
- rm "${ED}/usr/lib/hip/include/hip/hcc_detail" || die
-}
diff --git a/dev-util/hip/hip-4.3.0-r2.ebuild b/dev-util/hip/hip-4.3.0-r2.ebuild
deleted file mode 100644
index 9547abd69ae1..000000000000
--- a/dev-util/hip/hip-4.3.0-r2.ebuild
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-inherit cmake prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
- https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz"
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-DEPEND="
- dev-libs/rocclr:${SLOT}
- dev-util/rocminfo:${SLOT}
- dev-libs/roct-thunk-interface:${SLOT}
- =sys-devel/llvm-roc-${PV}*[runtime]
- profile? ( dev-util/roctracer:${SLOT} )"
-RDEPEND="${DEPEND}
- dev-perl/URI-Encode"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
- "${FILESDIR}/${PN}-4.3.0-hip_vector_types.patch"
- "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
-)
-
-src_prepare() {
- cmake_src_prepare
-
- # Use Gentoo slot number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
- # remove forcing set USE_PROF_API to 1
- sed -e '/set(USE_PROF_API "1")/d' -i rocclr/CMakeLists.txt || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -e "/rpath/s,--rpath=[^ ]*,," \
- -i bin/hipcc || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-
- cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
- sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
- -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
-
- cp -a "${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}/amdocl/cl_vk_amd.hpp amdocl/ || die
-
- # Bug 790164
- rm amdocl/CL/cl{,_icd,_gl,_gl_ext,_platform}.h || die
- sed -i 's/CL_EXT_SUFFIX/CL_API_SUFFIX/' amdocl/cl_icd_amd.h amdocl/CL/cl_ext.h rocclr/cl_lqdflash_amd.h || die
-}
-
-src_configure() {
- use debug && CMAKE_BUILD_TYPE="Debug"
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-
- rm "${ED}/usr/lib/hip/include/hip/hcc_detail" || die
-}
diff --git a/dev-util/hip/hip-4.3.0.ebuild b/dev-util/hip/hip-4.3.0.ebuild
deleted file mode 100644
index 7e522e9fb0e5..000000000000
--- a/dev-util/hip/hip-4.3.0.ebuild
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit cmake flag-o-matic prefix
-
-DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
-HOMEPAGE="https://github.com/ROCm-Developer-Tools/HIP"
-SRC_URI="https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
- https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz"
-
-KEYWORDS="~amd64"
-LICENSE="MIT"
-SLOT="0/$(ver_cut 1-2)"
-
-IUSE="debug profile"
-
-DEPEND="dev-libs/rocclr:${SLOT}
- dev-util/rocminfo:${SLOT}
- =sys-devel/llvm-roc-${PV}*[runtime]
- profile? ( dev-util/roctracer:${SLOT} )"
-RDEPEND="${DEPEND}"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.1.0-DisableTest.patch"
- "${FILESDIR}/${PN}-3.9.0-add-include-directories.patch"
- "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
- "${FILESDIR}/${PN}-4.3.0-hip_vector_types.patch"
- "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
-)
-
-S="${WORKDIR}/HIP-rocm-${PV}"
-
-src_prepare() {
- cmake_src_prepare
- eapply_user
-
- # Use Gentoo slot number, otherwise git hash is attempted in vain.
- sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
-
- # disable PCH, because it results in a build error in ROCm 4.0.0
- sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
-
- # remove forcing set USE_PROF_API to 1
- sed -e '/set(USE_PROF_API "1")/d' -i rocclr/CMakeLists.txt || die
-
- # "hcc" is deprecated and not installed, new platform is "rocclr";
- # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
- # which makes "stdlib.h" not found when using "#include_next" in header files;
- sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
- -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
- -e "/rpath/s,--rpath=[^ ]*,," \
- -i bin/hipcc || die
-
- # correctly find HIP_CLANG_INCLUDE_PATH using cmake
- sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
-
- # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
- sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
- -i "${S}/hip-config.cmake.in" || die
-
- einfo "prefixing hipcc and its utils..."
- hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
-
- cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
- sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
- -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
-
- cp -a "${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}/amdocl/cl_vk_amd.hpp amdocl/ || die
-}
-
-src_configure() {
- use debug && CMAKE_BUILD_TYPE="Debug"
-
- # TODO: Currently a GENTOO configuration is build,
- # this is also used in the cmake configuration files
- # which will be installed to find HIP;
- # Other ROCm packages expect a "RELEASE" configuration,
- # see "hipBLAS"
- local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_BUILD_TYPE=${buildtype}
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/hip"
- -DBUILD_HIPIFY_CLANG=OFF
- -DHIP_PLATFORM=rocclr
- -DHIP_COMPILER=clang
- -DROCM_PATH="${EPREFIX}/usr"
- -DHSA_PATH="${EPREFIX}/usr"
- -DUSE_PROF_API=$(usex profile 1 0)
- -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext
- -DROCclr_DIR="${EPREFIX}"/usr/include/rocclr
- )
-
- cmake_src_configure
-}
-
-src_install() {
- echo "PATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
- echo "LDPATH=${EPREFIX}/usr/lib/hip/lib" >> 99hip || die
- echo "ROOTPATH=${EPREFIX}/usr/lib/hip/bin" >> 99hip || die
-
- doenvd 99hip
-
- cmake_src_install
-
- rm "${ED}/usr/lib/hip/include/hip/hcc_detail" || die
-}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2022-11-19 11:50 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2022-11-19 11:50 UTC (permalink / raw
To: gentoo-commits
commit: c6db8c2f742c153f5c7dd7482a6b23e894cc84e9
Author: Jack de Kleuver <jackdekleuver <AT> gmail <DOT> com>
AuthorDate: Sat Nov 5 07:09:35 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Nov 19 11:50:41 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6db8c2f
dev-util/hip: Set LLVM version to 15
backport fix for `__noinline__` keyword
Bug: https://bugs.gentoo.org/857126
Signed-off-by: Jack de Kleuver <jackdekleuver <AT> gmail.com>
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
.../files/hip-5.1.3-llvm-15-noinline-keyword.patch | 21 +++++++++++++++++++++
.../{hip-5.1.3-r1.ebuild => hip-5.1.3-r2.ebuild} | 3 ++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dev-util/hip/files/hip-5.1.3-llvm-15-noinline-keyword.patch b/dev-util/hip/files/hip-5.1.3-llvm-15-noinline-keyword.patch
new file mode 100644
index 000000000000..de61356a5cc6
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-llvm-15-noinline-keyword.patch
@@ -0,0 +1,21 @@
+LLVM 15 adds __noinline__ as a keyword to match behaviour of GCC 12.
+
+When this macro is left in, it can cause the expression __attribute__((__noinline__)) to be expanded incorrectly.
+
+When the __noinline__ keyword is available disable the macro.
+
+Ref: https://reviews.llvm.org/D124866
+ https://bugs.gentoo.org/85712
+===================================================================
+--- a/include/hip/amd_detail/host_defines.h
++++ b/include/hip/amd_detail/host_defines.h
+@@ -47,7 +47,9 @@ THE SOFTWARE.
+ #define __constant__ __attribute__((constant))
+ #endif // !__CLANG_HIP_RUNTIME_WRAPPER_INCLUDED__
+
++#if !defined(__has_feature) || !__has_feature(cuda_noinline_keyword)
+ #define __noinline__ __attribute__((noinline))
++#endif
+ #define __forceinline__ inline __attribute__((always_inline))
+
+ #if __HIP_NO_IMAGE_SUPPORT
diff --git a/dev-util/hip/hip-5.1.3-r1.ebuild b/dev-util/hip/hip-5.1.3-r2.ebuild
similarity index 98%
rename from dev-util/hip/hip-5.1.3-r1.ebuild
rename to dev-util/hip/hip-5.1.3-r2.ebuild
index 27d78bc64fc7..6ed8327cb213 100644
--- a/dev-util/hip/hip-5.1.3-r1.ebuild
+++ b/dev-util/hip/hip-5.1.3-r2.ebuild
@@ -9,7 +9,7 @@ DOCS_DEPEND="media-gfx/graphviz"
inherit cmake docs llvm prefix python-any-r1
-LLVM_MAX_SLOT=14
+LLVM_MAX_SLOT=15
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
@@ -52,6 +52,7 @@ PATCHES=(
"${FILESDIR}/${PN}-5.1.3-correct-sample-install-location.patch"
"${FILESDIR}/${PN}-5.1.3-remove-cmake-doxygen-commands.patch"
"${FILESDIR}/0001-SWDEV-316128-HIP-surface-API-support.patch"
+ "${FILESDIR}/${PN}-5.1.3-llvm-15-noinline-keyword.patch"
)
python_check_deps() {
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2022-08-06 14:23 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2022-08-06 14:23 UTC (permalink / raw
To: gentoo-commits
commit: 82a6c2ca05ccf2dad8cbd75a813d6deafe4f105f
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Wed Jun 15 12:42:07 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Aug 6 14:22:03 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82a6c2ca
dev-util/hip: add 5.1.3
Switch from llvm-roc to vanilla clang --
New variables about clang path in hipvars.pm
hip-5.1.3-clang-include-path.patch to fix hipcc finding clang
hip-5.1.3-rocm-path.patch: add compile flag to support unpatched clang
Using sed cmd to fix clang header location in cmake
Closes: https://bugs.gentoo.org/851702
Reference: https://github.com/ROCm-Developer-Tools/hipamd/issues/18
Reference: https://github.com/ROCm-Developer-Tools/hipamd/issues/27
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
dev-util/hip/Manifest | 6 +
...0001-SWDEV-316128-HIP-surface-API-support.patch | 35 +++++
.../hip/files/hip-5.1.3-clang-include-path.patch | 12 ++
.../hip/files/hip-5.1.3-fix-hip_prof_gen.patch | 38 +++++
dev-util/hip/files/hip-5.1.3-rocm-path.patch | 13 ++
dev-util/hip/files/hipvars-5.1.3.pm | 21 +++
dev-util/hip/hip-5.1.3.ebuild | 161 +++++++++++++++++++++
7 files changed, 286 insertions(+)
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index a5655c73e1a8..de73421d0c04 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,11 +1,17 @@
DIST 5.0.2-update-header.patch.gz 5136 BLAKE2B 290b9e250e3004a1147ad28606d7d205078affbd809c6a429744767ebabf35bd8df6395dc135984d345ae2f23fa457dcb2524bcbf31c5bf16903d3ee2007bf5d SHA512 41b1025c403e874026a712ec6f6571c873203b08ddadf68848f6d1f63924c21b206677b330f79edad2c4b85e2ba5053b1d33f70c7c09ff9c17bc5905b849da0c
+DIST hip-5.1.3-update-header.patch.gz 3406 BLAKE2B 805539c3396a9cdcc4b807afd96eacd2de0e494a9ec927a1526cb8ce26b1c6e0a4d06415cd0210cba1398b5ff70f995fa67ad22b659578c075eb24c2a2cc9228 SHA512 eef4d70f9470a61d1d8cb140728cc4f2e792a4e64e0900a7410a74f3a6421410e7546e4e62bbbf35ae231b566bf162fb85de1f1ad1d8cfb2f282d2ed9a34b53a
DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73
+DIST rocclr-5.1.3.tar.gz 618606 BLAKE2B 02b7732ddd03c0883bee49c56466cd21c649159f801bfb2537eea6e640c65613eb57b37d942f465a9deb83d65735f51212dde5e4f77ba8239d1a6b7037e1800c SHA512 89fd2eca39ed84a1cf525b2c606089ef39f64c1f997c4880e10722da6de4864110752640e1508db1aeb9d15c48ba4e6fe5dbe7a9e56718853ece42548028b2ca
DIST rocm-hip-4.0.0.tar.gz 1012154 BLAKE2B 02343239a5b27c42dafd241f2c9b6f5195c50f78bfd717ae72bcb16d384bd6cf97ff6f2b86bfcf323aaaf022d6897f46d0987826c80d6f6279be4cb4792e15be SHA512 cf840dbe28a9a15e3be14351bfa22d3c81e1654813a7aee55f53e71b2ee183f8dd0de14a79791617fabb5b357cadbf2ce2f476f78884b2843d30f206d65088f6
DIST rocm-hip-4.1.0.tar.gz 954215 BLAKE2B c4b75ab2158e6921be1c34820ab5d1a5e2eb36112834b0143c50023caa27de384e0497f4837947cc7fe05554c6c95201340b1979eb916b31ebb4ffec8c923735 SHA512 420ffd7b79e2b4506873cbfc56e96395f8ed9d9375ce28df51626601199d4d8dca6920528e255d39a48ad66ee11f4b653f3b9f659df489d32b21886fb86c64b5
DIST rocm-hip-4.2.0.tar.gz 918281 BLAKE2B 45c28289c8ff9e600bfd9daff8af162c897fcfdf41ce65d91d1761d58253d87a6385fd4a15e818619ca39d3413479bf043ab2758fead349a243105e979b64f7c SHA512 e620507321c949ded2eab6159099eef0eab267eb686b6ee0ed86022fffaa51fb8714a7f344b79acf76c876c55919360905d1bb3a7c00a87f40174774d6682ce8
DIST rocm-hip-4.3.0.tar.gz 967550 BLAKE2B 263e8bbaa86198d3cb6a29f5597b56a3fe1e9338a8c485935070e6253816ccdba9671f33d8142c260aa3c36f43a71de7f2c1b7a15e1227f97aaf03ed10ce10dd SHA512 bc2d9597200405397387cc8f626f0cc734ee450c462bd7c7a0c655e3dfe2d1e09780328cbfa1c0d1e0db836e561fc450c5d514a6ad1a5828cb913c4c3c535ef1
DIST rocm-hip-5.0.2.tar.gz 958496 BLAKE2B 9c8bb1eacd982203e3bd6c24560672c4a9aaf5606608635d7da5a60f613d9be50998f990c1ea3e0e6f5581e0efcba09af736a77bbc9469b2898e0974d063e8d6 SHA512 4a99e86a4594c15509a1bbfec0678cd05469eb14dcf35ce650e1eb7c2415f57f59071b1b8add2f8566ccf06242bead77abd275987fe79fe6031dea90d5693805
+DIST rocm-hip-5.1.3.tar.gz 967696 BLAKE2B 15cb52b5934b84acf515fe9c83b7c8982e00a23e20af933bdd2c4bc5b56fd42b08c8a08e840c85d2e0a8386d5a0e9c110504f68499989de1aaad00e9a5efcf43 SHA512 6b6fd6c12d73788df1711b12326b97fc7a184f319e0db114947b7967b75f2ee131f81e42e43a4981456b507221a6013133731120409f90214e13304299ccbc24
DIST rocm-hipamd-5.0.2.tar.gz 319973 BLAKE2B ca19938eeca66f0d2614ff933e1d0e75b6b8dbc8d996fd4369e5649897b9948271ac88f2a66f0a40ef586d6185b30d01132decac95d1615c1ee419996050ed07 SHA512 056acab082b5073e81f9e5de00ae12c85021d1c297cdcfc45b85f191dcc68603f64fe5d0e75f9523120657947eb125beaa9c3ce26234968c43b200e638f9afa3
+DIST rocm-hipamd-5.1.3.tar.gz 331996 BLAKE2B 176121fe199d53c02a0fc407015681c2f08c8a72104738b457581fd81b37d16efb8170a46d687fb85a45242ba8564246cdd5746e78d9b73dd0bdc9b24eb8378c SHA512 daa6f4da97f71a5fd1f79d8c9e5fc43324743aec91362a05fa62e08966397a637d794abc7e14230eccf5f1271f9fac58d1336aaad1f2cded6cd10792845a494b
DIST rocm-opencl-runtime-4.3.0.tar.gz 1006792 BLAKE2B 29fd5843bb0153c7d3fe5250898f0fbdd089db6304122698c9ec9a5436e3a6845916f241f1a1e79a614e369f000297ac12413620edec0660d859ccddaa978d07 SHA512 a514d626700350f2c663db468427479eaa9e39dd912266ac2db6830d712351ffbc18737b208fd37f7ab5afdc2c9f6412d8d765973d6c72759bf51f864fc6bf1d
DIST rocm-opencl-runtime-5.0.2.tar.gz 1004855 BLAKE2B e2c2beb987053204fbe8fda562ae65d6c1a58447e9e88bf1081aabeee6c9a10738fd8562114b564b647682438fdbd2c535db1008ac6e1cc4eb9a915998eeb3c7 SHA512 fa01d1fafc890181b9e67070353ee7c9100619494b7509cae1a3659f24ef1d00f650024cb24bdb0e6e7eacfdec1115e4683ec6f320228a19f41ae83321780780
+DIST rocm-opencl-runtime-5.1.3.tar.gz 1004765 BLAKE2B 64d9b42026d2be1d0e4aa666785699f6b4ec0584a927904a94bf830883050943503f8bdd7c97438a2fb11c71686a330d526f633959916c5c6c8da2e037841e79 SHA512 b83c3ae0bfad80f867bacce36710a8964f6dd7e64bf50da3ec6ce842217d6de63299d9ceaab9dc25a22252484520a85d02859809463dad5dda9b1f00a86863e0
DIST rocm-tracer-5.0.2.tar.gz 474669 BLAKE2B b350111590140e1282338e4f134caf6228677c49361ceb9bc7ba0da8709346daa4fd014644c04adff0e903dba6014a84edd2eb3a5c132a8f91b479e4d5b085e5 SHA512 3fc1449cc9c9bf83e5233a7a0e83c0e3fa9da225d5ee4427b7d6fa15e3580497e1b9fbcd63892e4a99df01582aecd3ccfd66d2a19af2d8c25949ee705894ea44
+DIST rocm-tracer-5.1.3.tar.gz 511617 BLAKE2B 4142979b3b7d649798a7ac0b2a04b42aa7fbcbf82f2cf51b0e5363ec0da538046d6e59283d0ce1bfd341317bf24ac2f694d5c8a7d1f132f9b21caea5caf7eda3 SHA512 e73b0c921ffbdcac571d8b0825de39bd8a4fd5f2720ecdd0c189951db85efb607a0b1cd7a9bb02b3dbf329b277cb5e197525216a8e8927eea4e6ce290b7e7c7b
diff --git a/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch b/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch
new file mode 100644
index 000000000000..14af91f9055b
--- /dev/null
+++ b/dev-util/hip/files/0001-SWDEV-316128-HIP-surface-API-support.patch
@@ -0,0 +1,35 @@
+From 4168c6ded4e54602f6fad8b0a483b20ab7f83cd5 Mon Sep 17 00:00:00 2001
+From: haoyuan2 <Hao.Yuan@amd.com>
+Date: Mon, 21 Feb 2022 10:10:04 -0800
+Subject: [PATCH] SWDEV-316128 - HIP surface API support
+
+remove redundant code in host API
+
+Change-Id: I8fbf894e858642da4198cc7afd2d2e2f1971e738
+Signed-off-by: YiyangWu <xgreenlandforwyy@gmail.com>
+---
+ src/hip_surface.cpp | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/hip_surface.cpp b/src/hip_surface.cpp
+index 831df321..a8e7f71d 100644
+--- a/src/hip_surface.cpp
++++ b/src/hip_surface.cpp
+@@ -1,4 +1,4 @@
+-/* Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc.
++/* Copyright (c) 2015 - 2022 Advanced Micro Devices, Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+@@ -81,8 +81,6 @@ hipError_t hipCreateSurfaceObject(hipSurfaceObject_t* pSurfObject,
+ }
+
+ hipError_t ihipDestroySurfaceObject(hipSurfaceObject_t surfaceObject) {
+- HIP_INIT_API(hipDestroySurfaceObject, surfaceObject);
+-
+ if (surfaceObject == nullptr) {
+ return hipSuccess;
+ }
+--
+2.34.1
+
diff --git a/dev-util/hip/files/hip-5.1.3-clang-include-path.patch b/dev-util/hip/files/hip-5.1.3-clang-include-path.patch
new file mode 100644
index 000000000000..bf1f2dd32ce5
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-clang-include-path.patch
@@ -0,0 +1,12 @@
+pass HIP_CLANG_INCLUDE_PATH which is determined by clang -print-resource-dir
+===================================================================
+--- HIP-rocm-5.1.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.1.3/bin/hipcc.pl
+@@ -105,6 +105,7 @@ $ROCM_PATH = $hipvars::ROCM_PATH;
+ $HIP_VERSION = $hipvars::HIP_VERSION;
+ $HSA_PATH = $hipvars::HSA_PATH;
+ $HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME;
++$HIP_CLANG_INCLUDE_PATH = $hipvars::HIP_CLANG_INCLUDE_PATH;
+
+ if ($HIP_PLATFORM eq "amd") {
+ # If using ROCclr runtime, need to find HIP_ROCCLR_HOME
diff --git a/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch b/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch
new file mode 100644
index 000000000000..05b25e7178fa
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-fix-hip_prof_gen.patch
@@ -0,0 +1,38 @@
+Backported fb5a64025bb0e10173a1ee4f3475db322b74b594
+fix an issue in hip_prof_gen.py with GLenum.
+diff --git a/src/hip_prof_gen.py b/src/hip_prof_gen.py
+index bd32d5bf..a3071a75 100755
+--- a/src/hip_prof_gen.py
++++ b/src/hip_prof_gen.py
+@@ -81,7 +81,7 @@ def filtr_api_args(args_str):
+ args_str = re.sub(r'\s*,\s*', r',', args_str);
+ args_str = re.sub(r'\s+', r' ', args_str);
+ args_str = re.sub(r'\s*(\*+)\s*', r'\1 ', args_str);
+- args_str = re.sub(r'(enum|struct) ', '', args_str);
++ args_str = re.sub(r'(\benum|struct) ', '', args_str);
+ return args_str
+
+ # Normalizing types
+@@ -129,7 +129,9 @@ def pointer_ck(arg_type):
+ m = re.match(r'(.*)\*$', arg_type)
+ if m:
+ ptr_type = m.group(1)
+- ptr_type = re.sub(r'const ', '', ptr_type)
++ n = re.match(r'(.*)\*\*$', arg_type)
++ if not n:
++ ptr_type = re.sub(r'const ', '', ptr_type)
+ if ptr_type == 'void': ptr_type = ''
+ return ptr_type
+ #############################################################
+@@ -613,7 +615,7 @@ if (len(sys.argv) < 4):
+ " -p - HIP_INIT_API macro patching mode\n" +
+ "\n" +
+ " Example:\n" +
+- " $ " + sys.argv[0] + " -v -p -t --priv ./include/hip/amd_detail/hip_runtime_api.h" +
++ " $ " + sys.argv[0] + " -v -p -t --priv ../hip/include/hip/hip_runtime_api.h" +
+ " ./src ./include/hip/amd_detail/hip_prof_str.h ./include/hip/amd_detail/hip_prof_str.h.new");
+
+ # API header file given as an argument
+--
+2.34.1
+
diff --git a/dev-util/hip/files/hip-5.1.3-rocm-path.patch b/dev-util/hip/files/hip-5.1.3-rocm-path.patch
new file mode 100644
index 000000000000..2ce68b733577
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-rocm-path.patch
@@ -0,0 +1,13 @@
+explicitly specify `--rocm-path=/usr` because clang does not list
+it among the default paths
+===================================================================
+--- HIP-rocm-5.1.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.1.3/bin/hipcc.pl
+@@ -696,6 +696,7 @@ if ($HIP_PLATFORM eq "amd") {
+
+ if ($hasHIP) {
+ if ($DEVICE_LIB_PATH ne "$ROCM_PATH/amdgcn/bitcode") {
++ $HIPCXXFLAGS .= " --rocm-path=\"$ROCM_PATH\"";
+ $HIPCXXFLAGS .= " --hip-device-lib-path=\"$DEVICE_LIB_PATH\"";
+ }
+ $HIPCXXFLAGS .= " -fhip-new-launch-api";
diff --git a/dev-util/hip/files/hipvars-5.1.3.pm b/dev-util/hip/files/hipvars-5.1.3.pm
new file mode 100644
index 000000000000..7de38b7f3c78
--- /dev/null
+++ b/dev-util/hip/files/hipvars-5.1.3.pm
@@ -0,0 +1,21 @@
+#!/usr/bin/perl -w
+package hipvars;
+
+$HIP_BASE_VERSION_MAJOR = "@HIP_BASE_VERSION_MAJOR@";
+$HIP_BASE_VERSION_MINOR = "@HIP_BASE_VERSION_MINOR@";
+
+$isWindows = 0;
+$HIP_PATH='/usr';
+$ROCM_PATH='/usr';
+$CUDA_PATH='/opt/cuda';
+$HSA_PATH='/usr';
+$HIP_CLANG_PATH='@CLANG_PATH@';
+$HIP_CLANG_INCLUDE_PATH='@CLANG_INCLUDE_PATH@';
+$HIP_ROCCLR_HOME=$HIP_PATH;
+$HIP_PLATFORM='amd';
+$HIP_COMPILER = "clang";
+$HIP_RUNTIME = "rocclr";
+$HIP_VERSION_MAJOR = $HIP_BASE_VERSION_MAJOR;
+$HIP_VERSION_MINOR = $HIP_BASE_VERSION_MINOR;
+$HIP_VERSION_PATCH = "@HIP_VERSION_PATCH@";
+$HIP_VERSION="$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
diff --git a/dev-util/hip/hip-5.1.3.ebuild b/dev-util/hip/hip-5.1.3.ebuild
new file mode 100644
index 000000000000..a9e9844fdcc2
--- /dev/null
+++ b/dev-util/hip/hip-5.1.3.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit cmake llvm prefix python-any-r1
+
+LLVM_MAX_SLOT=14
+
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
+SRC_URI="https://github.com/ROCm-Developer-Tools/hipamd/archive/rocm-${PV}.tar.gz -> rocm-hipamd-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz
+ https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz
+ profile? ( https://github.com/ROCm-Developer-Tools/roctracer/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/hipamd/files/8991181/hip_prof_str_diff.gz -> ${P}-update-header.patch.gz
+ )"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug profile"
+
+DEPEND="
+ >=dev-util/rocminfo-5
+ sys-devel/clang:${LLVM_MAX_SLOT}
+ dev-libs/rocm-comgr:${SLOT}
+ virtual/opengl
+"
+RDEPEND="${DEPEND}
+ dev-perl/URI-Encode
+ sys-devel/clang-runtime:=
+ >=dev-libs/roct-thunk-interface-5"
+BDEPEND="profile? ( $(python_gen_any_dep '
+ dev-python/CppHeaderParser[${PYTHON_USEDEP}]
+ ') )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
+ "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
+ "${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
+ "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
+ "${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
+ "${FILESDIR}/${PN}-5.1.3-fix-hip_prof_gen.patch"
+ "${FILESDIR}/0001-SWDEV-316128-HIP-surface-API-support.patch"
+)
+
+python_check_deps() {
+ if use profile; then
+ has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]"
+ fi
+}
+
+S="${WORKDIR}/hipamd-rocm-${PV}"
+HIP_S="${WORKDIR}"/HIP-rocm-${PV}
+OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
+CLR_S="${WORKDIR}"/ROCclr-rocm-${PV}
+RTC_S="${WORKDIR}"/roctracer-rocm-${PV}
+
+src_prepare() {
+ cmake_src_prepare
+ use profile && eapply "${WORKDIR}/${P}-update-header.patch"
+
+ eapply_user
+
+ # Use Gentoo slot number, otherwise git hash is attempted in vain.
+ sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
+
+ # disable PCH, because it results in a build error in ROCm 4.0.0
+ sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
+
+ # correctly find HIP_CLANG_INCLUDE_PATH using cmake
+ local LLVM_PREFIX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+ local CLANG_RESOURCE_DIR=$("${LLVM_PREFIX}/bin/clang" -print-resource-dir)
+ sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":${LLVM_PREFIX}:" -i hip-config.cmake.in || die
+
+ # correct libs and cmake install dir
+ sed -e "/LIB_INSTALL_DIR/s:PREFIX}/lib:PREFIX}/$(get_libdir):" \
+ -e "/${HIP_COMMON_DIR}\/cmake DESTINATION/s: .): $(get_libdir)):" -i CMakeLists.txt || die
+ sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die
+
+ sed -e "/\.hip/d" \
+ -e "s,DESTINATION lib,DESTINATION $(get_libdir),g" \
+ -e "/\(cmake\|samples\)/s,DESTINATION \.,DESTINATION share,g" \
+ -e "/CPACK_RESOURCE_FILE_LICENSE/d" -i packaging/CMakeLists.txt || die
+
+ pushd ${HIP_S} || die
+ eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch"
+ eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
+ eapply "${FILESDIR}/${PN}-5.0.2-correct-ldflag.patch"
+ # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
+ # which makes "stdlib.h" not found when using "#include_next" in header files;
+ sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
+ -e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+ -e "s:\$ENV{'HIP_LIB_PATH'}:'/usr/$(get_libdir)':" \
+ -e "/rpath/s,--rpath=[^ ]*,," \
+ -e "s,\$HIP_CLANG_PATH/../lib/clang/\$HIP_CLANG_VERSION/,${CLANG_RESOURCE_DIR}/,g" \
+ -i bin/hipcc.pl || die
+
+ # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
+ -i "${S}/hip-config.cmake.in" || die
+
+ einfo "prefixing hipcc and its utils..."
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${HIP_S}")
+
+ cp "$(prefixify_ro "${FILESDIR}"/hipvars-5.1.3.pm)" bin/hipvars.pm || die "failed to replace hipvars.pm"
+ sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
+ -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," \
+ -e "s,@CLANG_INCLUDE_PATH@,${CLANG_RESOURCE_DIR}/include," \
+ -e "s,@CLANG_PATH@,${LLVM_PREFIX}/bin," -i bin/hipvars.pm || die
+
+ sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${_IMPORT_PREFIX}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-lang-config.cmake.in || die
+ popd || die
+ sed -e "/HIP_CLANG_INCLUDE_SEARCH_PATHS/s,\${HIP_CLANG_ROOT}.*/include,${CLANG_RESOURCE_DIR}/include," -i hip-config.cmake.in || die
+}
+
+src_configure() {
+ use debug && CMAKE_BUILD_TYPE="Debug"
+
+ # TODO: Currently a GENTOO configuration is build,
+ # this is also used in the cmake configuration files
+ # which will be installed to find HIP;
+ # Other ROCm packages expect a "RELEASE" configuration,
+ # see "hipBLAS"
+ local mycmakeargs=(
+ -DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+ -DCMAKE_BUILD_TYPE=${buildtype}
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_SKIP_RPATH=ON
+ -DBUILD_HIPIFY_CLANG=OFF
+ -DHIP_PLATFORM=amd
+ -DHIP_COMPILER=clang
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API=$(usex profile 1 0)
+ -DROCCLR_PATH=${CLR_S}
+ -DHIP_COMMON_DIR=${HIP_S}
+ -DAMD_OPENCL_PATH=${OCL_S}
+ )
+
+ use profile && mycmakeargs+=( -DPROF_API_HEADER_PATH="${RTC_S}"/inc/ext )
+
+ cmake_src_configure
+}
+
+src_install() {
+
+ cmake_src_install
+
+ rm "${ED}/usr/include/hip/hcc_detail" || die
+
+ # Don't install .hipInfo and .hipVersion to bin/lib
+ rm "${ED}/usr/lib/.hipInfo" "${ED}/usr/bin/.hipVersion" || die
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2022-07-08 17:40 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2022-07-08 17:40 UTC (permalink / raw
To: gentoo-commits
commit: 7dac65ea4155fa1f5a21bdd46dd9793d21911e0e
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Mon Jun 27 13:12:30 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Jul 8 17:40:06 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dac65ea
dev-util/hip: add missing BDEPEND for USE=profile
Also fix ld warnings by patch out unecessary ldflag added by hipcc.pl
Closes: https://github.com/gentoo/gentoo/pull/26090
Closes: https://bugs.gentoo.org/843263
Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1166193820
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
dev-util/hip/files/hip-5.0.2-correct-ldflag.patch | 18 ++++++++++++++++++
dev-util/hip/hip-5.0.2-r2.ebuild | 17 ++++++++++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/dev-util/hip/files/hip-5.0.2-correct-ldflag.patch b/dev-util/hip/files/hip-5.0.2-correct-ldflag.patch
new file mode 100644
index 000000000000..81d1bc3b8552
--- /dev/null
+++ b/dev-util/hip/files/hip-5.0.2-correct-ldflag.patch
@@ -0,0 +1,18 @@
+This removes ldflag -L"/usr/lib" and -Wl,-rpath=/usr/lib:/usr/lib which
+causes `ld: skipping incompatible /usr/lib/libm.so when searching for -lm`
+Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1166193820
+===================================================================
+--- HIP-rocm-5.1.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.1.3/bin/hipcc.pl
+@@ -703,9 +703,9 @@ if ($HIP_PLATFORM eq "amd") {
+
+ if (not $isWindows and not $compileOnly) {
+ if ($linkType eq 0) {
+- $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
++ $toolArgs = " -lamdhip64 -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
+ } else {
+- $toolArgs = " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 " . ${toolArgs};
++ $toolArgs = " -Wl,--enable-new-dtags -lamdhip64 " . ${toolArgs};
+ }
+ # To support __fp16 and _Float16, explicitly link with compiler-rt
+ $HIP_CLANG_BUILTIN_LIB="/opt/gentoo/opt/gentoo/usr/lib/llvm/14/bin/../../../../lib/clang/14.0.6/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
diff --git a/dev-util/hip/hip-5.0.2-r2.ebuild b/dev-util/hip/hip-5.0.2-r2.ebuild
index 223386227084..fd069acfe4b4 100644
--- a/dev-util/hip/hip-5.0.2-r2.ebuild
+++ b/dev-util/hip/hip-5.0.2-r2.ebuild
@@ -2,7 +2,10 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-inherit cmake prefix
+
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit cmake prefix python-any-r1
DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
@@ -29,6 +32,10 @@ DEPEND="
RDEPEND="${DEPEND}
dev-perl/URI-Encode
dev-libs/roct-thunk-interface:${SLOT}"
+BDEPEND="profile? ( $(python_gen_any_dep '
+ dev-python/CppHeaderParser[${PYTHON_USEDEP}]
+ ') )
+"
PATCHES=(
"${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
@@ -38,6 +45,12 @@ PATCHES=(
"${FILESDIR}/${PN}-5.0.2-set-build-id.patch"
)
+python_check_deps() {
+ if use profile; then
+ has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]"
+ fi
+}
+
S="${WORKDIR}/hipamd-rocm-${PV}"
HIP_S="${WORKDIR}"/HIP-rocm-${PV}
OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
@@ -65,11 +78,13 @@ src_prepare() {
sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die
cd ${HIP_S} || die
+ eapply "${FILESDIR}/${PN}-5.0.2-correct-ldflag.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
-e "/HIP.*FLAGS.*isystem.*HIP_INCLUDE_PATH/d" \
-e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+ -e "s:\$ENV{'HIP_LIB_PATH'}:'/usr/$(get_libdir)':" \
-e "/rpath/s,--rpath=[^ ]*,," \
-i bin/hipcc.pl || die
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/
@ 2022-03-22 4:09 Benda XU
0 siblings, 0 replies; 17+ messages in thread
From: Benda XU @ 2022-03-22 4:09 UTC (permalink / raw
To: gentoo-commits
commit: 60a357de6bf51b8445d9ef3ea60ba62498fc9054
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Mon Feb 21 12:30:44 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Mar 22 04:09:45 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60a357de
dev-util/hip: bump version to 5.0.2
1. According to INSTALL.md, bundle rocclr at build time (like
rocm-opencl-runtime which drop rocclr dependency).
2. Bundle roctracer headers which resolve circular dep with roctracer
3. Upstream moves to hipamd.git, while the perl scripts is in original
HIP.git, with .pl suffix. Future hipcc will be a binary.
4. Move prefix from /usr/lib/hip to /usr
5. Avoid build error when USE=profile (Not sure if it's the right way)
6. Delete unused /usr/lib/.hipInfo and /usr/bin/.hipVersion
Closes: https://github.com/gentoo/gentoo/pull/24681
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
dev-util/hip/Manifest | 6 ++
dev-util/hip/files/hip-5.0.1-DisableTest.patch | 32 ++++++
.../hip/files/hip-5.0.1-hip_vector_types.patch | 11 ++
dev-util/hip/hip-5.0.2.ebuild | 119 +++++++++++++++++++++
4 files changed, 168 insertions(+)
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index a8db3b5914b4..a5655c73e1a8 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -1,5 +1,11 @@
+DIST 5.0.2-update-header.patch.gz 5136 BLAKE2B 290b9e250e3004a1147ad28606d7d205078affbd809c6a429744767ebabf35bd8df6395dc135984d345ae2f23fa457dcb2524bcbf31c5bf16903d3ee2007bf5d SHA512 41b1025c403e874026a712ec6f6571c873203b08ddadf68848f6d1f63924c21b206677b330f79edad2c4b85e2ba5053b1d33f70c7c09ff9c17bc5905b849da0c
+DIST rocclr-5.0.2.tar.gz 853965 BLAKE2B a0d568eb3b230845970d8256a5a2f32018e4b9fb68e0f1aa13a1f3fc953e614025315b90cbe68c107f7150cf91b4b1ea438455429062c7dc06ef77d65dedd2ec SHA512 b30a57c09973d8ef624511f422babaf9722685b9f85643783aebc000671b41fd54f44b308cece0baab187e1ee00b10335c6d22b6bad6fb3468abe6ef0da97d73
DIST rocm-hip-4.0.0.tar.gz 1012154 BLAKE2B 02343239a5b27c42dafd241f2c9b6f5195c50f78bfd717ae72bcb16d384bd6cf97ff6f2b86bfcf323aaaf022d6897f46d0987826c80d6f6279be4cb4792e15be SHA512 cf840dbe28a9a15e3be14351bfa22d3c81e1654813a7aee55f53e71b2ee183f8dd0de14a79791617fabb5b357cadbf2ce2f476f78884b2843d30f206d65088f6
DIST rocm-hip-4.1.0.tar.gz 954215 BLAKE2B c4b75ab2158e6921be1c34820ab5d1a5e2eb36112834b0143c50023caa27de384e0497f4837947cc7fe05554c6c95201340b1979eb916b31ebb4ffec8c923735 SHA512 420ffd7b79e2b4506873cbfc56e96395f8ed9d9375ce28df51626601199d4d8dca6920528e255d39a48ad66ee11f4b653f3b9f659df489d32b21886fb86c64b5
DIST rocm-hip-4.2.0.tar.gz 918281 BLAKE2B 45c28289c8ff9e600bfd9daff8af162c897fcfdf41ce65d91d1761d58253d87a6385fd4a15e818619ca39d3413479bf043ab2758fead349a243105e979b64f7c SHA512 e620507321c949ded2eab6159099eef0eab267eb686b6ee0ed86022fffaa51fb8714a7f344b79acf76c876c55919360905d1bb3a7c00a87f40174774d6682ce8
DIST rocm-hip-4.3.0.tar.gz 967550 BLAKE2B 263e8bbaa86198d3cb6a29f5597b56a3fe1e9338a8c485935070e6253816ccdba9671f33d8142c260aa3c36f43a71de7f2c1b7a15e1227f97aaf03ed10ce10dd SHA512 bc2d9597200405397387cc8f626f0cc734ee450c462bd7c7a0c655e3dfe2d1e09780328cbfa1c0d1e0db836e561fc450c5d514a6ad1a5828cb913c4c3c535ef1
+DIST rocm-hip-5.0.2.tar.gz 958496 BLAKE2B 9c8bb1eacd982203e3bd6c24560672c4a9aaf5606608635d7da5a60f613d9be50998f990c1ea3e0e6f5581e0efcba09af736a77bbc9469b2898e0974d063e8d6 SHA512 4a99e86a4594c15509a1bbfec0678cd05469eb14dcf35ce650e1eb7c2415f57f59071b1b8add2f8566ccf06242bead77abd275987fe79fe6031dea90d5693805
+DIST rocm-hipamd-5.0.2.tar.gz 319973 BLAKE2B ca19938eeca66f0d2614ff933e1d0e75b6b8dbc8d996fd4369e5649897b9948271ac88f2a66f0a40ef586d6185b30d01132decac95d1615c1ee419996050ed07 SHA512 056acab082b5073e81f9e5de00ae12c85021d1c297cdcfc45b85f191dcc68603f64fe5d0e75f9523120657947eb125beaa9c3ce26234968c43b200e638f9afa3
DIST rocm-opencl-runtime-4.3.0.tar.gz 1006792 BLAKE2B 29fd5843bb0153c7d3fe5250898f0fbdd089db6304122698c9ec9a5436e3a6845916f241f1a1e79a614e369f000297ac12413620edec0660d859ccddaa978d07 SHA512 a514d626700350f2c663db468427479eaa9e39dd912266ac2db6830d712351ffbc18737b208fd37f7ab5afdc2c9f6412d8d765973d6c72759bf51f864fc6bf1d
+DIST rocm-opencl-runtime-5.0.2.tar.gz 1004855 BLAKE2B e2c2beb987053204fbe8fda562ae65d6c1a58447e9e88bf1081aabeee6c9a10738fd8562114b564b647682438fdbd2c535db1008ac6e1cc4eb9a915998eeb3c7 SHA512 fa01d1fafc890181b9e67070353ee7c9100619494b7509cae1a3659f24ef1d00f650024cb24bdb0e6e7eacfdec1115e4683ec6f320228a19f41ae83321780780
+DIST rocm-tracer-5.0.2.tar.gz 474669 BLAKE2B b350111590140e1282338e4f134caf6228677c49361ceb9bc7ba0da8709346daa4fd014644c04adff0e903dba6014a84edd2eb3a5c132a8f91b479e4d5b085e5 SHA512 3fc1449cc9c9bf83e5233a7a0e83c0e3fa9da225d5ee4427b7d6fa15e3580497e1b9fbcd63892e4a99df01582aecd3ccfd66d2a19af2d8c25949ee705894ea44
diff --git a/dev-util/hip/files/hip-5.0.1-DisableTest.patch b/dev-util/hip/files/hip-5.0.1-DisableTest.patch
new file mode 100644
index 000000000000..d41b06efc8c9
--- /dev/null
+++ b/dev-util/hip/files/hip-5.0.1-DisableTest.patch
@@ -0,0 +1,32 @@
+Index: hipamd-rocm-5.0.1/CMakeLists.txt
+===================================================================
+--- hipamd-rocm-5.0.1.orig/CMakeLists.txt
++++ hipamd-rocm-5.0.1/CMakeLists.txt
+@@ -503,27 +503,6 @@ endif()
+ if(NOT WIN32)
+ set(HIP_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ set(HIP_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+-if(HIP_PLATFORM STREQUAL "nvidia")
+- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_SRC_PATH}/include" "${HIP_ROOT_DIR}/include" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-endif()
+-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_INCLUDE_DIR}/hip/" "${HIP_ROOT_DIR}/include/hip/" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_DIR}/cmake" "${HIP_ROOT_DIR}/cmake" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-if(${RUN_HIT} EQUAL 0)
+- execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_directory "${HIP_COMMON_BIN_DIR}" "${HIP_ROOT_DIR}/bin" RESULT_VARIABLE RUN_HIT ERROR_QUIET)
+-endif()
+-if(HIP_CATCH_TEST EQUAL "1")
+- enable_testing()
+- set(HIP_PATH ${HIP_ROOT_DIR})
+- add_subdirectory(${HIP_COMMON_DIR}/tests/catch ${PROJECT_BINARY_DIR}/catch)
+-else()
+- if(${RUN_HIT} EQUAL 0)
+- set(CMAKE_MODULE_PATH "${HIP_ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH})
+- include(${HIP_COMMON_DIR}/tests/hit/HIT.cmake)
+- include(${HIP_COMMON_DIR}/tests/Tests.cmake)
+- else()
+- message(STATUS "Testing targets will not be available. To enable them please ensure that the HIP installation directory is writeable. Use -DCMAKE_INSTALL_PREFIX to specify a suitable location")
+- endif()
+-endif()
+ endif()
+
+ #############################
diff --git a/dev-util/hip/files/hip-5.0.1-hip_vector_types.patch b/dev-util/hip/files/hip-5.0.1-hip_vector_types.patch
new file mode 100644
index 000000000000..7a1a79b2a936
--- /dev/null
+++ b/dev-util/hip/files/hip-5.0.1-hip_vector_types.patch
@@ -0,0 +1,11 @@
+mitigate compilation error
+--- a/include/hip/amd_detail/amd_hip_vector_types.h
++++ b/include/hip/amd_detail/amd_hip_vector_types.h
+@@ -45,6 +45,7 @@ THE SOFTWARE.
+
+ #if defined(__cplusplus)
+ #if !defined(__HIPCC_RTC__)
++ #include <new>
+ #include <array>
+ #include <iosfwd>
+ #include <type_traits>
diff --git a/dev-util/hip/hip-5.0.2.ebuild b/dev-util/hip/hip-5.0.2.ebuild
new file mode 100644
index 000000000000..a545153b1f54
--- /dev/null
+++ b/dev-util/hip/hip-5.0.2.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit cmake prefix
+
+DESCRIPTION="C++ Heterogeneous-Compute Interface for Portability"
+HOMEPAGE="https://github.com/ROCm-Developer-Tools/hipamd"
+SRC_URI="https://github.com/ROCm-Developer-Tools/hipamd/archive/rocm-${PV}.tar.gz -> rocm-hipamd-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-${PV}.tar.gz -> rocm-hip-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/ROCclr/archive/rocm-${PV}.tar.gz -> rocclr-${PV}.tar.gz
+ https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-${PV}.tar.gz -> rocm-opencl-runtime-${PV}.tar.gz
+ profile? ( https://github.com/ROCm-Developer-Tools/roctracer/archive/refs/tags/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz
+ https://github.com/ROCm-Developer-Tools/hipamd/files/8311148/hip_prof_str_diff.gz -> ${PV}-update-header.patch.gz
+ )"
+
+KEYWORDS="~amd64"
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug profile"
+
+DEPEND="
+ dev-util/rocminfo:${SLOT}
+ =sys-devel/llvm-roc-${PV}*[runtime]
+"
+RDEPEND="${DEPEND}
+ dev-perl/URI-Encode
+ dev-libs/roct-thunk-interface:${SLOT}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.0.1-DisableTest.patch"
+ "${FILESDIR}/${PN}-4.2.0-config-cmake-in.patch"
+ "${FILESDIR}/${PN}-5.0.1-hip_vector_types.patch"
+ "${FILESDIR}/${PN}-4.2.0-cancel-hcc-header-removal.patch"
+)
+
+S="${WORKDIR}/hipamd-rocm-${PV}"
+HIP_S="${WORKDIR}"/HIP-rocm-${PV}
+OCL_S="${WORKDIR}"/ROCm-OpenCL-Runtime-rocm-${PV}
+CLR_S="${WORKDIR}"/ROCclr-rocm-${PV}
+RTC_S="${WORKDIR}"/roctracer-rocm-${PV}
+
+src_prepare() {
+ cmake_src_prepare
+ use profile && eapply "${WORKDIR}/${PV}-update-header.patch"
+
+ eapply_user
+
+ # Use Gentoo slot number, otherwise git hash is attempted in vain.
+ sed -e "/set (HIP_LIB_VERSION_STRING/cset (HIP_LIB_VERSION_STRING ${SLOT#*/})" -i CMakeLists.txt || die
+
+ # disable PCH, because it results in a build error in ROCm 4.0.0
+ sed -e "s:option(__HIP_ENABLE_PCH:#option(__HIP_ENABLE_PCH:" -i CMakeLists.txt || die
+
+ # correctly find HIP_CLANG_INCLUDE_PATH using cmake
+ sed -e "/set(HIP_CLANG_ROOT/s:\"\${ROCM_PATH}/llvm\":/usr/lib/llvm/roc:" -i hip-config.cmake.in || die
+
+ # correct libs and cmake install dir
+ sed -e "/LIB_INSTALL_DIR/s:PREFIX}/lib:PREFIX}/$(get_libdir):" \
+ -e "/${HIP_COMMON_DIR}\/cmake DESTINATION/s: .): $(get_libdir)):" -i CMakeLists.txt || die
+ sed -e "/LIBRARY DESTINATION/s:lib:$(get_libdir):" -i src/CMakeLists.txt || die
+
+ cd ${HIP_S} || die
+ # Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
+ # which makes "stdlib.h" not found when using "#include_next" in header files;
+ sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
+ -e "s:\$ENV{'DEVICE_LIB_PATH'}:'/usr/lib/amdgcn/bitcode':" \
+ -e "/rpath/s,--rpath=[^ ]*,," \
+ -i bin/hipcc.pl || die
+
+ # change --hip-device-lib-path to "/usr/lib/amdgcn/bitcode", must align with "dev-libs/rocm-device-libs"
+ sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:/usr/lib/amdgcn/bitcode:" \
+ -i "${S}/hip-config.cmake.in" || die
+
+ einfo "prefixing hipcc and its utils..."
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${S}")
+ hprefixify $(grep -rl --exclude-dir=build/ "/usr" "${HIP_S}")
+
+ cp "$(prefixify_ro "${FILESDIR}"/hipvars.pm)" bin/ || die "failed to replace hipvars.pm"
+ sed -e "s,@HIP_BASE_VERSION_MAJOR@,$(ver_cut 1)," -e "s,@HIP_BASE_VERSION_MINOR@,$(ver_cut 2)," \
+ -e "s,@HIP_VERSION_PATCH@,$(ver_cut 3)," -i bin/hipvars.pm || die
+}
+
+src_configure() {
+ use debug && CMAKE_BUILD_TYPE="Debug"
+
+ # TODO: Currently a GENTOO configuration is build,
+ # this is also used in the cmake configuration files
+ # which will be installed to find HIP;
+ # Other ROCm packages expect a "RELEASE" configuration,
+ # see "hipBLAS"
+ local mycmakeargs=(
+ -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/lib/llvm/roc"
+ -DCMAKE_BUILD_TYPE=${buildtype}
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DBUILD_HIPIFY_CLANG=OFF
+ -DHIP_PLATFORM=amd
+ -DHIP_COMPILER=clang
+ -DROCM_PATH="${EPREFIX}/usr"
+ -DUSE_PROF_API=$(usex profile 1 0)
+ -DPROF_API_HEADER_PATH="${RTC_S}"/inc/ext
+ -DROCCLR_PATH=${CLR_S}
+ -DHIP_COMMON_DIR=${HIP_S}
+ -DAMD_OPENCL_PATH=${OCL_S}
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+
+ cmake_src_install
+
+ rm "${ED}/usr/include/hip/hcc_detail" || die
+
+ # Don't install .hipInfo and .hipVersion to bin/lib
+ rm "${ED}/usr/lib/.hipInfo" "${ED}/usr/bin/.hipVersion" || die
+}
^ permalink raw reply related [flat|nested] 17+ messages in thread
end of thread, other threads:[~2024-06-26 9:21 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-02 17:46 [gentoo-commits] repo/gentoo:master commit in: dev-util/hip/, dev-util/hip/files/ 罗百科
-- strict thread matches above, loose matches on Subject: below --
2024-06-26 9:21 Sam James
2023-12-14 15:02 Benda XU
2023-12-14 15:02 Benda XU
2023-10-09 16:27 罗百科
2023-04-05 16:10 Benda XU
2023-02-20 4:33 Sam James
2023-02-10 4:26 Sam James
2023-02-01 9:53 Andreas Sturmlechner
2023-01-31 13:32 Benda XU
2023-01-31 13:32 Benda XU
2023-01-21 3:32 Sam James
2022-12-19 14:00 Andreas Sturmlechner
2022-11-19 11:50 Benda XU
2022-08-06 14:23 Benda XU
2022-07-08 17:40 Benda XU
2022-03-22 4:09 Benda XU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox