* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocThrust/, sci-libs/rocThrust/files/
@ 2021-01-24 7:49 Benda XU
0 siblings, 0 replies; 2+ messages in thread
From: Benda XU @ 2021-01-24 7:49 UTC (permalink / raw
To: gentoo-commits
commit: 21458c9061094f1fa0a47c93c1416c31bc6dc7de
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 21 11:36:45 2021 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Jan 24 07:45:41 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21458c90
sci-libs/rocThrust: ROCm backend for Thrust.
Bug: https://bugs.gentoo.org/650804
Bug: https://github.com/gentoo/gentoo/pull/10724
Suggested-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Suggested-by: Wilfried Holzke <gentoo <AT> holzke.net>
Package-Manager: Portage-3.0.12, Repoman-3.0.1
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
sci-libs/rocThrust/Manifest | 1 +
.../files/rocThrust-4.0-operator_new.patch | 29 +++++++++++++
sci-libs/rocThrust/metadata.xml | 18 ++++++++
sci-libs/rocThrust/rocThrust-4.0.0-r1.ebuild | 49 ++++++++++++++++++++++
4 files changed, 97 insertions(+)
diff --git a/sci-libs/rocThrust/Manifest b/sci-libs/rocThrust/Manifest
new file mode 100644
index 00000000000..282c08da9b9
--- /dev/null
+++ b/sci-libs/rocThrust/Manifest
@@ -0,0 +1 @@
+DIST rocThrust-4.0.0.tar.gz 1166346 BLAKE2B 02c89e0c4ab2c888a20b7c956a73012157f2735e6ec76369a1f75fbc17bb3f995d1914106ec58562f28243fbe5f019ac230ac3313b6aacb4d8b868f3ac1f091e SHA512 476aa5706487c5801cc91908806a1a1fcb550171f63e0b2debd9b59b18c7435c484578ec456ccfabc140dd7bca7d9bb432a7ba223946b1fca22e72e7d053af2d
diff --git a/sci-libs/rocThrust/files/rocThrust-4.0-operator_new.patch b/sci-libs/rocThrust/files/rocThrust-4.0-operator_new.patch
new file mode 100644
index 00000000000..2b78fd0053e
--- /dev/null
+++ b/sci-libs/rocThrust/files/rocThrust-4.0-operator_new.patch
@@ -0,0 +1,29 @@
+# Use copy assignment instead of copy constructor to avoid unavailability of placement new operator.
+# But more likely there is another hidden bug, since this syntax is actually correct.
+# There are still similar syntax remain in other headers, which may cause identical compilation error.
+
+# Suggested by Yuyi Wang <strawberry_str@hotmail.com>
+diff --color -uprN rocThrust-rocm-4.0.0.orig/thrust/system/hip/detail/uninitialized_copy.h rocThrust-rocm-4.0.0/thrust/system/hip/detail/uninitialized_copy.h
+--- rocThrust-rocm-4.0.0.orig/thrust/system/hip/detail/uninitialized_copy.h 2021-01-21 20:42:44.439246148 +0800
++++ rocThrust-rocm-4.0.0/thrust/system/hip/detail/uninitialized_copy.h 2021-01-21 21:13:20.926840762 +0800
+@@ -62,7 +62,7 @@ namespace __uninitialized_copy
+ InputType const& in = raw_reference_cast(input[idx]);
+ OutputType& out = raw_reference_cast(output[idx]);
+
+- ::new(static_cast<void*>(&out)) OutputType(in);
++ out = in;
+ }
+ }; // struct functor
+
+diff --color -uprN rocThrust-rocm-4.0.0.orig/thrust/system/hip/detail/uninitialized_fill.h rocThrust-rocm-4.0.0/thrust/system/hip/detail/uninitialized_fill.h
+--- rocThrust-rocm-4.0.0.orig/thrust/system/hip/detail/uninitialized_fill.h 2021-01-21 20:42:44.439246148 +0800
++++ rocThrust-rocm-4.0.0/thrust/system/hip/detail/uninitialized_fill.h 2021-01-21 21:13:07.022489406 +0800
+@@ -59,7 +59,7 @@ namespace __uninitialized_fill
+ {
+ value_type& out = raw_reference_cast(items[idx]);
+
+- ::new(static_cast<void*>(&out)) value_type(value);
++ out = value;
+ }
+ }; // struct functor
+ } // namespace __uninitialized_copy
diff --git a/sci-libs/rocThrust/metadata.xml b/sci-libs/rocThrust/metadata.xml
new file mode 100644
index 00000000000..b0a23ffc1e0
--- /dev/null
+++ b/sci-libs/rocThrust/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>candrews@gentoo.org</email>
+ <name>Craig Andrews</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>gentoo@holzke.net</email>
+ <name>Wilfried Holzke</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">ROCm-Developer-Tools/rocThrust</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-libs/rocThrust/rocThrust-4.0.0-r1.ebuild b/sci-libs/rocThrust/rocThrust-4.0.0-r1.ebuild
new file mode 100644
index 00000000000..4ca8a58bad6
--- /dev/null
+++ b/sci-libs/rocThrust/rocThrust-4.0.0-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="Thrust dependent software on AMD GPUs"
+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"
+
+RDEPEND=">=dev-util/hip-${PV}
+ =sci-libs/rocPRIM-${PV}*"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/rocThrust-rocm-${PV}"
+
+PATCHES="${FILESDIR}/rocThrust-4.0-operator_new.patch"
+
+src_prepare() {
+ sed -e "/PREFIX rocthrust/d" \
+ -e "/DESTINATION/s:rocthrust/include/thrust:include/rocthrust/thrust:" \
+ -e "/rocm_install_symlink_subdir(rocthrust)/d" \
+ -e "/<INSTALL_INTERFACE/s:rocthrust/include/:include/rocthrust/:" -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
+
+ 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=OFF
+ )
+
+ cmake_src_configure
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocThrust/, sci-libs/rocThrust/files/
@ 2021-11-06 4:53 Benda XU
0 siblings, 0 replies; 2+ messages in thread
From: Benda XU @ 2021-11-06 4:53 UTC (permalink / raw
To: gentoo-commits
commit: d89374796f7e7ee37eaf2881d7b86074542fc999
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Thu Aug 26 03:19:10 2021 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Nov 6 04:52:29 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8937479
sci-libs/rocThrust: bump version to 4.3.0
Enable benchmark and test build options
Closes: https://github.com/gentoo/gentoo/pull/22803
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
sci-libs/rocThrust/Manifest | 1 +
.../rocThrust-4.3.0-deprecate-hcc_detail.patch | 13 ++++
sci-libs/rocThrust/metadata.xml | 3 +
sci-libs/rocThrust/rocThrust-4.3.0.ebuild | 76 ++++++++++++++++++++++
4 files changed, 93 insertions(+)
diff --git a/sci-libs/rocThrust/Manifest b/sci-libs/rocThrust/Manifest
index 282c08da9b9..d94ba9ef58d 100644
--- a/sci-libs/rocThrust/Manifest
+++ b/sci-libs/rocThrust/Manifest
@@ -1 +1,2 @@
DIST rocThrust-4.0.0.tar.gz 1166346 BLAKE2B 02c89e0c4ab2c888a20b7c956a73012157f2735e6ec76369a1f75fbc17bb3f995d1914106ec58562f28243fbe5f019ac230ac3313b6aacb4d8b868f3ac1f091e SHA512 476aa5706487c5801cc91908806a1a1fcb550171f63e0b2debd9b59b18c7435c484578ec456ccfabc140dd7bca7d9bb432a7ba223946b1fca22e72e7d053af2d
+DIST rocThrust-4.3.0.tar.gz 1156832 BLAKE2B a462cfaa31883253fabba584ca77622cc5a7234bd9979472a84ec77b91c60f48f1064149b86d624aaedd70262fb65fb6aadb03cc6e00939d4eed6cd11bfc0090 SHA512 8c6aa3aefd59c87cc8278930bf90021867f519c356c86a3c3ebfcdf90887b8631250b6a9a8156f77c0cbf7ddbad7881e5e1b802f1cd1305cc3a2e7d95ef4e6f3
diff --git a/sci-libs/rocThrust/files/rocThrust-4.3.0-deprecate-hcc_detail.patch b/sci-libs/rocThrust/files/rocThrust-4.3.0-deprecate-hcc_detail.patch
new file mode 100644
index 00000000000..a923a016f96
--- /dev/null
+++ b/sci-libs/rocThrust/files/rocThrust-4.3.0-deprecate-hcc_detail.patch
@@ -0,0 +1,13 @@
+https://github.com/ROCmSoftwarePlatform/rocThrust/issues/180
+
+--- orig/thrust/system/hip/detail/guarded_driver_types.h
++++ rocThrust-rocm-4.3.0/thrust/system/hip/detail/guarded_driver_types.h
+@@ -47,7 +47,7 @@
+ # endif // __DRIVER_TYPES_H__
+ #endif // __GNUC__
+
+-#include <hip/hcc_detail/host_defines.h>
++#include <hip/amd_detail/host_defines.h>
+
+ #if !defined(__GNUC__) || ((10000 * __GNUC__ + 100 * __GNUC_MINOR__ + __GNUC_PATCHLEVEL__) >= 40500)
+ # ifdef THRUST_HOST_NEEDS_RESTORATION
diff --git a/sci-libs/rocThrust/metadata.xml b/sci-libs/rocThrust/metadata.xml
index 2de21c17fe6..20ece3c2955 100644
--- a/sci-libs/rocThrust/metadata.xml
+++ b/sci-libs/rocThrust/metadata.xml
@@ -15,4 +15,7 @@
<upstream>
<remote-id type="github">ROCm-Developer-Tools/rocThrust</remote-id>
</upstream>
+ <use>
+ <flag name="benchmark">Build and install benchmark binary.</flag>
+ </use>
</pkgmetadata>
diff --git a/sci-libs/rocThrust/rocThrust-4.3.0.ebuild b/sci-libs/rocThrust/rocThrust-4.3.0.ebuild
new file mode 100644
index 00000000000..5063cf4dbce
--- /dev/null
+++ b/sci-libs/rocThrust/rocThrust-4.3.0.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+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"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-util/hip:${SLOT}
+ sci-libs/rocPRIM:${SLOT}"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/rocThrust-rocm-${PV}"
+
+PATCHES=( "${FILESDIR}/${PN}-4.0-operator_new.patch"
+ "${FILESDIR}/${P}-deprecate-hcc_detail.patch" )
+
+src_prepare() {
+ sed -e "/PREFIX rocthrust/d" \
+ -e "/DESTINATION/s:rocthrust/include/thrust:include/rocthrust/thrust:" \
+ -e "/rocm_install_symlink_subdir(rocthrust)/d" \
+ -e "/<INSTALL_INTERFACE/s:rocthrust/include/:include/rocthrust/:" -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() {
+ # 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_BENCHMARKS=$(usex benchmark ON OFF)
+ ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
+ -D__skip_rocmclang="ON" ## fix cmake-3.21 configuration issue caused by officialy support programming language "HIP"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ # Grant access to the device
+ addwrite /dev/kfd
+ addwrite /dev/dri/
+ cmake_src_test
+}
+
+src_install() {
+ cmake_src_install
+
+ use benchmark && dobin "${BUILD_DIR}"/benchmarks/benchmark_thrust_bench
+}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-06 4:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-06 4:53 [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocThrust/, sci-libs/rocThrust/files/ Benda XU
-- strict thread matches above, loose matches on Subject: below --
2021-01-24 7:49 Benda XU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox