Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion cmake/finders/FindBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,34 @@
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)

if("OpenBLAS" IN_LIST THEROCK_PROVIDED_PACKAGES)
if(("OpenBLAS" IN_LIST THEROCK_PROVIDED_PACKAGES) OR ("OpenBLAS64" IN_LIST
THEROCK_PROVIDED_PACKAGES))
cmake_policy(POP)
message(STATUS "Resolving bundled host-blas library from super-project")

set(_want_ilp64 FALSE)
if(DEFINED BLA_SIZEOF_INTEGER AND BLA_SIZEOF_INTEGER EQUAL 8)
set(_want_ilp64 TRUE)
endif()

if(_want_ilp64)
if(NOT "OpenBLAS64" IN_LIST THEROCK_PROVIDED_PACKAGES)
message(
FATAL_ERROR
"BLA_SIZEOF_INTEGER=8 (ILP64) requested but the super-project did not "
"provide OpenBLAS64. Add therock-host-blas64 to this subproject's "
"BUILD_DEPS or RUNTIME_DEPS.")
endif()
find_package(OpenBLAS64 CONFIG REQUIRED)
set(_OPENBLAS OpenBLAS64)
else()
if(NOT "OpenBLAS" IN_LIST THEROCK_PROVIDED_PACKAGES)
message(
FATAL_ERROR
"LP64 BLAS requested but the super-project did not provide OpenBLAS. "
"Add therock-host-blas, or set BLA_SIZEOF_INTEGER=8 if only OpenBLAS64 "
"is available.")
endif()
find_package(OpenBLAS CONFIG REQUIRED)
set(_OPENBLAS OpenBLAS)
endif()
Expand Down
24 changes: 22 additions & 2 deletions cmake/finders/FindLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,39 @@
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)

if("OpenBLAS" IN_LIST THEROCK_PROVIDED_PACKAGES)
if(("OpenBLAS" IN_LIST THEROCK_PROVIDED_PACKAGES) OR ("OpenBLAS64" IN_LIST
THEROCK_PROVIDED_PACKAGES))
cmake_policy(POP)
message(STATUS "Resolving bundled host-blas library from super-project")

set(_want_ilp64 FALSE)
if(DEFINED BLA_SIZEOF_INTEGER AND BLA_SIZEOF_INTEGER EQUAL 8)
set(_want_ilp64 TRUE)
endif()

if(_want_ilp64)
if(NOT "OpenBLAS64" IN_LIST THEROCK_PROVIDED_PACKAGES)
message(
FATAL_ERROR
"BLA_SIZEOF_INTEGER=8 (ILP64) requested but the super-project did not "
"provide OpenBLAS64. Add therock-host-blas64 to this subproject's "
"BUILD_DEPS or RUNTIME_DEPS.")
endif()
find_package(OpenBLAS64 CONFIG REQUIRED)
set(_OPENBLAS OpenBLAS64)
else()
if(NOT "OpenBLAS" IN_LIST THEROCK_PROVIDED_PACKAGES)
message(
FATAL_ERROR
"LP64 LAPACK requested but the super-project did not provide OpenBLAS. "
"Add therock-host-blas, or set BLA_SIZEOF_INTEGER=8 if only OpenBLAS64 "
"is available.")
endif()
find_package(OpenBLAS CONFIG REQUIRED)
set(_OPENBLAS OpenBLAS)
endif()

# See: https://cmake.org/cmake/help/latest/module/FindBLAS.html
# See: https://cmake.org/cmake/help/latest/module/FindLAPACK.html
set(LAPACK_LINKER_FLAGS)
set(LAPACK_LIBRARIES ${_OPENBLAS}::OpenBLAS)
add_library(LAPACK::LAPACK ALIAS ${_OPENBLAS}::OpenBLAS)
Expand Down
12 changes: 10 additions & 2 deletions math-libs/BLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,15 @@ if(NOT WIN32)
if(TARGET rocm_smi_lib)
list(APPEND rocBLAS_optional_runtime_deps rocm_smi_lib)
endif()
elseif(THEROCK_BUILD_TESTING)
list(APPEND rocBLAS_optional_runtime_deps therock-host-blas)
endif()
if(THEROCK_BUILD_TESTING)
# Client tests link ILP64 reference BLAS (see cmake/finders/FindBLAS.cmake + BLA_SIZEOF_INTEGER=8).
list(APPEND rocBLAS_optional_runtime_deps therock-host-blas64)
endif()

set(rocBLAS_extra_cmake_args)
if(THEROCK_BUILD_TESTING)
list(APPEND rocBLAS_extra_cmake_args -DROCBLAS_CLIENTS_REFERENCE_ILP64=ON)
endif()

# Disable rocBLAS samples on Windows due to use of deprecated
Expand Down Expand Up @@ -206,6 +213,7 @@ therock_cmake_subproject_declare(rocBLAS
-DBUILD_CLIENTS_SAMPLES=${_blas_build_samples}
-DBUILD_CLIENTS_BENCHMARKS=${THEROCK_BUILD_TESTING}
-DLINK_BLIS=OFF
${rocBLAS_extra_cmake_args}
CMAKE_INCLUDES
therock_explicit_finders.cmake
COMPILER_TOOLCHAIN
Expand Down
2 changes: 1 addition & 1 deletion rocm-libraries
Submodule rocm-libraries updated 1928 files
Loading