summaryrefslogtreecommitdiff
path: root/sci-libs/rocBLAS
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/rocBLAS')
-rw-r--r--sci-libs/rocBLAS/Manifest9
-rw-r--r--sci-libs/rocBLAS/files/rocBLAS-5.4.2-add-missing-header.patch14
-rw-r--r--sci-libs/rocBLAS/files/rocBLAS-5.4.2-cpp_lib_filesystem.patch24
-rw-r--r--sci-libs/rocBLAS/files/rocBLAS-5.4.2-link-cblas.patch12
-rw-r--r--sci-libs/rocBLAS/files/rocBLAS-5.4.2-unbundle-Tensile.patch26
-rw-r--r--sci-libs/rocBLAS/metadata.xml11
-rw-r--r--sci-libs/rocBLAS/rocBLAS-5.4.2.ebuild107
7 files changed, 198 insertions, 5 deletions
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest
index 9f7676fad6dc..61cdbf7bf054 100644
--- a/sci-libs/rocBLAS/Manifest
+++ b/sci-libs/rocBLAS/Manifest
@@ -3,9 +3,16 @@ AUX rocBLAS-5.0.2-change-default-Tensile-library-dir.patch 2070 BLAKE2B b90c3165
AUX rocBLAS-5.0.2-cpp_lib_filesystem.patch 1546 BLAKE2B e9a794a87b76a41d059c755565ae5da9a361b0c4648a92dd5ce35f9b5bd8c743827fcf79752c393a786c30083cd7db59bc334599d414920ce72c24216d014124 SHA512 e80ac744ce44bc9023de2600290c37577bda6161bfe750ac2b746d8fea7b45334a96461baa74131d0e31db497f8dd123ccd5dc181a40b265c2e2c72e1e479e88
AUX rocBLAS-5.0.2-respect-makeopts.patch 3409 BLAKE2B dc97390feba6ab3900ec18fd7b86d4bb25baff4565ccddf0dae025ab5fa8330f16a2dddb1055c32be7132581e9aa1a83ff1e3c77cc69f5f6c641c1e40447fffc SHA512 63ffde4f98f3f3e2d72e11f3877640b2b525c25e8730b3497be97d71dae4b2f9b08c351f548356c9011c1767d5a451badd790963d773a45946994a48e5810b29
AUX rocBLAS-5.0.2-unbundle-Tensile.patch 1352 BLAKE2B 48300030abee9898397919cbbea187fd16d770e20cdcfddd7665c160f47e362ad63acf9f443f86d824a999398d0c6f5aee8295a963dce2653bc94518c8ac9674 SHA512 39c4aff4fc60692e0450aa844ce979afe031c3ba3adb0cdf0866d0766714bf28a4c5664c18de7520b63d3fc2864de51939a596e864e97d0b8935681cabd7a84d
+AUX rocBLAS-5.4.2-add-missing-header.patch 271 BLAKE2B 19e401ef1cc6d0d852a1338b79fd5b99c03077d830d75c9260c8437c984d85431ae3d508a4178116ae4ddb000e904ff01de759d86d65056671704c4e79b9f0a1 SHA512 055e35eb53b582f1da270f3ccab4b8705600814461ceeae80ce73e1845380a716e1ccc7c1ec66def6ff17b4daee3f279ab468e2d7c9c704def9d7d80c2756e3a
+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
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.0.2.tar.gz 13295178 BLAKE2B e1abfa06b9ac1545732465857839dae3f3708af49439a306a2b5b1b1b392101c38c95815f2c05a0d9ed29d41b154bc2e16a4f9203a37f5e2f68ee12cc4b44a06 SHA512 2f4a74f49350ede0debcf32229a6b6b95505615723c3f2bee16e4c169a3bb966dfb1971819028f47c525f571bea5662b892e63f655b0d1d2b8f20746bc5fe770
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
EBUILD rocBLAS-5.0.2-r2.ebuild 3844 BLAKE2B 533b6eb02440c1a485d9933b88a5e554fac7638b72e2209dfe8ab83cea53575cdb2e0ae968c8206fda18aca6a695c38df97457d0ea36832f096b0e92af4c91c3 SHA512 aa8e6749b96e54bc3881a265f8719d6c48995f12b033ed6166f30935d2c47ddfaf52af5f7feaf9911aa47c3b4e628a50eedf9f1ffbefbb5923d5996acedd7383
EBUILD rocBLAS-5.1.3.ebuild 3046 BLAKE2B 8c508afc782607532296e3439923db2f2f4b4cc4b9c59c18fd331b16819c82f78a5196cc8852650b1829761fcc8e73105ab96767b68fc00e3b1bb325aa3ec039 SHA512 7a85e77c2a8cc2be8305dd0137bb63446e80a5cfb039bdad07da1c35daf0a49fbadb94b65686f35c445f285378f69e48ba68c4cde26f408c265864a91a131558
-MISC metadata.xml 654 BLAKE2B b8a1d40e2ccc2aadccb9a1200e9c78fccb37544fa01c353645372a4ed01a6d153c04ff5d0d96cd7661e80b09eb6c69e8cbc59e466fef117ea1ad5ef54b1334ae SHA512 b880f8f495aee8c337b7cac4054a30f877a1204d0cda03fa90aaa25e4ae163d435c113141f2afef62967f603dea372419b228655e1b26fff53c010c8efdcebf1
+EBUILD rocBLAS-5.4.2.ebuild 2677 BLAKE2B 775888b43b7d4a87624fb988452c706e0572d363bdb317de63553ba0b1c2b2f8e524ba3f5b71e19ff958654ecc251834a348a29b3f2cd69a325e119827920d73 SHA512 31c03a389e8e516914198f3f0f76b597950d849e8e72bdba4f41338e1d14feef7706d7562998b4c8c85b5d2c5d43668650e91a1178dd33beb2df5768c2c24a1d
+MISC metadata.xml 739 BLAKE2B 38ace9571ca717a5bf7251888b4537522326f34778be98cfe717a06dbbd3a04a2bf905ec1cabafe9bbd3fea90adfb5c25c8b41e46c034a7793363ea5fc0c7f29 SHA512 60f1d5aa2a6ebe17cfcf24780529e1eef521bb7c838e48d18180a52d580cf91430ac1f4fdd0e70b9804ec5f0b5957dbd431149f6e0b0b9033cf8ad683510c582
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.4.2-add-missing-header.patch b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-add-missing-header.patch
new file mode 100644
index 000000000000..cefad2bad61a
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-add-missing-header.patch
@@ -0,0 +1,14 @@
+Mitigate compilation issue.
+
+std::bad_alloc is defined in <new>
+--- a/clients/include/host_alloc.hpp
++++ b/clients/include/host_alloc.hpp
+@@ -22,6 +22,8 @@
+
+ #pragma once
+
++#include <new>
++
+ //!
+ //! @brief Host free memory w/o swap. Returns kB or -1 if unknown.
+ //!
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.4.2-cpp_lib_filesystem.patch b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-cpp_lib_filesystem.patch
new file mode 100644
index 000000000000..688fe7eb5bc3
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-cpp_lib_filesystem.patch
@@ -0,0 +1,24 @@
+Index: rocBLAS-rocm-5.4.2/clients/common/utility.cpp
+===================================================================
+--- rocBLAS-rocm-5.4.2.orig/clients/common/utility.cpp
++++ rocBLAS-rocm-5.4.2/clients/common/utility.cpp
+@@ -38,6 +38,7 @@
+ #ifdef WIN32
+ #define strcasecmp(A, B) _stricmp(A, B)
+
++#include <version>
+ #ifdef __cpp_lib_filesystem
+ #include <filesystem>
+ namespace fs = std::filesystem;
+Index: rocBLAS-rocm-5.4.2/clients/include/singletons.hpp
+===================================================================
+--- rocBLAS-rocm-5.4.2.orig/clients/include/singletons.hpp
++++ rocBLAS-rocm-5.4.2/clients/include/singletons.hpp
+@@ -21,6 +21,6 @@
+ * ************************************************************************ */
+
+ // global for device memory padding see d_vector.hpp
+-
++#include<cstddef>
+ extern size_t g_DVEC_PAD;
+ void d_vector_set_pad_length(size_t pad);
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.4.2-link-cblas.patch b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-link-cblas.patch
new file mode 100644
index 000000000000..a0a599ad0de8
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-link-cblas.patch
@@ -0,0 +1,12 @@
+Fix CPU blas function not found linking issue
+--- a/clients/CMakeLists.txt
++++ b/clients/CMakeLists.txt
+@@ -119,7 +119,7 @@ if( BUILD_CLIENTS_BENCHMARKS OR BUILD_CLIENTS_TESTS)
+ set( BLIS_CPP ../common/blis_interface.cpp )
+ set( BLAS_LIBRARY ${BUILD_DIR}/deps/blis/lib/libblis.a )
+ else()
+- set( BLAS_LIBRARY "blas" )
++ set( BLAS_LIBRARY "blas -lcblas" )
+ endif()
+ else() # WIN32
+ set( BLAS_INCLUDE_DIR ${OPENBLAS_DIR}/include CACHE PATH "OpenBLAS library include path" )
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.4.2-unbundle-Tensile.patch b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-unbundle-Tensile.patch
new file mode 100644
index 000000000000..114c10502e68
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.4.2-unbundle-Tensile.patch
@@ -0,0 +1,26 @@
+Index: rocBLAS-rocm-5.4.2/CMakeLists.txt
+===================================================================
+--- rocBLAS-rocm-5.4.2.orig/CMakeLists.txt
++++ rocBLAS-rocm-5.4.2/CMakeLists.txt
+@@ -138,21 +138,6 @@ if(NOT SKIP_LIBRARY)
+
+ set( Tensile_TEST_LOCAL_PATH "" CACHE PATH "Use local Tensile directory instead of fetching a GitHub branch" )
+
+- include(virtualenv)
+-
+- if (Tensile_TEST_LOCAL_PATH)
+- virtualenv_install(${Tensile_TEST_LOCAL_PATH})
+- message (STATUS "using local Tensile from ${Tensile_TEST_LOCAL_PATH}, copied to ${Tensile_ROOT}")
+- else()
+- # Use the virtual-env setup and download package from specified repot:
+- set( tensile_fork "ROCmSoftwarePlatform" CACHE STRING "Tensile fork to use" )
+- file (STRINGS "tensile_tag.txt" read_tensile_tag)
+- set( tensile_tag ${read_tensile_tag} CACHE STRING "Tensile tag to download" )
+- virtualenv_install("git+https://github.com/${tensile_fork}/Tensile.git@${tensile_tag}")
+- message (STATUS "using GIT Tensile fork=${tensile_fork} from branch=${tensile_tag}")
+- endif()
+- message(STATUS "Adding ${VIRTUALENV_HOME_DIR} to CMAKE_PREFIX_PATH")
+- list(APPEND CMAKE_PREFIX_PATH ${VIRTUALENV_HOME_DIR})
+ if (TENSILE_VERSION)
+ find_package(Tensile ${TENSILE_VERSION} EXACT REQUIRED HIP LLVM OpenMP PATHS "${INSTALLED_TENSILE_PATH}")
+ else()
diff --git a/sci-libs/rocBLAS/metadata.xml b/sci-libs/rocBLAS/metadata.xml
index 02d256a5ccc2..066f5c749e3f 100644
--- a/sci-libs/rocBLAS/metadata.xml
+++ b/sci-libs/rocBLAS/metadata.xml
@@ -12,8 +12,11 @@
<email>xgreenlandforwyy@gmail.com</email>
<name>Yiyang Wu</name>
</maintainer>
- <use>
- <flag name="test">Perform rocblas-test to compare the result between rocBLAS and system BLAS.</flag>
- <flag name="benchmark">Build and install rocblas-bench.</flag>
- </use>
+ <use>
+ <flag name="test">Perform rocblas-test to compare the result between rocBLAS and system BLAS.</flag>
+ <flag name="benchmark">Build and install rocblas-bench.</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">ROCmSoftwarePlatform/rocBLAS</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sci-libs/rocBLAS/rocBLAS-5.4.2.ebuild b/sci-libs/rocBLAS/rocBLAS-5.4.2.ebuild
new file mode 100644
index 000000000000..28fad2ffbe68
--- /dev/null
+++ b/sci-libs/rocBLAS/rocBLAS-5.4.2.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
+ https://media.githubusercontent.com/media/littlewu2508/littlewu2508.github.io/main/gentoo-distfiles/${PN}-5.4.2-Tensile-asm_full-navi22.tar.gz"
+S="${WORKDIR}/${PN}-rocm-${PV}"
+
+LICENSE="BSD"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="benchmark test"
+REQUIRED_USE="${ROCM_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ >=dev-util/rocm-cmake-5.3
+ dev-util/Tensile:${SLOT}
+"
+
+DEPEND="
+ dev-util/hip
+ dev-libs/msgpack
+ 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-unbundle-Tensile.patch
+ "${FILESDIR}"/${PN}-5.4.2-add-missing-header.patch
+ "${FILESDIR}"/${PN}-5.4.2-link-cblas.patch
+ )
+
+src_prepare() {
+ cmake_src_prepare
+ cp -a "${WORKDIR}/asm_full/" library/src/blas3/Tensile/Logic/ || die
+ 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="V3"
+ -DTensile_TEST_LOCAL_PATH="${EPREFIX}/usr/share/Tensile"
+ -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)
+ )
+
+ 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
+}