summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSv. Lockal <lockalsash@gmail.com>2024-05-20 18:04:36 +0800
committerSam James <sam@gentoo.org>2024-06-26 10:19:00 +0100
commitd066276c6ee96ea5bf152fbf892498d050b581f1 (patch)
tree355922f0d3aa44d8e9b2c44fd8c33836583951dc /dev-util/hip
parentdev-util/hip: fix tests and dependency on hipcc, bump to 6.0.2 (diff)
downloadgentoo-d066276c6ee96ea5bf152fbf892498d050b581f1.tar.gz
gentoo-d066276c6ee96ea5bf152fbf892498d050b581f1.tar.bz2
gentoo-d066276c6ee96ea5bf152fbf892498d050b581f1.zip
dev-util/hip: fix manifest and add extend-isa-compatibility-check patch for 6.0.0
Other changes: * update patch for gfx1012, repeating https://salsa.debian.org/rocm-team/rocm-hipamd/-/commit/76b378eb687133267874c045396b8cb671bb50f1 * update llvm eclass to r1 * add myself as a maintainer Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/hip')
-rw-r--r--dev-util/hip/files/hip-5.7.1-extend-isa-compatibility-check.patch6
-rw-r--r--dev-util/hip/hip-6.0.2.ebuild33
-rw-r--r--dev-util/hip/metadata.xml4
3 files changed, 31 insertions, 12 deletions
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
index 7853de693cde..25bdfba07fd2 100644
--- 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
@@ -42,7 +42,7 @@ https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026
+}
+
+static bool isGfx1010EquivalentProcessor(const std::string& processor) {
-+ return matches(GfxPattern{"gfx101", "02"}, processor);
++ return matches(GfxPattern{"gfx101", "0"}, processor);
+}
+
+static bool isGfx1010SupersetProcessor(const std::string& processor) {
@@ -181,7 +181,7 @@ https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026
}
--- a/rocclr/device/device.cpp
+++ b/rocclr/device/device.cpp
-@@ -232,10 +232,49 @@ std::string Isa::isaName() const {
+@@ -234,10 +234,49 @@ std::string Isa::isaName() const {
return std::string(hsaIsaNamePrefix) + targetId();
}
@@ -211,7 +211,7 @@ https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/patches/0026
+ }
+ } else if (codeObjectIsa.versionMajor() == 10) {
+ if (codeObjectIsa.versionMinor() == 1) {
-+ const std::array<uint32_t, 2> gfx1010_equivalent = { 0, 2 };
++ const std::array<uint32_t, 1> gfx1010_equivalent = { 0 };
+ const std::array<uint32_t, 4> gfx1010_superset = { 0, 1, 2, 3 };
+ if (Contains(gfx1010_equivalent, codeObjectIsa.versionStepping()) &&
+ Contains(gfx1010_superset, agentIsa.versionStepping())) {
diff --git a/dev-util/hip/hip-6.0.2.ebuild b/dev-util/hip/hip-6.0.2.ebuild
index 48c0a89a0801..03a8b89a239c 100644
--- a/dev-util/hip/hip-6.0.2.ebuild
+++ b/dev-util/hip/hip-6.0.2.ebuild
@@ -7,9 +7,8 @@ DOCS_BUILDER="doxygen"
DOCS_DEPEND="media-gfx/graphviz"
ROCM_SKIP_GLOBALS=1
-inherit cmake docs flag-o-matic llvm rocm
-
-LLVM_MAX_SLOT=17
+LLVM_COMPAT=( 17 )
+inherit cmake docs flag-o-matic llvm-r1 rocm
TEST_PV=${PV}
@@ -28,9 +27,11 @@ IUSE="debug test"
DEPEND="
>=dev-util/rocminfo-5
- sys-devel/clang:${LLVM_MAX_SLOT}
+ $(llvm_gen_dep '
+ sys-devel/clang:${LLVM_SLOT}
+ ')
dev-libs/rocm-comgr:${SLOT}
- >=dev-libs/rocr-runtime-5.6
+ dev-libs/rocr-runtime:${SLOT}
x11-base/xorg-proto
virtual/opengl
"
@@ -62,8 +63,11 @@ hip_test_wrapper() {
src_prepare() {
# hipamd is itself built by cmake, and should never provide a
- # FindHIP.cmake module.
- rm -r "${WORKDIR}"/HIP-rocm-${PV}/cmake/FindHIP* || die
+ # FindHIP.cmake module. But the reality is some package relies on it.
+ # Set HIP and HIP Clang paths directly, don't search using heuristics
+ sed -e "s:# Search for HIP installation:set(HIP_ROOT_DIR \"${EPREFIX}/usr\"):" \
+ -e "s:#Set HIP_CLANG_PATH:set(HIP_CLANG_PATH \"$(get_llvm_prefix -d)/bin\"):" \
+ -i "${WORKDIR}"/HIP-rocm-${PV}/cmake/FindHIP.cmake || die
# https://github.com/ROCm/HIP/commit/405d029422ba8bb6be5a233d5eebedd2ad2e8bd3
# https://github.com/ROCm/clr/commit/ab6d34ae773f4d151e04170c0f4e46c1135ddf3e
@@ -92,10 +96,10 @@ src_configure() {
# Fix ld.lld linker error: https://github.com/ROCm/HIP/issues/3382
# See also: https://github.com/gentoo/gentoo/pull/29097
- append-ldflags $(tc-flags-CCLD -Wl,--undefined-version)
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
local mycmakeargs=(
- -DCMAKE_PREFIX_PATH="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
+ -DCMAKE_PREFIX_PATH="$(get_llvm_prefix)"
-DCMAKE_BUILD_TYPE=${buildtype}
-DCMAKE_SKIP_RPATH=ON
-DHIP_PLATFORM=amd
@@ -154,6 +158,17 @@ src_test() {
src_install() {
cmake_src_install
+ # add version file that is required by some libraries
+ mkdir "${ED}"/usr/include/rocm-core || die
+ cat <<EOF > "${ED}"/usr/include/rocm-core/rocm_version.h || die
+#pragma once
+#define ROCM_VERSION_MAJOR $(ver_cut 1)
+#define ROCM_VERSION_MINOR $(ver_cut 2)
+#define ROCM_VERSION_PATCH $(ver_cut 3)
+#define ROCM_BUILD_INFO "$(ver_cut 1-3).0-9999-unknown"
+EOF
+ dosym -r /usr/include/rocm-core/rocm_version.h /usr/include/rocm_version.h
+
# files already installed by hipcc, which is a runtime dep
rm "${ED}/usr/bin/hipconfig.pl" || die
rm "${ED}/usr/bin/hipcc.pl" || die
diff --git a/dev-util/hip/metadata.xml b/dev-util/hip/metadata.xml
index 21b0e03f6a41..610dcac57121 100644
--- a/dev-util/hip/metadata.xml
+++ b/dev-util/hip/metadata.xml
@@ -17,6 +17,10 @@
<email>gentoo@holzke.net</email>
<name>Wilfried Holzke</name>
</maintainer>
+ <maintainer type="person">
+ <email>lockalsash@gmail.com</email>
+ <name>Sv. Lockal</name>
+ </maintainer>
<upstream>
<remote-id type="github">ROCm-Developer-Tools/HIP</remote-id>
</upstream>