diff options
| author | 2021-01-20 17:00:35 +0800 | |
|---|---|---|
| committer | 2021-01-21 00:11:24 +0800 | |
| commit | 5a6ca7469f59dd61a837ad34b60a9bb33b9f105b (patch) | |
| tree | df178fbac5fb3c0c38e8fb8f03781baf1d048b82 | |
| parent | dev-util/Tensile: creating benchmark-driven backend library for GEMMs (diff) | |
| download | sci-5a6ca7469f59dd61a837ad34b60a9bb33b9f105b.tar.gz sci-5a6ca7469f59dd61a837ad34b60a9bb33b9f105b.tar.bz2 sci-5a6ca7469f59dd61a837ad34b60a9bb33b9f105b.zip | |
sci-libs/rocBLAS: AMD library for BLAS on the ROCm platform.
To be considered landing on ::gentoo when dev-util/Tensile is
available.
Bug: https://bugs.gentoo.org/650804
Bug: https://github.com/gentoo/gentoo/pull/10724
Suggested-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
Suggested-by: Wilfried Holzke <gentoo@holzke.net>
Bug: https://github.com/justxi/rocm/issues/133
Package-Manager: Portage-3.0.12, Repoman-3.0.1
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
| -rw-r--r-- | sci-libs/rocBLAS/Manifest | 1 | ||||
| -rw-r--r-- | sci-libs/rocBLAS/files/rocBLAS-4.0.0-use-system-tensile.patch | 30 | ||||
| -rw-r--r-- | sci-libs/rocBLAS/metadata.xml | 11 | ||||
| -rw-r--r-- | sci-libs/rocBLAS/rocBLAS-4.0.0-r1.ebuild | 88 |
4 files changed, 130 insertions, 0 deletions
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest new file mode 100644 index 000000000..d45adc2a4 --- /dev/null +++ b/sci-libs/rocBLAS/Manifest @@ -0,0 +1 @@ +DIST rocm-rocBLAS-4.0.0.tar.gz 6815197 BLAKE2B 32de8d14fe2a41090fdb4903ed4069aa95441962caa38f5c14294e79be50f426c2b076408a7f6fdd9e9a498acd6cc85700ccbf2989c0e645e9d5b43cad0c1710 SHA512 87b2b029ce3c1845cc0726c44b6270028504de2d6a9b82798082d45a672804a11250b85ed526c5bd4dd5305ba66ed7caa2076193d623a7448b8bdc0886b3e33c diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.0.0-use-system-tensile.patch b/sci-libs/rocBLAS/files/rocBLAS-4.0.0-use-system-tensile.patch new file mode 100644 index 000000000..3b8e44a99 --- /dev/null +++ b/sci-libs/rocBLAS/files/rocBLAS-4.0.0-use-system-tensile.patch @@ -0,0 +1,30 @@ +diff --color -uprN rocBLAS-rocm-4.0.0/CMakeLists.txt new/CMakeLists.txt +--- rocBLAS-rocm-4.0.0/CMakeLists.txt 2020-11-11 00:56:04.000000000 +0800 ++++ new/CMakeLists.txt 2021-01-20 15:23:09.570222990 +0800 +@@ -208,25 +208,7 @@ if( BUILD_WITH_TENSILE ) + option(TENSILE_USE_MSGPACK "Use msgpack for parsing config files." ON) + 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() +- find_package(Tensile 4.24.0 EXACT REQUIRED HIP LLVM OpenMP PATHS "${INSTALLED_TENSILE_PATH}") +- endif() ++ find_package(Tensile 4.24.0 EXACT REQUIRED HIP LLVM OpenMP) + endif() + + # Find HCC/HIP dependencies diff --git a/sci-libs/rocBLAS/metadata.xml b/sci-libs/rocBLAS/metadata.xml new file mode 100644 index 000000000..336bdb639 --- /dev/null +++ b/sci-libs/rocBLAS/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'> +<pkgmetadata> + <maintainer type="project"> + <email>sci@gentoo.org</email> + </maintainer> + <maintainer type="person"> + <email>gentoo@holzke.net</email> + <name>Wilfried Holzke</name> + </maintainer> +</pkgmetadata> diff --git a/sci-libs/rocBLAS/rocBLAS-4.0.0-r1.ebuild b/sci-libs/rocBLAS/rocBLAS-4.0.0-r1.ebuild new file mode 100644 index 000000000..ca0fcfd8c --- /dev/null +++ b/sci-libs/rocBLAS/rocBLAS-4.0.0-r1.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +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-rocBLAS-${PV}.tar.gz" + +LICENSE="MIT" +KEYWORDS="~amd64" +SLOT="0" + +IUSE="debug" + +RDEPEND="=dev-util/hip-$(ver_cut 1-2)*" +DEPEND="${RDEPEND} + dev-util/cmake + dev-util/rocm-cmake + dev-libs/msgpack + dev-perl/File-Which" + +# stripped library is not working +RESTRICT="strip" + +S="${WORKDIR}/rocBLAS-rocm-${PV}" + +rocBLAS_V="0.1" + +PATCHES="${FILESDIR}/${PN}-4.0.0-use-system-tensile.patch" + +src_prepare() { + eapply_user + + 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 "/rocm_install_symlink_subdir( rocblas )/d" -i library/src/CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + # allow acces to hardware + addwrite /dev/kfd + addpredict /dev/dri/ + + # Compiler to use + export CXX="hipcc" + + if use debug; then + buildtype="Debug" + else + buildtype="Release" + fi + + local mycmakeargs=( + -DTensile_LOGIC="asm_full" + -DTensile_COMPILER="hipcc" + -DTensile_ARCHITECTURE="all" + -DTensile_LIBRARY_FORMAT="msgpack" + -DTensile_CODE_OBJECT_VERSION="V3" + -DTensile_TEST_LOCAL_PATH="${WORKDIR}/Tensile-rocm-${PV}" + -DBUILD_WITH_TENSILE=ON + -DBUILD_WITH_TENSILE_HOST=ON + -DCMAKE_BUILD_TYPE="${buildtype}" + -DCMAKE_CXX_FLAGS="--rocm-path=${EPREFIX}/usr" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas" + -DBUILD_TESTING=OFF + -DBUILD_CLIENTS_SAMPLES=OFF + -DBUILD_CLIENTS_TESTS=OFF + -DBUILD_CLIENTS_BENCHMARKS=OFF + ) + + 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_install() { + cmake_src_install + chrpath --delete "${ED}/usr/lib64/librocblas.so.${rocBLAS_V}" +} |
