1 |
commit: f1fe0cd02be99ed18b07c5ba1ab6e6b913948a3d |
2 |
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon May 2 10:35:02 2022 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 3 05:41:34 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1fe0cd0 |
7 |
|
8 |
sci-libs/rocSPARSE: bump to 5.0.2 |
9 |
|
10 |
Enable navy_flounder cards via rocSPARSE-5.0.2-enable-gfx1031.patch |
11 |
|
12 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
13 |
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com> |
14 |
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> |
15 |
|
16 |
sci-libs/rocSPARSE/Manifest | 1 + |
17 |
.../files/rocSPARSE-5.0.2-enable-gfx1031.patch | 13 ++ |
18 |
...rocSPARSE-5.0.2-remove-matrices-unpacking.patch | 42 +++++++ |
19 |
sci-libs/rocSPARSE/rocSPARSE-5.0.2.ebuild | 139 +++++++++++++++++++++ |
20 |
4 files changed, 195 insertions(+) |
21 |
|
22 |
diff --git a/sci-libs/rocSPARSE/Manifest b/sci-libs/rocSPARSE/Manifest |
23 |
index 98aae8203d6a..8c89d77bdb72 100644 |
24 |
--- a/sci-libs/rocSPARSE/Manifest |
25 |
+++ b/sci-libs/rocSPARSE/Manifest |
26 |
@@ -1,5 +1,6 @@ |
27 |
DIST rocSPARSE-4.0.0.tar.gz 587761 BLAKE2B 25f9f0183c06b574505fe6e9011b32ea4fbe48c0a1883b8991baf45b8a2238312f352e614c0069531c986e548453b6e7b7a77f883dffea82ed41df488964b55d SHA512 4a4acf24a789ea58b53a8d06ea528a6aed8eabac21a7a3cd73011e9b31d03dceb488cc72f29c5513205f2b538d24e9dbaccda1a932bcc466cd04a65606a77b3b |
28 |
DIST rocSPARSE-4.3.0.tar.gz 809183 BLAKE2B 06a83d98572927f0f2c65f4f36194394b66a02a5ce9d3e21da04c53e9ad97809daffe02a35691aa52466f7dfb4d4a8c645b87e1e4da579de7f91323df3a41d59 SHA512 e3ee5a15d36c3002ee60aabd94c7f47b0cb9f0b5a33cefa9061df9f04b1fcc3c1503e4f01e2f36c07477179c6753827b505e9b512e8b5bfca00f76e3efd99c1d |
29 |
+DIST rocSPARSE-5.0.2.tar.gz 855762 BLAKE2B dc1e84157f1eecd6bedd6620147e4f88341b94cb0f1507a6264af40c891541ef3e81a8a429b3160dac1606a855a566abbff98e458f581f5f60de31d5751682ef SHA512 4f985c0784246616dd1b3e4fd669033296e45b1f8faa1ab25143e2f085b9bf6556a495de23e9463c2ae45d6038c1cff01d18930c9762d53975e15d4d2d5d4d0a |
30 |
DIST rocSPARSE_ASIC_320k.tar.gz 11301444 BLAKE2B a00cc4a3ededab3fb56339319e34e936645ddce2dee3c630153b37e337384c207b0a2829227fb7f4c2db1fe33383e97410ab7ad459d391c025f5410843d51cf2 SHA512 1db3af391c30a371c1ac0087436e266721474273a39d5b2b6d56408d950dcbbee004750e4dce4e3dbc4cb512f38f6d945676d7f29b62c52fd5a7fed0fe789e03 |
31 |
DIST rocSPARSE_Chebyshev4.tar.gz 50165660 BLAKE2B f1a95554c8f38937f501488fabfd406b773eb980d7463cadac0de162529ac2f834c655cadd2b65f4c42a8487bc2d67c749601ae33bd789051f9e4d1e157196a0 SHA512 fdec4947a4af923d28b4be8d23690fd6d356c58f8344a5dcdd2e3fa61769d83e47a84d65316b527e6e82d9f988de2675a852367d406e44b44d784137a90b95c0 |
32 |
DIST rocSPARSE_Chevron2.tar.gz 3210636 BLAKE2B 919bc19931cbcb32c09e6b623c9d3890400895dfd65e83845d351a8e3dd8b30ef43374c3c0ca3ee9708c81b5fb8886f1a4adbea6086495f08f9498f19a2279d5 SHA512 22b71deddec4f1af5b239d4065089230cf70e521102803a77ab3f16b34a0d69534817e54d81dfa7f8d1f299932c0f0424237baeb3d8289bcfffa4b902b00e256 |
33 |
|
34 |
diff --git a/sci-libs/rocSPARSE/files/rocSPARSE-5.0.2-enable-gfx1031.patch b/sci-libs/rocSPARSE/files/rocSPARSE-5.0.2-enable-gfx1031.patch |
35 |
new file mode 100644 |
36 |
index 000000000000..fd44bb938406 |
37 |
--- /dev/null |
38 |
+++ b/sci-libs/rocSPARSE/files/rocSPARSE-5.0.2-enable-gfx1031.patch |
39 |
@@ -0,0 +1,13 @@ |
40 |
+Index: rocSPARSE-rocm-5.0.2/library/src/include/common.h |
41 |
+=================================================================== |
42 |
+--- rocSPARSE-rocm-5.0.2.orig/library/src/include/common.h |
43 |
++++ rocSPARSE-rocm-5.0.2/library/src/include/common.h |
44 |
+@@ -167,7 +167,7 @@ __device__ __forceinline__ void rocspars |
45 |
+ if(BLOCKSIZE > 1) { if(i < 1 && i + 1 < BLOCKSIZE) { data[i] = min(data[i], data[i + 1]); } __syncthreads(); } |
46 |
+ } |
47 |
+ |
48 |
+-#ifndef __gfx1030__ |
49 |
++#if !defined(__gfx1030__) && !defined(__gfx1031__) |
50 |
+ // DPP-based wavefront reduction maximum |
51 |
+ template <unsigned int WFSIZE> |
52 |
+ __device__ __forceinline__ void rocsparse_wfreduce_max(int* maximum) |
53 |
|
54 |
diff --git a/sci-libs/rocSPARSE/files/rocSPARSE-5.0.2-remove-matrices-unpacking.patch b/sci-libs/rocSPARSE/files/rocSPARSE-5.0.2-remove-matrices-unpacking.patch |
55 |
new file mode 100644 |
56 |
index 000000000000..81d2b4ab1458 |
57 |
--- /dev/null |
58 |
+++ b/sci-libs/rocSPARSE/files/rocSPARSE-5.0.2-remove-matrices-unpacking.patch |
59 |
@@ -0,0 +1,42 @@ |
60 |
+Don't let cmake handle test data download, unpack and convert |
61 |
+ |
62 |
+Index: rocSPARSE-rocm-5.0.2/clients/tests/CMakeLists.txt |
63 |
+=================================================================== |
64 |
+--- rocSPARSE-rocm-5.0.2.orig/clients/tests/CMakeLists.txt |
65 |
++++ rocSPARSE-rocm-5.0.2/clients/tests/CMakeLists.txt |
66 |
+@@ -23,35 +23,6 @@ |
67 |
+ |
68 |
+ find_package(GTest 1.10.0 REQUIRED) |
69 |
+ |
70 |
+-# |
71 |
+-# Client matrices. |
72 |
+-# |
73 |
+- |
74 |
+-if(NOT EXISTS "${CMAKE_MATRICES_DIR}") |
75 |
+- # |
76 |
+- # Download. |
77 |
+- # |
78 |
+- set(CMAKE_MATRICES_DIR ${PROJECT_BINARY_DIR}/matrices CACHE STRING "Matrices directory.") |
79 |
+- |
80 |
+- if(NOT TARGET rocsparse) |
81 |
+- set(CONVERT_SOURCE ${CMAKE_SOURCE_DIR}/../deps/convert.cpp CACHE STRING "Convert tool mtx2csr.") |
82 |
+- include(${CMAKE_SOURCE_DIR}/../cmake/ClientMatrices.cmake) |
83 |
+- else() |
84 |
+- set(CONVERT_SOURCE ${CMAKE_SOURCE_DIR}/deps/convert.cpp CACHE STRING "Convert tool mtx2csr.") |
85 |
+- include(${CMAKE_SOURCE_DIR}/cmake/ClientMatrices.cmake) |
86 |
+- endif() |
87 |
+- |
88 |
+-else() |
89 |
+- |
90 |
+- # |
91 |
+- # Copy. |
92 |
+- # |
93 |
+- if(NOT CMAKE_MATRICES_DIR STREQUAL "${PROJECT_BINARY_DIR}/matrices") |
94 |
+- execute_process(COMMAND cp -r ${CMAKE_MATRICES_DIR} ${PROJECT_BINARY_DIR}/matrices) |
95 |
+- endif() |
96 |
+- |
97 |
+-endif() |
98 |
+- |
99 |
+ set(ROCSPARSE_TEST_SOURCES |
100 |
+ test_axpby.cpp |
101 |
+ test_axpyi.cpp |
102 |
|
103 |
diff --git a/sci-libs/rocSPARSE/rocSPARSE-5.0.2.ebuild b/sci-libs/rocSPARSE/rocSPARSE-5.0.2.ebuild |
104 |
new file mode 100644 |
105 |
index 000000000000..4203ba70e4de |
106 |
--- /dev/null |
107 |
+++ b/sci-libs/rocSPARSE/rocSPARSE-5.0.2.ebuild |
108 |
@@ -0,0 +1,139 @@ |
109 |
+# Copyright 1999-2022 Gentoo Authors |
110 |
+# Distributed under the terms of the GNU General Public License v2 |
111 |
+ |
112 |
+EAPI=8 |
113 |
+ |
114 |
+PYTHON_COMPAT=( python3_{8..10} ) |
115 |
+ |
116 |
+inherit cmake python-any-r1 toolchain-funcs |
117 |
+ |
118 |
+DESCRIPTION="Basic Linear Algebra Subroutines for sparse computation" |
119 |
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocSPARSE" |
120 |
+ |
121 |
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocSPARSE/archive/rocm-${PV}.tar.gz -> rocSPARSE-${PV}.tar.gz |
122 |
+test? ( |
123 |
+https://sparse.tamu.edu/MM/SNAP/amazon0312.tar.gz -> ${PN}_amazon0312.tar.gz |
124 |
+https://sparse.tamu.edu/MM/Muite/Chebyshev4.tar.gz -> ${PN}_Chebyshev4.tar.gz |
125 |
+https://sparse.tamu.edu/MM/FEMLAB/sme3Dc.tar.gz -> ${PN}_sme3Dc.tar.gz |
126 |
+https://sparse.tamu.edu/MM/Williams/webbase-1M.tar.gz -> ${PN}_webbase-1M.tar.gz |
127 |
+https://sparse.tamu.edu/MM/Bova/rma10.tar.gz -> ${PN}_rma10.tar.gz |
128 |
+https://sparse.tamu.edu/MM/JGD_BIBD/bibd_22_8.tar.gz -> ${PN}_bibd_22_8.tar.gz |
129 |
+https://sparse.tamu.edu/MM/Williams/mac_econ_fwd500.tar.gz -> ${PN}_mac_econ_fwd500.tar.gz |
130 |
+https://sparse.tamu.edu/MM/Williams/mc2depi.tar.gz -> ${PN}_mc2depi.tar.gz |
131 |
+https://sparse.tamu.edu/MM/Hamm/scircuit.tar.gz -> ${PN}_scircuit.tar.gz |
132 |
+https://sparse.tamu.edu/MM/Sandia/ASIC_320k.tar.gz -> ${PN}_ASIC_320k.tar.gz |
133 |
+https://sparse.tamu.edu/MM/GHS_psdef/bmwcra_1.tar.gz -> ${PN}_bmwcra_1.tar.gz |
134 |
+https://sparse.tamu.edu/MM/HB/nos1.tar.gz -> ${PN}_nos1.tar.gz |
135 |
+https://sparse.tamu.edu/MM/HB/nos2.tar.gz -> ${PN}_nos2.tar.gz |
136 |
+https://sparse.tamu.edu/MM/HB/nos3.tar.gz -> ${PN}_nos3.tar.gz |
137 |
+https://sparse.tamu.edu/MM/HB/nos4.tar.gz -> ${PN}_nos4.tar.gz |
138 |
+https://sparse.tamu.edu/MM/HB/nos5.tar.gz -> ${PN}_nos5.tar.gz |
139 |
+https://sparse.tamu.edu/MM/HB/nos6.tar.gz -> ${PN}_nos6.tar.gz |
140 |
+https://sparse.tamu.edu/MM/HB/nos7.tar.gz -> ${PN}_nos7.tar.gz |
141 |
+https://sparse.tamu.edu/MM/DNVS/shipsec1.tar.gz -> ${PN}_shipsec1.tar.gz |
142 |
+https://sparse.tamu.edu/MM/Cote/mplate.tar.gz -> ${PN}_mplate.tar.gz |
143 |
+https://sparse.tamu.edu/MM/Bai/qc2534.tar.gz -> ${PN}_qc2534.tar.gz |
144 |
+https://sparse.tamu.edu/MM/Chevron/Chevron2.tar.gz -> ${PN}_Chevron2.tar.gz |
145 |
+https://sparse.tamu.edu/MM/Chevron/Chevron3.tar.gz -> ${PN}_Chevron3.tar.gz |
146 |
+https://sparse.tamu.edu/MM/Chevron/Chevron4.tar.gz -> ${PN}_Chevron4.tar.gz |
147 |
+)" |
148 |
+ |
149 |
+LICENSE="MIT" |
150 |
+KEYWORDS="~amd64" |
151 |
+IUSE="benchmark test" |
152 |
+SLOT="0/$(ver_cut 1-2)" |
153 |
+ |
154 |
+RDEPEND="dev-util/hip |
155 |
+ sci-libs/rocPRIM:${SLOT}" |
156 |
+DEPEND="${RDEPEND}" |
157 |
+BDEPEND="test? ( |
158 |
+ dev-cpp/gtest |
159 |
+ >=dev-util/cmake-3.22 |
160 |
+ $(python_gen_any_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]') |
161 |
+) |
162 |
+benchmark? ( app-admin/chrpath ) |
163 |
+" |
164 |
+ |
165 |
+RESTRICT="!test? ( test )" |
166 |
+ |
167 |
+S="${WORKDIR}/rocSPARSE-rocm-${PV}" |
168 |
+ |
169 |
+PATCHES=( "${FILESDIR}/${PN}-5.0.2-remove-matrices-unpacking.patch" |
170 |
+ "${FILESDIR}/${PN}-5.0.2-enable-gfx1031.patch" ) |
171 |
+ |
172 |
+python_check_deps() { |
173 |
+ if use test; then |
174 |
+ has_version "dev-python/pyyaml[${PYTHON_USEDEP}]" |
175 |
+ fi |
176 |
+} |
177 |
+ |
178 |
+src_prepare() { |
179 |
+ eapply_user |
180 |
+ sed -e "s/PREFIX rocsparse//" \ |
181 |
+ -e "/<INSTALL_INTERFACE/s,include,include/rocsparse," \ |
182 |
+ -e "/rocm_install_symlink_subdir(rocsparse)/d" \ |
183 |
+ -e "s:rocsparse/include:include/rocsparse:" \ |
184 |
+ -i "${S}/library/CMakeLists.txt" || die |
185 |
+ |
186 |
+ # remove GIT dependency |
187 |
+ sed -e "/find_package(Git/d" -i cmake/Dependencies.cmake || die |
188 |
+ |
189 |
+ # use python interpreter specifyied by python-any-r1 |
190 |
+ sed -e "/COMMAND ..\/common\/rocsparse_gentest.py/s,COMMAND ,COMMAND ${EPYTHON} ," -i clients/tests/CMakeLists.txt || die |
191 |
+ |
192 |
+ # Test need download data from https://sparse.tamu.edu (or other mirror site), check MD5, unpack and convert them into csr format |
193 |
+ # This process is handled default by ${S}/cmake/ClientMatrices.cmake, but should be the responsibility of portage. |
194 |
+ if use test; then |
195 |
+ mkdir -p "${BUILD_DIR}"/clients/matrices |
196 |
+ # compile and use the mtx2csr converter. Do not use any optimization flags, because it causes error! |
197 |
+ ebegin "$(tc-getCXX) deps/convert.cpp -o deps/convert" |
198 |
+ $(tc-getCXX) deps/convert.cpp -o deps/convert |
199 |
+ eend $? |
200 |
+ find "${WORKDIR}" -maxdepth 2 -regextype egrep -regex ".*/(.*)/\1\.mtx" -print0 | |
201 |
+ while IFS= read -r -d '' mtxfile; do |
202 |
+ destination=${BUILD_DIR}/clients/matrices/$(basename -s '.mtx' ${mtxfile}).csr |
203 |
+ ebegin "Converting ${mtxfile} to ${destination}" |
204 |
+ deps/convert ${mtxfile} ${destination} |
205 |
+ eend $? |
206 |
+ done |
207 |
+ fi |
208 |
+ |
209 |
+ cmake_src_prepare |
210 |
+} |
211 |
+ |
212 |
+src_configure() { |
213 |
+ # Grant access to the device to omit a sandbox violation |
214 |
+ addwrite /dev/kfd |
215 |
+ addpredict /dev/dri/ |
216 |
+ |
217 |
+ # Compiler to use |
218 |
+ export CXX=hipcc |
219 |
+ |
220 |
+ local mycmakeargs=( |
221 |
+ -DBUILD_CLIENTS_SAMPLES=OFF |
222 |
+ -DCMAKE_INSTALL_INCLUDEDIR="include/rocsparse" |
223 |
+ -DCMAKE_SKIP_RPATH="ON" |
224 |
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) |
225 |
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF) |
226 |
+ ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"} |
227 |
+ ) |
228 |
+ |
229 |
+ cmake_src_configure |
230 |
+} |
231 |
+ |
232 |
+src_test() { |
233 |
+ addwrite /dev/kfd |
234 |
+ addwrite /dev/dri/ |
235 |
+ cd "${BUILD_DIR}/clients/staging" || die |
236 |
+ ./rocsparse-test || die |
237 |
+} |
238 |
+ |
239 |
+src_install() { |
240 |
+ cmake_src_install |
241 |
+ |
242 |
+ if use benchmark; then |
243 |
+ local rocsparse_bench="${BUILD_DIR}/clients/staging/rocsparse-bench" |
244 |
+ chrpath -d "${rocsparse_bench}" || die |
245 |
+ dobin "${rocsparse_bench}" |
246 |
+ fi |
247 |
+} |