summaryrefslogtreecommitdiff
path: root/dev-util/hip
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
commitfcc5224904648a8e6eb528d7603154160a20022f (patch)
tree3bfce096b38a9cea8eed13fc70c1526c456e9abd /dev-util/hip
parent2fd57282f0262ca084e05b0f2c63fbada395d02b (diff)
gentoo resync : 02.02.2022
Diffstat (limited to 'dev-util/hip')
-rw-r--r--dev-util/hip/Manifest1
-rw-r--r--dev-util/hip/hip-4.3.0-r1.ebuild108
2 files changed, 109 insertions, 0 deletions
diff --git a/dev-util/hip/Manifest b/dev-util/hip/Manifest
index aa7a67e16cf9..e21c8ba16876 100644
--- a/dev-util/hip/Manifest
+++ b/dev-util/hip/Manifest
@@ -19,5 +19,6 @@ EBUILD hip-4.0.0.ebuild 3451 BLAKE2B c219b26871ab9197ddd75a4d8e03bdb2d6f9c12cc9d
EBUILD hip-4.1.0-r1.ebuild 3366 BLAKE2B c8663bbba532bca211de1a8b8253e2df9544cc656ae47a0d8e651161f7e4186227b9cdc11e3b3b010bbb1d8a18ff36ece37d5a9ad4092ed496f3c9d1e7dc7791 SHA512 fc2145fad2fe1e5a28331a91959c591693cec497504344e6ae2587276d7b20e7895d94780273a0f83307efbb0e6099e0bdc1874bcefa2595590a736092502891
EBUILD hip-4.1.0.ebuild 3476 BLAKE2B 101bb84d3083388e6dc761dca7ccf0ef5393a44be7666831e83303d1dfbd50e81e3fa09d572f9c5cdf30c6fb738e0587bb9ddd0ccb0627bef543bd64648b66f0 SHA512 3af9dc2a5ab5735dfb0cd5341cfe1e99961858d40409ffb065231bea793b8faa3de3b305d28f2dce90e4535e0406f90a3f933b4cbab06933d83b04dd3e433023
EBUILD hip-4.2.0.ebuild 3634 BLAKE2B 6ab4a5d74b08a2dd765bae85bb91fa7174cb0fbe411c7f4b741db6e49b47d42277e5bbba7e86637b8481a24d2eb0f53b7cb096d4dea09f0a6fc31538a4250fbe SHA512 ad8e4ba2df35b36f96047bdf40e0f7420256eedaa9432249d3d6d184ccfb2d0acbec7d679dfbef8fd278dd6d748334de927a50e7c00f35ce4823af2297d14b5b
+EBUILD hip-4.3.0-r1.ebuild 3782 BLAKE2B b3f7e96b664662e9cdae955993251af254cd44f66e9a4306035875eaed8f507badca6c357bf4fa82e93e76eefdbdf7923de5f56a9eeee762c7ba364abff2b1e7 SHA512 97f34852764c8810eb093ee2aa09f3484382f5a0af5f21543020138bcd8cc40838480a03b1ea88be8044bca71500bf746ed768749e6c71e939b8438f569bd8cb
EBUILD hip-4.3.0.ebuild 3761 BLAKE2B 7fdd7e65a7b1b246ad94a1e5ee37e7c3199f9dcc02df575e774fdbacf9690ac7609f53c122eff5dd87cddf9afd9c4f52d66a5502b3ec311fd6e9db5f3889a895 SHA512 07d8317cae9f7b2f4c179938477eb00ff8d0a136c730bd18582a835c23a8d9934d03824c2bb520c53cb1c2525e26618236b12dfcbfe520612a60c191a1d2947b
MISC metadata.xml 597 BLAKE2B cca1b105463e26741aa4bf95c9d85dd582df075795646f633ed5f0d39bace0b07be98f771aa8eb1b89984788249837303b67617e92c4076eb7601611cd2abf6d SHA512 42767156ae0e89b3ce438bfb163161b543e15114838a5c14b4b1c889fe799e44dd9bf9684ee685798a1fc5d2d4c520d3c42c9c74a88178a079ccb634148e0738
diff --git a/dev-util/hip/hip-4.3.0-r1.ebuild b/dev-util/hip/hip-4.3.0-r1.ebuild
new file mode 100644
index 000000000000..59e92546583b
--- /dev/null
+++ b/dev-util/hip/hip-4.3.0-r1.ebuild
@@ -0,0 +1,108 @@
+# 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
+}