diff options
author | Yiyang Wu <xgreenlandforwyy@gmail.com> | 2023-01-28 20:32:37 +0800 |
---|---|---|
committer | Benda Xu <heroxbd@gentoo.org> | 2023-01-31 22:26:51 +0800 |
commit | f4dba4a5f9cb91c066086f6145d34bf53578f3d8 (patch) | |
tree | 7b6584b62584f7ec156917238bf4e50bcc22d931 /sci-libs | |
parent | sci-libs/rocBLAS: add github upstream metadata (diff) | |
download | gentoo-f4dba4a5f9cb91c066086f6145d34bf53578f3d8.tar.gz gentoo-f4dba4a5f9cb91c066086f6145d34bf53578f3d8.tar.bz2 gentoo-f4dba4a5f9cb91c066086f6145d34bf53578f3d8.zip |
sci-libs/rocBLAS: add 5.4.2
Closes: https://github.com/gentoo/gentoo/pull/29319
Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/rocBLAS/Manifest | 2 | ||||
-rw-r--r-- | sci-libs/rocBLAS/files/rocBLAS-5.4.2-add-missing-header.patch | 14 | ||||
-rw-r--r-- | sci-libs/rocBLAS/files/rocBLAS-5.4.2-cpp_lib_filesystem.patch | 24 | ||||
-rw-r--r-- | sci-libs/rocBLAS/files/rocBLAS-5.4.2-link-cblas.patch | 12 | ||||
-rw-r--r-- | sci-libs/rocBLAS/files/rocBLAS-5.4.2-unbundle-Tensile.patch | 26 | ||||
-rw-r--r-- | sci-libs/rocBLAS/rocBLAS-5.4.2.ebuild | 107 |
6 files changed, 185 insertions, 0 deletions
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest index 8e328c26a78e..3ba6938bbd3c 100644 --- a/sci-libs/rocBLAS/Manifest +++ b/sci-libs/rocBLAS/Manifest @@ -1,3 +1,5 @@ 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 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/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 +} |