summaryrefslogtreecommitdiff
path: root/sci-libs/rocThrust
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/rocThrust')
-rw-r--r--sci-libs/rocThrust/Manifest4
-rw-r--r--sci-libs/rocThrust/files/rocThrust-4.0-operator_new.patch29
-rw-r--r--sci-libs/rocThrust/metadata.xml18
-rw-r--r--sci-libs/rocThrust/rocThrust-4.0.0-r1.ebuild49
4 files changed, 100 insertions, 0 deletions
diff --git a/sci-libs/rocThrust/Manifest b/sci-libs/rocThrust/Manifest
new file mode 100644
index 000000000000..b682dfc018b3
--- /dev/null
+++ b/sci-libs/rocThrust/Manifest
@@ -0,0 +1,4 @@
+AUX rocThrust-4.0-operator_new.patch 1699 BLAKE2B 1f8e4eb035768acd424cc2bae173c2c107b15b7f670c430ff5db5bb3657fdcafcea7933890176537c6147c1bee3cb675464d6d948724ba186868ff277eaa71f2 SHA512 5d9d48561e7feabc9341f13877d7e6bd49b59b140fe249956e87e785ed8afd1222aa1e7d77759af6ad8843e87d21362ba85ac9204bfcf160f30a4bcfb3d2e88b
+DIST rocThrust-4.0.0.tar.gz 1166346 BLAKE2B 02c89e0c4ab2c888a20b7c956a73012157f2735e6ec76369a1f75fbc17bb3f995d1914106ec58562f28243fbe5f019ac230ac3313b6aacb4d8b868f3ac1f091e SHA512 476aa5706487c5801cc91908806a1a1fcb550171f63e0b2debd9b59b18c7435c484578ec456ccfabc140dd7bca7d9bb432a7ba223946b1fca22e72e7d053af2d
+EBUILD rocThrust-4.0.0-r1.ebuild 1244 BLAKE2B 4f8019ccf296a915a305a405d3e80d2de348ac7717782671b76306882872a6e356bdbdb63316094ce8ccc8410fced42db56423b4d96f8d690ec6838d3721612e SHA512 40671932493ab5a2a2597a4181d03c666a9272ed881d053ecc8d8285aa8a5b68b9527b4fa0e29b6acff3f31fdfafd9cc060b9e098b16a12a7370eaa37542f5de
+MISC metadata.xml 548 BLAKE2B ae4848f909ba6a9e9695cdba7dd17fc2236b9234dff7c07d3f8356ced2f0c692788c2ec2bb922754180a1fd0af19cd38136685a00ce6e7de3247de96308b3327 SHA512 608b17dd7669411569fa066256463d8dafc15be2ce287b5229eb56d40da716d2abaeea55afec4a4759c6221f4a8042225a4abb30277d7670e9be6661a6c18aab
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 000000000000..2b78fd0053ed
--- /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 000000000000..b0a23ffc1e09
--- /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 000000000000..4ca8a58bad69
--- /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
+}