summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2022-05-02 15:58:23 +0800
committerBenda Xu <heroxbd@gentoo.org>2022-05-02 16:24:41 +0800
commit284e771bd39b4709afddcc3dd666f5f8665c3754 (patch)
tree935c39f13c9d6feefa778f67cccf87612ede09c2 /sci-libs/rocPRIM/rocPRIM-4.3.0-r2.ebuild
parentdev-python/libvirt-python: Stabilize 8.2.0 x86, #841884 (diff)
downloadgentoo-284e771bd39b4709afddcc3dd666f5f8665c3754.tar.gz
gentoo-284e771bd39b4709afddcc3dd666f5f8665c3754.tar.bz2
gentoo-284e771bd39b4709afddcc3dd666f5f8665c3754.zip
sci-libs/hipCUB: loosen the dependency on dev-util/hip
sci-libs/hipSPARSE: sci-libs/rocPRIM: sci-libs/rocRAND: sci-libs/rocSOLVER: sci-libs/rocSPARSE: same The possibility is pointed out by Cory Bloor: You can probably build the versions of rocBLAS and rocSOLVER tagged at rocm-5.1.1 with the HIP stack from ROCm 4.3.1. Just be sure to rebuild all the {roc,hip}{BLAS,SOLVER} libraries at the new tag, since they all use private (unstable) APIs provided by rocBLAS. The sci-libs/* ROCm packages should be aligned with sci-libs/rocBLAS, while the other dev-*/* ROCm packages should be aligned with dev-util/hip. Credit: Cory Bloor Suggested-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Closes: https://bugs.gentoo.org/838394 Closes: https://bugs.gentoo.org/841982 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'sci-libs/rocPRIM/rocPRIM-4.3.0-r2.ebuild')
-rw-r--r--sci-libs/rocPRIM/rocPRIM-4.3.0-r2.ebuild77
1 files changed, 77 insertions, 0 deletions
diff --git a/sci-libs/rocPRIM/rocPRIM-4.3.0-r2.ebuild b/sci-libs/rocPRIM/rocPRIM-4.3.0-r2.ebuild
new file mode 100644
index 000000000000..eba4e1317b94
--- /dev/null
+++ b/sci-libs/rocPRIM/rocPRIM-4.3.0-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="HIP parallel primitives for developing performant GPU-accelerated code on ROCm"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocPRIM"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocPRIM/archive/rocm-${PV}.tar.gz -> rocPRIM-${PV}.tar.gz"
+
+LICENSE="MIT"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="benchmark test"
+
+RDEPEND="dev-util/hip
+ benchmark? ( dev-cpp/benchmark )"
+BDEPEND="dev-util/rocm-cmake
+ >=dev-util/cmake-3.22
+ test? ( dev-cpp/gtest )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/rocPRIM-rocm-${PV}"
+
+RESTRICT="!test? ( test )"
+
+src_prepare() {
+ # "hcc" is depcreated, new platform ist "rocclr"
+ sed -e "/HIP_PLATFORM STREQUAL/s,hcc,rocclr," -i cmake/VerifyCompiler.cmake || die
+
+ # Install according to FHS
+ sed -e "/PREFIX rocprim/d" \
+ -e "/INSTALL_INTERFACE/s,rocprim/include,include/rocprim," \
+ -e "/DESTINATION/s,rocprim/include,include," \
+ -e "/rocm_install_symlink_subdir(rocprim)/d" \
+ -i rocprim/CMakeLists.txt || 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
+
+ # install benchmark files
+ if use benchmark; then
+ sed -e "/get_filename_component/s,\${BENCHMARK_SOURCE},${PN}_\${BENCHMARK_SOURCE}," \
+ -e "/add_executable/a\ install(TARGETS \${BENCHMARK_TARGET})" -i benchmark/CMakeLists.txt || die
+ fi
+
+ eapply_user
+ cmake_src_prepare
+}
+
+src_configure() {
+ # Grant access to the device
+ addwrite /dev/kfd
+ addpredict /dev/dri/
+
+ # Compiler to use
+ export CXX=hipcc
+
+ local mycmakeargs=(
+ -DBUILD_TEST=$(usex test ON OFF)
+ -DBUILD_BENCHMARK=$(usex benchmark ON OFF)
+ ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ # Grant access to the device
+ addwrite /dev/kfd
+ addwrite /dev/dri/
+ cmake_src_test
+}