diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-27 22:51:10 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-27 22:51:10 +0000 |
commit | ee0c4d5e506a6c64994a15c3af5cf1ca22045567 (patch) | |
tree | bdf578939023d42f04092ddb4bcd190eb391770f /sci-libs/rocBLAS | |
parent | 161eaa4b12ca6314376288834bba20b7824d0d77 (diff) |
gentoo auto-resync : 27:11:2023 - 22:51:09
Diffstat (limited to 'sci-libs/rocBLAS')
-rw-r--r-- | sci-libs/rocBLAS/Manifest | 3 | ||||
-rw-r--r-- | sci-libs/rocBLAS/files/rocBLAS-5.7.1-expand-isa-compatibility.patch | 132 | ||||
-rw-r--r-- | sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild | 107 |
3 files changed, 242 insertions, 0 deletions
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest index 985271bde4d1..eb5e4ead9b24 100644 --- a/sci-libs/rocBLAS/Manifest +++ b/sci-libs/rocBLAS/Manifest @@ -6,10 +6,13 @@ AUX rocBLAS-5.4.2-add-missing-header.patch 271 BLAKE2B 19e401ef1cc6d0d852a1338b7 AUX rocBLAS-5.4.2-cpp_lib_filesystem.patch 898 BLAKE2B 403b42f0193f2d21585fe8f8a851f673177930bea8ef0f1816bfebf7cc8765928f392bf6262128da8760b0283d4768bcfa1ff9a7cd2673dec4c1f0a114a61bd1 SHA512 ff914510474fb1869a75f161c7bbe8a9a82079b820e95fcb3ab87bf21cfbfb80cf91a17603e198411a20c25b5fd76771de6745203e4bcad2cbca0dfbfccdffd2 AUX rocBLAS-5.4.2-link-cblas.patch 508 BLAKE2B ab53db7c73cc174039880ebd8987adc88f83d61e84bf024e2a6367f5bc9414ac343843610382bae43b4dcf874f6cf9e91bc3bd865264e37517f280d50881b4ff SHA512 fa91f817a06f517b38d3d3a71110da59d6579bf7915d6f47deefc46c532ca10d17802815662d8909ee52fb155b82339122601793858e52c13c6cc93cac283fc9 AUX rocBLAS-5.4.2-unbundle-Tensile.patch 1373 BLAKE2B 944771b7511de883aa106016cf59e3cb94248119af472aed75c76c712fc9ee2e9e765d472ef727776d95ee478f1701c12853c37be269ee4940a3cde9e1f41cc7 SHA512 bdf01803a0594b53f248bc57594e7bed2f3f4cc772de8b5a043fa849798887291cb14d273511d33453c0685a113a9064a218a56d57631d2e9c1126eb62853668 +AUX rocBLAS-5.7.1-expand-isa-compatibility.patch 3771 BLAKE2B 3be8a45734c4d3ce0d54981e48685c500d6cf8ba1981b6035f2cb83cad1c221afcf50e5d9fbdaa9966ce64e99845c57b32267adda7983bb9a511fec661a0cfeb SHA512 86eedaa1bf6d0430f4b059d9257539dd95d56bdfc0cb61ceb0d180e29f76e280505c8b0002eba71c8152522c637917cd0b9ac7fb2f07059b3b5b6076f8ac7c59 DIST rocBLAS-5.0.2-Tensile-asm_full-navi22.tar.gz 1110323 BLAKE2B 80fab97c6f89fccf1f8829ad41baf15ad31bbbb313b48825841834c7ec1b9f8ece794aebdf9fda42b54a38f642beb1bc1e374f2f3b4e43d8ba9dfd1eb6e3ece5 SHA512 8f6946cf9d68afd195640ae7e0da8dc33341c67f28813813b5361a56531fa2af4453d075703ea52c66d93a1936cf74688b86aa2fa62b52a7ed5f03272290c232 DIST rocBLAS-5.4.2-Tensile-asm_full-navi22.tar.gz 1057686 BLAKE2B aa755595bbcd48775713f1d94c18b9bfa6464cae97653dd5beda9e4ed600802b62c4159e6edef7fbd4c92e629bbda1c284e6c48e096c7eaf22bbaad86bdcdace SHA512 cdc928528e7ce5bcc3ae32ec18e3aee48533f24e77c1e42f6e0398858eefebd52b8812caabe01a0ef7fa552e00118b862e025f1675a9642b009f1e38efbcdd53 DIST rocm-rocBLAS-5.1.3.tar.gz 13741546 BLAKE2B af10d8cb69bee44ef5aab2dc350e1d9f3b6fddb3a840c17230c4b55b2649a4724c9f2e58c1eafdb3e2716eea016a72a35c3ddb498881b1ce682d780baa8d8b07 SHA512 5ab71838fdd0e9c5848cbf28a19d113353b619a878d8c7d05f64feb32faae2054169c95ed6e9dd6b05a2e807b57229dd2c361c4d289b6e6f17c196558640890f DIST rocm-rocBLAS-5.4.2.tar.gz 15938434 BLAKE2B 14ebafa944fdac443800bb7f9b16f8ecf0f420b168d3c6534f68ad7d14bf058a4cc1673fce8f4b9be53e4a6c1cf05011e01853cd901bce0b59827d2aca4d029f SHA512 e62bb80457c1e89454885499bdce9d60beecd706806724418983c78c65c2ae303550f9670b5a6e71dae6a61c0e42b223ab01b36b8406430731ebcbff54c4a8f4 +DIST rocm-rocBLAS-5.7.1.tar.gz 55389700 BLAKE2B 9e58b1d29c8a04aa58ce17fdd9b0c2504934261851619dc5b696a04e8c6a79e7c44d86a6db7a9c76a434d76593de8c191cba6f163cf398d01cfc001e5fa32b5a SHA512 cfc73f6c490595a3c153c2ac2a3cb5926c48c2c19baa07ff3dcdf3a7ccaed82cfdff64ed5a3be64c349cb43d654d4b104d9090e2ec9f2061049d6a4921c07722 EBUILD rocBLAS-5.1.3-r4.ebuild 3049 BLAKE2B 815430fdd86ba2e7afabce58d0b2b0495f6faa4cd483695e40d1af67508898b52569a575494f5c99402c68ef5ce9854add762322ae71e9269f4a7bb5db316100 SHA512 88a76f6e9b6a759e4d49a3fcdeb6731dfef2d521a6d91380c7c8b13236c80ec847d450235b45af2cc7e2b950ebd673f386669f95908d51b28c8b8c52bd8dc8f0 EBUILD rocBLAS-5.4.2-r3.ebuild 2688 BLAKE2B 08a03bdc96a5998ad04b42c2e86d6ec8fde2025f923ba5dfa5e34539cf2ea253018348afa4bed7fb25343b2801b40295f8486f4b3de39d07ddabd81b45cc05f1 SHA512 826ffb25f76c48cd044c54cdd6f318f8c6eba9bd03dc272391e3a3df7d5380f756459215b92879557da80afd149f32dac5af4f85316d91ce4372108eb300754a +EBUILD rocBLAS-5.7.1-r1.ebuild 2495 BLAKE2B 238de5d08237cda486b1e1c50b0255d70f3f05a878c2b17154bd9d0789342a134901ded44d0198cc0b9ca79094380b88f99b43d55aa5e1a5be5b42e6b1f46438 SHA512 9dc53bb0e888f7bf63478b0a4495428adae6678c88f865f6234a736a1b62f794e300880e98c4c7911c3c6693590dc140f3bd1404d8a23eafc84c1d1deeb11e33 MISC metadata.xml 739 BLAKE2B 38ace9571ca717a5bf7251888b4537522326f34778be98cfe717a06dbbd3a04a2bf905ec1cabafe9bbd3fea90adfb5c25c8b41e46c034a7793363ea5fc0c7f29 SHA512 60f1d5aa2a6ebe17cfcf24780529e1eef521bb7c838e48d18180a52d580cf91430ac1f4fdd0e70b9804ec5f0b5957dbd431149f6e0b0b9033cf8ad683510c582 diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.7.1-expand-isa-compatibility.patch b/sci-libs/rocBLAS/files/rocBLAS-5.7.1-expand-isa-compatibility.patch new file mode 100644 index 000000000000..c5c5d4750393 --- /dev/null +++ b/sci-libs/rocBLAS/files/rocBLAS-5.7.1-expand-isa-compatibility.patch @@ -0,0 +1,132 @@ +Allow rocBLAS to load the compatible kernels when running on +architectures compatible with those ISAs. + +Based on patch from Cordell Bloor <cgmb@slerp.xyz> +https://salsa.debian.org/rocm-team/rocblas/-/blob/master/debian/patches/0012-expand-isa-compatibility.patch + +--- a/library/src/handle.cpp ++++ b/library/src/handle.cpp +@@ -21,6 +21,7 @@ + * ************************************************************************ */ + #include "handle.hpp" + #include <cstdarg> ++#include <cstring> + #include <limits> + #ifdef WIN32 + #include <windows.h> +@@ -77,6 +78,31 @@ static inline int getActiveArch(int deviceId) + { + hipDeviceProp_t deviceProperties; + hipGetDeviceProperties(&deviceProperties, deviceId); ++ // coerce to compatible arch ++ switch(deviceProperties.gcnArch) ++ { ++ case 902: ++ case 909: ++ case 912: ++ deviceProperties.gcnArch = 900; ++ std::strcpy(deviceProperties.gcnArchName, "gfx900"); ++ break; ++ case 1011: ++ case 1012: ++ case 1013: ++ deviceProperties.gcnArch = 1010; ++ std::strcpy(deviceProperties.gcnArchName, "gfx1010"); ++ break; ++ case 1031: ++ case 1032: ++ case 1033: ++ case 1034: ++ case 1035: ++ case 1036: ++ deviceProperties.gcnArch = 1030; ++ std::strcpy(deviceProperties.gcnArchName, "gfx1030"); ++ break; ++ } + return deviceProperties.gcnArch; + } + +--- a/library/src/rocblas_auxiliary.cpp ++++ b/library/src/rocblas_auxiliary.cpp +@@ -24,6 +24,7 @@ + #include "logging.hpp" + #include "rocblas-auxiliary.h" + #include <cctype> ++#include <cstring> + #include <cstdlib> + #include <memory> + #include <string> +@@ -1285,6 +1286,31 @@ std::string rocblas_internal_get_arch_name() + hipGetDevice(&deviceId); + hipDeviceProp_t deviceProperties; + hipGetDeviceProperties(&deviceProperties, deviceId); ++ // coerce to compatible arch ++ switch(deviceProperties.gcnArch) ++ { ++ case 902: ++ case 909: ++ case 912: ++ deviceProperties.gcnArch = 900; ++ std::strcpy(deviceProperties.gcnArchName, "gfx900"); ++ break; ++ case 1011: ++ case 1012: ++ case 1013: ++ deviceProperties.gcnArch = 1010; ++ std::strcpy(deviceProperties.gcnArchName, "gfx1010"); ++ break; ++ case 1031: ++ case 1032: ++ case 1033: ++ case 1034: ++ case 1035: ++ case 1036: ++ deviceProperties.gcnArch = 1030; ++ std::strcpy(deviceProperties.gcnArchName, "gfx1030"); ++ break; ++ } + return ArchName<hipDeviceProp_t>{}(deviceProperties); + } + +--- a/library/src/tensile_host.cpp ++++ b/library/src/tensile_host.cpp +@@ -45,6 +45,7 @@ extern "C" void rocblas_shutdown(); + #include <Tensile/hip/HipUtils.hpp> + #include <atomic> + #include <complex> ++#include <cstring> + #include <exception> + #include <future> + #include <iomanip> +@@ -837,6 +838,31 @@ namespace + + hipDeviceProp_t prop; + HIP_CHECK_EXC(hipGetDeviceProperties(&prop, deviceId)); ++ // coerce to compatible arch ++ switch(prop.gcnArch) ++ { ++ case 902: ++ case 909: ++ case 912: ++ prop.gcnArch = 900; ++ std::strcpy(prop.gcnArchName, "gfx900"); ++ break; ++ case 1011: ++ case 1012: ++ case 1013: ++ prop.gcnArch = 1010; ++ std::strcpy(prop.gcnArchName, "gfx1010"); ++ break; ++ case 1031: ++ case 1032: ++ case 1033: ++ case 1034: ++ case 1035: ++ case 1036: ++ prop.gcnArch = 1030; ++ std::strcpy(prop.gcnArchName, "gfx1030"); ++ break; ++ } + + m_deviceProp = std::make_shared<hipDeviceProp_t>(prop); + diff --git a/sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild b/sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild new file mode 100644 index 000000000000..e1f9a4b8e8f0 --- /dev/null +++ b/sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DOCS_BUILDER="doxygen" +DOCS_DIR="docs" +DOCS_DEPEND="media-gfx/graphviz" +ROCM_VERSION=${PV} +inherit cmake docs edo multiprocessing rocm + +DESCRIPTION="AMD's library for BLAS on ROCm" +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS" +SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz" +S="${WORKDIR}/${PN}-rocm-${PV}" + +LICENSE="BSD" +KEYWORDS="~amd64" +SLOT="0/$(ver_cut 1-2)" +RESTRICT="!test? ( test )" +IUSE="benchmark test" +REQUIRED_USE="${ROCM_REQUIRED_USE}" + +BDEPEND=" + >=dev-util/rocm-cmake-5.3 + dev-util/Tensile:${SLOT} + dev-python/joblib + test? ( dev-cpp/gtest ) +" + +DEPEND=" + >=dev-cpp/msgpack-cxx-6.0.0 + dev-util/hip + test? ( + virtual/blas + dev-cpp/gtest + sys-libs/libomp + ) + benchmark? ( + virtual/blas + sys-libs/libomp + ) +" + +QA_FLAGS_IGNORED="/usr/lib64/rocblas/library/.*" + +PATCHES=( + "${FILESDIR}"/${PN}-5.4.2-cpp_lib_filesystem.patch + "${FILESDIR}"/${PN}-5.4.2-add-missing-header.patch + "${FILESDIR}"/${PN}-5.4.2-link-cblas.patch + "${FILESDIR}"/${PN}-5.7.1-expand-isa-compatibility.patch + ) + +src_prepare() { + cmake_src_prepare + sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die +} + +src_configure() { + addpredict /dev/random + addpredict /dev/kfd + addpredict /dev/dri/ + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=On + -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF + -DROCM_SYMLINK_LIBS=OFF + -DAMDGPU_TARGETS="$(get_amdgpu_flags)" + -DTensile_LOGIC="asm_full" + -DTensile_COMPILER="hipcc" + -DTensile_LIBRARY_FORMAT="msgpack" + -DTensile_CODE_OBJECT_VERSION="default" + -DTensile_ROOT="${EPREFIX}/usr/share/Tensile" + -DBUILD_WITH_TENSILE=ON + -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas" + -DBUILD_CLIENTS_SAMPLES=OFF + -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) + -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF) + -DTensile_CPU_THREADS=$(makeopts_jobs) + -DBUILD_WITH_PIP=OFF + ) + + CXX=hipcc cmake_src_configure +} + +src_compile() { + docs_compile + cmake_src_compile +} + +src_test() { + check_amdgpu + cd "${BUILD_DIR}"/clients/staging || die + export ROCBLAS_TEST_TIMEOUT=3600 ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library" + export LD_LIBRARY_PATH="${BUILD_DIR}/clients:${BUILD_DIR}/library/src" + edob ./${PN,,}-test +} + +src_install() { + cmake_src_install + + if use benchmark; then + cd "${BUILD_DIR}" || die + dolib.a clients/librocblas_fortran_client.a + dobin clients/staging/rocblas-bench + fi +} |