commit: c7cd9b80ef198dd881c05ac91df3bf1f5a46a28a Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com> AuthorDate: Wed Oct 18 19:09:59 2023 +0000 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> CommitDate: Mon Nov 27 14:34:55 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7cd9b80
sci-libs/rocThrust: add 5.7.1 enable HMM to increase tests pass rate Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com> Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> sci-libs/rocThrust/Manifest | 1 + sci-libs/rocThrust/rocThrust-5.7.1.ebuild | 76 +++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/sci-libs/rocThrust/Manifest b/sci-libs/rocThrust/Manifest index 586b8f1b9260..5c109bf5006a 100644 --- a/sci-libs/rocThrust/Manifest +++ b/sci-libs/rocThrust/Manifest @@ -1 +1,2 @@ DIST rocThrust-5.1.3.tar.gz 1186518 BLAKE2B 2defe71247915940917438d4f0d0a811dca7de39e5168248968fa9c165b81d94b0e20f3df9b84db1fbdcd2eb87942dec5d3adbbe1a699eb51eeb4e1b2f0a88d0 SHA512 189c70343a410cf3f3c1589ef24c68a38b5270d8780d15261a124b8250f279a3c3c7afef38e6310d57cb1741b3ee75f0b4ac0bb9dfcf4a4fb0e7e6c0516faf74 +DIST rocThrust-5.7.1.tar.gz 1122808 BLAKE2B 41a5d57d03c7f95baf861b772c9513c7fbc26eee8a2f388897eb9b9f9fad3cdad81e2a79932c5b9a6d88b4e1596bf64e59e01337943a036ddb792f7b352ecd31 SHA512 52a9640808f0ed78ae2d6f25e741af59ae4e977535a0431f16c0fa1ee9a395e6f389cf29e61c02ac274cf16fcd193e5df6fb2edc340059ab282ed7cd877fc8b4 diff --git a/sci-libs/rocThrust/rocThrust-5.7.1.ebuild b/sci-libs/rocThrust/rocThrust-5.7.1.ebuild new file mode 100644 index 000000000000..68d0b7198b14 --- /dev/null +++ b/sci-libs/rocThrust/rocThrust-5.7.1.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake rocm + +DESCRIPTION="HIP back-end for the parallel algorithm library Thrust" +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocThrust" +SRC_URI="https://github.com/ROCmSoftwarePlatform/rocThrust/archive/rocm-${PV}.tar.gz -> rocThrust-${PV}.tar.gz" + +LICENSE="Apache-2.0" +KEYWORDS="~amd64" +SLOT="0/$(ver_cut 1-2)" +IUSE="benchmark test" +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +RESTRICT="!test? ( test )" + +RDEPEND="dev-util/hip + sci-libs/rocPRIM:${SLOT}[${ROCM_USEDEP}] + test? ( dev-cpp/gtest )" +DEPEND="${RDEPEND}" +BDEPEND=">=dev-util/cmake-3.22" + +S="${WORKDIR}/rocThrust-rocm-${PV}" + +PATCHES=( "${FILESDIR}/${PN}-4.0-operator_new.patch" ) + +src_prepare() { + sed -e "/PREFIX rocthrust/d" \ + -e "/DESTINATION/s:rocthrust/include/thrust:include/thrust:" \ + -e "/rocm_install_symlink_subdir(rocthrust)/d" \ + -e "/<INSTALL_INTERFACE/s:rocthrust/include/:include/:" -i thrust/CMakeLists.txt || die + + sed -e "s:\${CMAKE_INSTALL_INCLUDEDIR}:&/rocthrust:" \ + -e "s:\${ROCM_INSTALL_LIBDIR}:\${CMAKE_INSTALL_LIBDIR}:" -i cmake/ROCMExportTargetsHeaderOnly.cmake || die + + # disable downloading googletest and googlebenchmark + sed -r -e '/Downloading/{:a;N;/\n *\)$/!ba; d}' -i cmake/Dependencies.cmake || die + + # remove GIT dependency + sed -r -e '/find_package\(Git/{:a;N;/\nendif/!ba; d}' -i cmake/Dependencies.cmake || die + + eapply_user + cmake_src_prepare +} + +src_configure() { + addpredict /dev/kfd + addpredict /dev/dri/ + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DBUILD_TEST=$(usex test ON OFF) + -DBUILD_BENCHMARKS=$(usex benchmark ON OFF) + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + ) + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + # uses HMM to fit tests to default <512M iGPU VRAM + MAKEOPTS="-j1" ROCTHRUST_USE_HMM="1" cmake_src_test +} + +src_install() { + cmake_src_install + + use benchmark && dobin "${BUILD_DIR}"/benchmarks/benchmark_thrust_bench +}