diff options
author | Yiyang Wu <xgreenlandforwyy@gmail.com> | 2022-07-08 21:01:54 +0800 |
---|---|---|
committer | Benda Xu <heroxbd@gentoo.org> | 2022-07-09 01:28:31 +0800 |
commit | 75f2ea4157fc3a52fa139b90db1890371dc3f6f7 (patch) | |
tree | 09fb256a260bdd7afe4bc481ad7507ee2e20c068 /sci-libs | |
parent | dev-util/Tensile: backport patch to control multiprocess (diff) | |
download | gentoo-75f2ea4157fc3a52fa139b90db1890371dc3f6f7.tar.gz gentoo-75f2ea4157fc3a52fa139b90db1890371dc3f6f7.tar.bz2 gentoo-75f2ea4157fc3a52fa139b90db1890371dc3f6f7.zip |
sci-libs/rocBLAS: respect MAKEOPTS when build Tensile libs
Closes: https://github.com/gentoo/gentoo/pull/26285
Closes: https://bugs.gentoo.org/852236
Suggested-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
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/files/rocBLAS-5.0.2-respect-makeopts.patch | 73 | ||||
-rw-r--r-- | sci-libs/rocBLAS/rocBLAS-5.0.2-r1.ebuild (renamed from sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild) | 6 |
2 files changed, 77 insertions, 2 deletions
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.0.2-respect-makeopts.patch b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-respect-makeopts.patch new file mode 100644 index 000000000000..649a98106646 --- /dev/null +++ b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-respect-makeopts.patch @@ -0,0 +1,73 @@ +Only retain CMakeLists patch. We don't need install.sh, rmake.py +Suggested-By: Alessandro Barbieri <lssndrbarbieri@gmail.com> +================================================================ +From 0ffee0626bf987bae6b81183a5c61569a489537a Mon Sep 17 00:00:00 2001 +From: Torre Zuk <42548444+TorreZuk@users.noreply.github.com> +Date: Thu, 4 Nov 2021 09:21:37 -0600 +Subject: [PATCH] Swdev 309014 add jobs arg (#953) + +* adds -j --jobs argment passing of cpu_threads for build +--- + CMakeLists.txt | 1 + + install.sh | 16 ++++++++++++---- + library/src/CMakeLists.txt | 34 +++++++++++++++++++++++++--------- + rmake.py | 29 ++++++++++++++++++----------- + 4 files changed, 56 insertions(+), 24 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 69cf8d586..40d88ea0a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,6 +244,7 @@ if(NOT SKIP_LIBRARY) + set( Tensile_CODE_OBJECT_VERSION "V2" CACHE STRING "Tensile code_object_version") + set( Tensile_COMPILER "hipcc" CACHE STRING "Tensile compiler") + set( Tensile_LIBRARY_FORMAT "msgpack" CACHE STRING "Tensile library format") ++ set( Tensile_CPU_THREADS "" CACHE STRING "Number of threads for Tensile parallel build") + + option( Tensile_MERGE_FILES "Tensile to merge kernels and solutions files?" ON ) + option( Tensile_SHORT_FILENAMES "Tensile to use short file names? Use if compiler complains they're too long." OFF ) +diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt +index 4f5e4572d..dedfe9794 100755 +--- a/library/src/CMakeLists.txt ++++ b/library/src/CMakeLists.txt +@@ -58,15 +58,31 @@ if( BUILD_WITH_TENSILE ) + + # Add a build target for Tensile kernel library + # Runtime language is HIP by default +- TensileCreateLibraryFiles( +- "${CMAKE_CURRENT_SOURCE_DIR}/blas3/Tensile/Logic/${Tensile_LOGIC}" +- "${PROJECT_BINARY_DIR}/Tensile" +- ARCHITECTURE ${Tensile_ARCHITECTURE} +- CODE_OBJECT_VERSION ${Tensile_CODE_OBJECT_VERSION} +- COMPILER ${Tensile_COMPILER} +- LIBRARY_FORMAT ${Tensile_LIBRARY_FORMAT} +- ${Tensile_Options} +- ) ++ # warning our Tensile_ variables may shadow variable in TensileCreateLibraryFiles ++ # thus bypassing the function argument parameter system (mainly the options list) and CPU_THREADS ++ if(Tensile_CPU_THREADS MATCHES "^[0-9]+$") ++ # only including threads argument if number ++ TensileCreateLibraryFiles( ++ "${CMAKE_CURRENT_SOURCE_DIR}/blas3/Tensile/Logic/${Tensile_LOGIC}" ++ "${PROJECT_BINARY_DIR}/Tensile" ++ ARCHITECTURE ${Tensile_ARCHITECTURE} ++ CODE_OBJECT_VERSION ${Tensile_CODE_OBJECT_VERSION} ++ COMPILER ${Tensile_COMPILER} ++ LIBRARY_FORMAT ${Tensile_LIBRARY_FORMAT} ++ CPU_THREADS ${Tensile_CPU_THREADS} ++ ${Tensile_Options} ++ ) ++ else() ++ TensileCreateLibraryFiles( ++ "${CMAKE_CURRENT_SOURCE_DIR}/blas3/Tensile/Logic/${Tensile_LOGIC}" ++ "${PROJECT_BINARY_DIR}/Tensile" ++ ARCHITECTURE ${Tensile_ARCHITECTURE} ++ CODE_OBJECT_VERSION ${Tensile_CODE_OBJECT_VERSION} ++ COMPILER ${Tensile_COMPILER} ++ LIBRARY_FORMAT ${Tensile_LIBRARY_FORMAT} ++ ${Tensile_Options} ++ ) ++ endif() + + # Create a unique name for TensileHost compiled for rocBLAS + set_target_properties( TensileHost PROPERTIES OUTPUT_NAME rocblas-tensile CXX_EXTENSIONS NO ) diff --git a/sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild b/sci-libs/rocBLAS/rocBLAS-5.0.2-r1.ebuild index 0600f90bac37..42637150e674 100644 --- a/sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild +++ b/sci-libs/rocBLAS/rocBLAS-5.0.2-r1.ebuild @@ -6,7 +6,7 @@ EAPI=8 DOCS_BUILDER="doxygen" DOCS_DIR="docs" DOCS_DEPEND="media-gfx/graphviz" -inherit cmake docs prefix +inherit cmake docs multiprocessing prefix DESCRIPTION="AMD's library for BLAS on ROCm" HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS" @@ -22,7 +22,7 @@ RESTRICT="!test? ( test )" BDEPEND=" dev-util/rocm-cmake:${SLOT} - dev-util/Tensile:${SLOT} + >=dev-util/Tensile-${PV}-r1:${SLOT} " DEPEND=" @@ -44,6 +44,7 @@ PATCHES=( "${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 + "${FILESDIR}"/${PN}-5.0.2-respect-makeopts.patch ) src_prepare() { @@ -85,6 +86,7 @@ src_configure() { -DBUILD_CLIENTS_SAMPLES=OFF -DBUILD_CLIENTS_TESTS=$(usex test ON OFF) -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF) + -DTensile_CPU_THREADS=$(makeopts_jobs) ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"} ) |