forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also backport fix for 16-bit floats for 6.1.1 Closes: https://bugs.gentoo.org/944820 Signed-off-by: Sv. Lockal <[email protected]> Signed-off-by: Sam James <[email protected]>
- Loading branch information
1 parent
c9fd543
commit da37b20
Showing
6 changed files
with
176 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt | ||
index 4485fee..51eedc9 100644 | ||
--- a/clients/CMakeLists.txt | ||
+++ b/clients/CMakeLists.txt | ||
@@ -140,10 +140,12 @@ if( BUILD_CLIENTS_BENCHMARKS OR BUILD_CLIENTS_TESTS) | ||
set( BLAS_LIBRARY /usr/local/lib/libblis.a ) | ||
set( BLIS_INCLUDE_DIR /usr/local/include/blis ) | ||
else() | ||
- message( WARNING "Could not find libblis" ) | ||
+ message( FATAL_ERROR "Could not find libblis" ) | ||
endif() | ||
else() | ||
- set( BLAS_LIBRARY "blas -lcblas" ) | ||
+ find_package( CBLAS CONFIG REQUIRED ) | ||
+ set( BLAS_LIBRARY ${CBLAS_LIBRARIES} ) | ||
+ set( BLAS_INCLUDE_DIR ${CBLAS_INCLUDE_DIRS} ) | ||
endif() | ||
else() # WIN32 | ||
file(TO_CMAKE_PATH "C:/Program\ Files/AMD/AOCL-Windows/amd-blis/lib/ILP64/AOCL-LibBlis-Win-MT.lib" AOCL_BLAS_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Git should not be a required dependency, as hash is not available for releases. | ||
--- a/library/CMakeLists.txt | ||
+++ b/library/CMakeLists.txt | ||
@@ -144,17 +144,8 @@ if( BUILD_VERBOSE ) | ||
message( STATUS "\t==>CMAKE_SHARED_LINKER_FLAGS_RELEASE: ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" ) | ||
endif( ) | ||
|
||
-find_package(Git REQUIRED) | ||
- | ||
-# Get the git hash of the rocBLAS branch | ||
-execute_process( | ||
- COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD | ||
- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} | ||
- OUTPUT_VARIABLE GIT_HASH_ROCBLAS | ||
- OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
- | ||
#set the rocBLAS commit hash | ||
-set(rocblas_VERSION_COMMIT_ID "${GIT_HASH_ROCBLAS}") | ||
+set(rocblas_VERSION_COMMIT_ID "") | ||
|
||
#set the Tensile commit hash | ||
set(tensile_VERSION_COMMIT_ID "${tensile_tag}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Copyright 1999-2025 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
DOCS_BUILDER="doxygen" | ||
DOCS_DIR="docs/.doxygen" | ||
DOCS_DEPEND="media-gfx/graphviz" | ||
LLVM_COMPAT=( 19 ) | ||
ROCM_VERSION=${PV} | ||
|
||
inherit cmake docs edo flag-o-matic multiprocessing rocm llvm-r1 | ||
|
||
DESCRIPTION="AMD's library for BLAS on ROCm" | ||
HOMEPAGE="https://github.com/ROCm/rocBLAS" | ||
SRC_URI="https://github.com/ROCm/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz" | ||
S="${WORKDIR}/${PN}-rocm-${PV}" | ||
|
||
LICENSE="BSD" | ||
SLOT="0/$(ver_cut 1-2)" | ||
KEYWORDS="~amd64" | ||
IUSE="benchmark hipblaslt test video_cards_amdgpu" | ||
RESTRICT="!test? ( test )" | ||
REQUIRED_USE="${ROCM_REQUIRED_USE}" | ||
|
||
BDEPEND=" | ||
>=dev-build/rocm-cmake-5.3 | ||
video_cards_amdgpu? ( | ||
dev-util/Tensile:${SLOT} | ||
) | ||
hipblaslt? ( sci-libs/hipBLASLt:${SLOT} ) | ||
test? ( dev-cpp/gtest ) | ||
" | ||
|
||
DEPEND=" | ||
>=dev-cpp/msgpack-cxx-6.0.0 | ||
dev-util/hip:${SLOT} | ||
test? ( | ||
virtual/blas | ||
dev-cpp/gtest | ||
llvm-runtimes/openmp | ||
) | ||
benchmark? ( | ||
virtual/blas | ||
llvm-runtimes/openmp | ||
) | ||
" | ||
|
||
QA_FLAGS_IGNORED="/usr/lib64/rocblas/library/.*" | ||
|
||
PATCHES=( | ||
"${FILESDIR}"/${PN}-5.4.2-add-missing-header.patch | ||
"${FILESDIR}"/${PN}-5.4.2-link-cblas.patch | ||
"${FILESDIR}"/${PN}-6.0.2-expand-isa-compatibility.patch | ||
"${FILESDIR}"/${PN}-6.3.0-no-git.patch | ||
"${FILESDIR}"/${PN}-6.3.0-find-cblas.patch | ||
) | ||
|
||
src_prepare() { | ||
cmake_src_prepare | ||
sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die | ||
} | ||
|
||
src_configure() { | ||
rocm_use_hipcc | ||
|
||
# too many warnings | ||
append-cxxflags -Wno-explicit-specialization-storage-class | ||
|
||
local mycmakeargs=( | ||
-DCMAKE_SKIP_RPATH=ON | ||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF | ||
-DROCM_SYMLINK_LIBS=OFF | ||
-DAMDGPU_TARGETS="$(get_amdgpu_flags)" | ||
-DBUILD_WITH_TENSILE="$(usex video_cards_amdgpu)" | ||
-DCMAKE_INSTALL_INCLUDEDIR="include/rocblas" | ||
-DBUILD_CLIENTS_SAMPLES=OFF | ||
-DBUILD_CLIENTS_TESTS="$(usex test ON OFF)" | ||
-DBUILD_CLIENTS_BENCHMARKS="$(usex benchmark ON OFF)" | ||
-DBUILD_WITH_PIP=OFF | ||
-DBUILD_WITH_HIPBLASLT="$(usex hipblaslt ON OFF)" | ||
-DLINK_BLIS=OFF | ||
-Wno-dev | ||
) | ||
|
||
if usex video_cards_amdgpu; then | ||
mycmakeargs+=( | ||
-DTensile_LOGIC="asm_full" | ||
-DTensile_COMPILER="hipcc" | ||
-DTensile_LIBRARY_FORMAT="msgpack" | ||
-DTensile_CODE_OBJECT_VERSION="default" | ||
-DTensile_ROOT="${EPREFIX}/usr/share/Tensile" | ||
-DTensile_CPU_THREADS="$(makeopts_jobs)" | ||
) | ||
fi | ||
|
||
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" | ||
|
||
# `--gtest_filter=*quick*:*pre_checkin*-*known_bug*` is >1h on 7900XTX | ||
edob ./rocblas-test --yaml rocblas_smoke.yaml | ||
} | ||
|
||
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 | ||
|
||
# Stop llvm-strip from removing .strtab section from *.hsaco files, | ||
# otherwise rocclr/elf/elf.cpp complains with "failed: null sections(STRTAB)" and crashes | ||
dostrip -x "/usr/$(get_libdir)/rocblas/library/" | ||
} |