summaryrefslogtreecommitdiff
path: root/sci-libs/rocBLAS
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
commite68d405c5d712af4387159df07e226217bdda049 (patch)
tree009ab0f3d427f0813e62930d71802cb054c07e30 /sci-libs/rocBLAS
parent401101f9c8077911929d3f2b60a37098460a5d89 (diff)
gentoo resync : 06.04.2022
Diffstat (limited to 'sci-libs/rocBLAS')
-rw-r--r--sci-libs/rocBLAS/Manifest6
-rw-r--r--sci-libs/rocBLAS/files/rocBLAS-5.0.2-change-default-Tensile-library-dir.patch47
-rw-r--r--sci-libs/rocBLAS/files/rocBLAS-5.0.2-cpp_lib_filesystem.patch50
-rw-r--r--sci-libs/rocBLAS/files/rocBLAS-5.0.2-unbundle-Tensile.patch25
-rw-r--r--sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild135
5 files changed, 263 insertions, 0 deletions
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest
index c197bb27d979..6fcc4a1563c9 100644
--- a/sci-libs/rocBLAS/Manifest
+++ b/sci-libs/rocBLAS/Manifest
@@ -5,8 +5,14 @@ AUX rocBLAS-4.3.0-fix-glibc-2.32-and-above.patch 1254 BLAKE2B d3bcf526f374065ed0
AUX rocBLAS-4.3.0-link-system-blas.patch 1106 BLAKE2B 83f525072dc34edec01c56353d8c87f0f967c9cf07d054da8c1f4af632e095cd2af9562dea8eab8a2ddc7a71a9570e654b4a6b0f68c95508e92cc743350c8129 SHA512 94efab3d507fc90bd0d0b2cd0096e68b7669d1de2faf73fe0bfbc8c26c83db88596664bd61f394863194ad3108985b6206c4408c6d2ec93cd30ccec13b3b37f1
AUX rocBLAS-4.3.0-remove-problematic-test-suites.patch 2240 BLAKE2B bdaf0111083e62f15d907b3faa536b1418a7273b3733386c14625ffed4c505b7d6a2318ae24a0dda286d57d4dac6befefa8005ef58452a9eb3928b78d337e214 SHA512 565d29c193ed04d45dc179ce06bbbdb0d472d66fe989286f4ccf29ccce39c118d79225ca80d2dbcb022833347b87e7573a78dc573dfde73d368e62256526eb93
AUX rocBLAS-4.3.0-unbundle-Tensile.patch 863 BLAKE2B 223d7b54d61111443c9f90d66a2d53bc85414094a2b9c571d2e6fafc0d1260befb0783d6c761d4df0b22c31a4e85a029f5eed5d9d455488207791fdaa1c69952 SHA512 40e7cc604139b419b9a77ad1005a8bbfd1134909f2e0be67579dcc958d49c8239b1b7f573741c9ff04e310977fafbd2edce5b58f4bc4bffb2cd003e7fbab7437
+AUX rocBLAS-5.0.2-change-default-Tensile-library-dir.patch 2070 BLAKE2B b90c31653c68583432f54c3a17067a92e7fd91e66f902f37e96a7a413b885de57820b93c5a98458b1d6f4b4283138dac274ece1ec97f3fc0dd3ea00ce6002542 SHA512 946f9d66ac703628829ff585890ea9eae71f441e10bb1ff21f8dfad9a5d73279ed4880c4b96ac662be76af10ebe63ccbe0ef9f2c55fb2ebfc5c9087f32119b2a
+AUX rocBLAS-5.0.2-cpp_lib_filesystem.patch 1546 BLAKE2B e9a794a87b76a41d059c755565ae5da9a361b0c4648a92dd5ce35f9b5bd8c743827fcf79752c393a786c30083cd7db59bc334599d414920ce72c24216d014124 SHA512 e80ac744ce44bc9023de2600290c37577bda6161bfe750ac2b746d8fea7b45334a96461baa74131d0e31db497f8dd123ccd5dc181a40b265c2e2c72e1e479e88
+AUX rocBLAS-5.0.2-unbundle-Tensile.patch 1352 BLAKE2B 48300030abee9898397919cbbea187fd16d770e20cdcfddd7665c160f47e362ad63acf9f443f86d824a999398d0c6f5aee8295a963dce2653bc94518c8ac9674 SHA512 39c4aff4fc60692e0450aa844ce979afe031c3ba3adb0cdf0866d0766714bf28a4c5664c18de7520b63d3fc2864de51939a596e864e97d0b8935681cabd7a84d
+DIST rocBLAS-5.0.2-Tensile-asm_full-navi22.tar.gz 1110323 BLAKE2B 80fab97c6f89fccf1f8829ad41baf15ad31bbbb313b48825841834c7ec1b9f8ece794aebdf9fda42b54a38f642beb1bc1e374f2f3b4e43d8ba9dfd1eb6e3ece5 SHA512 8f6946cf9d68afd195640ae7e0da8dc33341c67f28813813b5361a56531fa2af4453d075703ea52c66d93a1936cf74688b86aa2fa62b52a7ed5f03272290c232
DIST rocm-Tensile-4.3.0.tar.gz 14250149 BLAKE2B 030138eaca2a0aadd96801e6dbd72e510716dd90553ef3795c5e04e00a34a05ecae82b24f755e4033a4acfcdb1cf26291da1e7902bb090f89a010d403e832beb SHA512 126db0b413c716fba8d5be9bff7a44fd1badacbf32f3db8d0db649819177db37ebd56fd22dd3c809655f5d29675be115e698cd10bc3d0b4b23878ae3726fce47
DIST rocm-rocBLAS-4.3.0.tar.gz 11569970 BLAKE2B f11b0acf2bbd5737b036142d3b2cc1e18c38e088a8b7db58156d478dd6718befbb82bb7fd43a38fe64a5427124c5ad5241fa37977f094e6efd195d168d3e5f65 SHA512 490ab1c1e98a8b311ad5630515c448d9bb0a2bf588a08bcbebee345e2954d616b4ffe7c2e03dadca82c590438c42afccb98fe8ba00856aece101b5ffe62ef1e0
+DIST rocm-rocBLAS-5.0.2.tar.gz 13295178 BLAKE2B e1abfa06b9ac1545732465857839dae3f3708af49439a306a2b5b1b1b392101c38c95815f2c05a0d9ed29d41b154bc2e16a4f9203a37f5e2f68ee12cc4b44a06 SHA512 2f4a74f49350ede0debcf32229a6b6b95505615723c3f2bee16e4c169a3bb966dfb1971819028f47c525f571bea5662b892e63f655b0d1d2b8f20746bc5fe770
EBUILD rocBLAS-4.3.0-r1.ebuild 3897 BLAKE2B 3100406bc65c2292c5b444760bb73bff4804181405d1a174397191ea31f41e8ecebe050bb2bee060a5be344ea5e514c0acde028f8fc483879dbff8b504a69454 SHA512 aab616bb0662c7983c0edd25fb12d79687c9c5f9b6552ac758156b756e8d4db764c50dd6534c92f02be0ba7ff45904586976d0918626b3ebb0d791d38445ec70
EBUILD rocBLAS-4.3.0.ebuild 4226 BLAKE2B 0e4814b92bf97e230dee8ff54565ca718d2482d12e3f31d194e6321a55b064f3653059dfef623d665ac5d25fadad20a8bca81ace83980c3ee8f5e62cb5c4cd24 SHA512 06528ef0cf5767ed0b9bc58794cddebfc7e247091ff78c4e0e8eeb8f75ed3cdfd5443044671837f9573cf0e576d8006ef6a7c1a96786f5d4a8f06657c5b6308c
+EBUILD rocBLAS-5.0.2.ebuild 3732 BLAKE2B 75d6f4aad5aef0d4db271782f6b80a95c9a99404370e92a681e676810d00f904446fa161b0d101dd9823346b00307e1c50fb43d8d1c17f0a9a6a373fefd0fe0d SHA512 87210ab8f9eb45bcdacf4be4864e2b4dc3f55327f97190a08355250f1e21ffa23303f462d2428ce473b2a646c9595566f14bf3c0474b90b975ffdce9bcb2eecd
MISC metadata.xml 654 BLAKE2B b8a1d40e2ccc2aadccb9a1200e9c78fccb37544fa01c353645372a4ed01a6d153c04ff5d0d96cd7661e80b09eb6c69e8cbc59e466fef117ea1ad5ef54b1334ae SHA512 b880f8f495aee8c337b7cac4054a30f877a1204d0cda03fa90aaa25e4ae163d435c113141f2afef62967f603dea372419b228655e1b26fff53c010c8efdcebf1
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.0.2-change-default-Tensile-library-dir.patch b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-change-default-Tensile-library-dir.patch
new file mode 100644
index 000000000000..618847b8fb8d
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-change-default-Tensile-library-dir.patch
@@ -0,0 +1,47 @@
+change the default rocm tensile library search path
+Index: rocBLAS-rocm-5.0.1/library/src/tensile_host.cpp
+===================================================================
+--- rocBLAS-rocm-5.0.1.orig/library/src/tensile_host.cpp
++++ rocBLAS-rocm-5.0.1/library/src/tensile_host.cpp
+@@ -558,40 +558,8 @@ namespace
+ // Find the location of librocblas.dll/.so
+ // Fall back on hard-coded path if static library or not found
+
+-#ifndef ROCBLAS_STATIC_LIB
+-#ifdef WIN32
+- // wchar_t wpath[MAX_PATH + 1] = {0};
+- // if(GetModuleFileNameW(GetModuleHandle("rocblas.dll"), wpath, MAX_PATH + 1))
+- // {
+- // std::wstring wspath(wpath);
+- // std::string tmp(wspath.begin(), wspath.end());
+
+- std::vector<TCHAR> dll_path(MAX_PATH + 1);
+- if(GetModuleFileNameA(
+- GetModuleHandleA("rocblas.dll"), dll_path.data(), MAX_PATH + 1))
+- {
+- std::string tmp(dll_path.begin(), dll_path.end());
+- std::filesystem::path exepath = tmp;
+- if(exepath.has_filename())
+- {
+- path = exepath.remove_filename().string();
+- }
+- }
+-#else
+- dl_iterate_phdr(rocblas_dl_iterate_phdr_callback, NULL);
+- if(rocblas_so_path.size())
+- path = std::string{dirname(&rocblas_so_path[0])};
+-#endif
+-#endif // ifndef ROCBLAS_STATIC_LIB
+-
+- // Find the location of the libraries
+- if(TestPath(path + "/../../Tensile/library"))
+- path += "/../../Tensile/library";
+- else
+- path += "/library";
+-
+- if(TestPath(path + "/" + processor))
+- path += "/" + processor;
++ path="@GENTOO_PORTAGE_EPREFIX@/usr/lib64/rocblas/library";
+ }
+
+ // only load modules for the current architecture
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.0.2-cpp_lib_filesystem.patch b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-cpp_lib_filesystem.patch
new file mode 100644
index 000000000000..500abbacfdc2
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-cpp_lib_filesystem.patch
@@ -0,0 +1,50 @@
+--- b/clients/common/utility.cpp 2022-01-26 03:31:42.000000000 +0800
++++ a/clients/common/utility.cpp 2022-02-22 18:45:35.319732953 +0800
+@@ -23,6 +23,7 @@
+ #include <fcntl.h>
+ #endif
+
++#include <version>
+ #ifdef __cpp_lib_filesystem
+ #include <filesystem>
+ #else
+--- b/clients/include/rocblas_data.hpp 2022-01-26 03:31:42.000000000 +0800
++++ a/clients/include/rocblas_data.hpp 2022-02-22 18:44:51.275733070 +0800
+@@ -17,6 +17,7 @@
+ #include <string>
+ #include <utility>
+
++#include<version>
+ #ifdef __cpp_lib_filesystem
+ #include <filesystem>
+ #else
+--- b/clients/include/singletons.hpp 2022-01-26 03:31:42.000000000 +0800
++++ a/clients/include/singletons.hpp 2022-02-22 18:47:55.139732583 +0800
+@@ -3,6 +3,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);
+--- b/clients/include/testing_logging.hpp 2022-01-26 03:31:42.000000000 +0800
++++ a/clients/include/testing_logging.hpp 2022-02-22 18:44:13.115733171 +0800
+@@ -22,6 +22,7 @@
+ #include <unistd.h>
+ #endif
+
++#include<version>
+ #ifdef __cpp_lib_filesystem
+ #include <filesystem>
+ #else
+--- b/clients/include/testing_ostream_threadsafety.hpp 2022-01-26 03:31:42.000000000 +0800
++++ a/clients/include/testing_ostream_threadsafety.hpp 2022-02-22 18:45:19.055732996 +0800
+@@ -30,6 +30,7 @@
+ #include <sys/types.h>
+ #endif
+
++#include <version>
+ #ifdef __cpp_lib_filesystem
+ #include <filesystem>
+ #else
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.0.2-unbundle-Tensile.patch b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-unbundle-Tensile.patch
new file mode 100644
index 000000000000..75f673f63d47
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-unbundle-Tensile.patch
@@ -0,0 +1,25 @@
+Index: rocBLAS-rocm-5.0.2/CMakeLists.txt
+===================================================================
+--- rocBLAS-rocm-5.0.2.orig/CMakeLists.txt
++++ rocBLAS-rocm-5.0.2/CMakeLists.txt
+@@ -271,20 +271,6 @@ if(NOT SKIP_LIBRARY)
+ set( Tensile_ROOT "${CMAKE_BINARY_DIR}/virtualenv/Lib/site-packages/Tensile" )
+ endif()
+
+- 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/rocBLAS-5.0.2.ebuild b/sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild
new file mode 100644
index 000000000000..0600f90bac37
--- /dev/null
+++ b/sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2022 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"
+inherit cmake docs prefix
+
+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/${P}-Tensile-asm_full-navi22.tar.gz"
+S="${WORKDIR}/${PN}-rocm-${PV}"
+
+LICENSE="BSD"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="benchmark test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ dev-util/rocm-cmake:${SLOT}
+ dev-util/Tensile:${SLOT}
+"
+
+DEPEND="
+ dev-util/hip:${SLOT}
+ dev-libs/msgpack
+ test? (
+ virtual/blas
+ dev-cpp/gtest
+ sys-libs/libomp
+ )
+ benchmark? (
+ virtual/blas
+ sys-libs/libomp
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.3.0-fix-glibc-2.32-and-above.patch
+ "${FILESDIR}"/${PN}-5.0.2-change-default-Tensile-library-dir.patch
+ "${FILESDIR}"/${PN}-5.0.2-cpp_lib_filesystem.patch
+ "${FILESDIR}"/${PN}-5.0.2-unbundle-Tensile.patch
+ )
+
+src_prepare() {
+ cmake_src_prepare
+ cp -a "${WORKDIR}/asm_full/" library/src/blas3/Tensile/Logic/ || die
+ # Fit for Gentoo FHS rule
+ sed -e "/PREFIX rocblas/d" \
+ -e "/<INSTALL_INTERFACE/s:include:include/rocblas:" \
+ -e "s:rocblas/include:include/rocblas:" \
+ -e "s:\\\\\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib:${EPREFIX}/usr/$(get_libdir)/rocblas:" \
+ -e "s:share/doc/rocBLAS:share/doc/${P}:" \
+ -e "/rocm_install_symlink_subdir( rocblas )/d" -i library/src/CMakeLists.txt || die
+
+ sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die
+
+ eprefixify library/src/tensile_host.cpp
+}
+
+src_configure() {
+ # allow acces to hardware
+ addpredict /dev/kfd
+ addpredict /dev/dri/
+ addpredict /dev/random
+
+ export PATH="${EPREFIX}/usr/lib/llvm/roc/bin:${PATH}"
+
+ local mycmakeargs=(
+ -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_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas"
+ -DCMAKE_SKIP_RPATH=TRUE
+ -DBUILD_TESTING=OFF
+ -DBUILD_CLIENTS_SAMPLES=OFF
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
+ ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
+ )
+
+ CXX="hipcc" cmake_src_configure
+
+ # do not rerun cmake and the build process in src_install
+ sed -e '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
+}
+
+src_compile() {
+ docs_compile
+ cmake_src_compile
+}
+
+check_rw_permission() {
+ local cmd="[ -r $1 ] && [ -w $1 ]"
+ local error=0 user
+ if has sandbox ${FEATURES}; then
+ user="portage"
+ su portage -c "${cmd}" || error=1
+ else
+ user="$(whoami)"
+ bash -c "${cmd}" || error=1
+ fi
+ if [[ "${error}" == 1 ]]; then
+ die "${user} do not have read and write permissions on $1! \n Make sure ${user} is in render group and check the permissions."
+ fi
+}
+
+src_test() {
+ # check permissions on /dev/kfd and /dev/dri/render*
+ check_rw_permission /dev/kfd
+ check_rw_permission /dev/dri/render*
+ addwrite /dev/kfd
+ addwrite /dev/dri/
+ cd "${BUILD_DIR}/clients/staging" || die
+ ROCBLAS_TEST_TIMEOUT=3600 LD_LIBRARY_PATH="${BUILD_DIR}/clients:${BUILD_DIR}/library/src" ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library" ./rocblas-test || die "Tests failed"
+}
+
+src_install() {
+ cmake_src_install
+
+ if use benchmark; then
+ cd "${BUILD_DIR}" || die
+ dolib.so clients/librocblas_fortran_client.so
+ dobin clients/staging/rocblas-bench
+ fi
+}