Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
- add legacy option for mkl
- make openmp dependent to both mkl and mkl_legacy
- export mkl_legacy option in cmake module
  • Loading branch information
albestro committed Jan 10, 2024
1 parent b4fe4d1 commit 35287cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ endif()

option(BUILD_SHARED_LIBS "Build shared libraries." ON)
option(DLAF_WITH_OPENMP "${DLAF_WITH_OPENMP_DESCRIPTION}" ${DLAF_WITH_OPENMP_DEFAULT})
option(DLAF_WITH_MKL "Enable MKL as provider for LAPACK" OFF)
option(DLAF_WITH_MKL "Enable oneMKL as provider for LAPACK" OFF)
option(DLAF_WITH_MKL_LEGACY "Enable MKL as provider for LAPACK" OFF)
option(DLAF_WITH_CUDA "Enable CUDA support" OFF)
option(DLAF_WITH_HIP "Enable HIP support" OFF)
cmake_dependent_option(DLAF_WITH_CUDA_MPI_RDMA "Enable MPI CUDA RDMA" OFF "DLAF_WITH_CUDA" OFF)
Expand All @@ -48,7 +49,11 @@ option(DLAF_BUILD_DOC "Build documentation" OFF)
option(DLAF_WITH_PRECOMPILED_HEADERS "Use precompiled headers." OFF)
option(DLAF_WITH_SCALAPACK "Build ScaLAPACK-like C API (requires ScaLAPACK)" OFF)

if(DLAF_WITH_MKL)
if(DLAF_WITH_MKL AND DLAF_WITH_MKL_LEGACY)
message(SEND_ERROR "DLAF_WITH_MKL and DLAF_WITH_MKL_LEGACY are mutually exclusive.")
endif()

if(DLAF_WITH_MKL OR DLAF_WITH_MKL_LEGACY)
# When using MKL there is no need to set the number of threads with
# omp_set_num_threads; it's sufficient to use MKL's own mechanisms.
set(DLAF_WITH_OPENMP OFF CACHE BOOL "${DLAF_WITH_OPENMP_DESCRIPTION}" FORCE)
Expand Down
1 change: 1 addition & 0 deletions cmake/template/DLAFConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
# ===== VARIABLES
set(DLAF_WITH_OPENMP @DLAF_WITH_OPENMP@)
set(DLAF_WITH_MKL @DLAF_WITH_MKL@)
set(DLAF_WITH_MKL @DLAF_WITH_MKL_LEGACY@)
set(DLAF_WITH_CUDA @DLAF_WITH_CUDA@)
set(DLAF_WITH_HIP @DLAF_WITH_HIP@)
set(DLAF_WITH_GPU @DLAF_WITH_GPU@)
Expand Down

0 comments on commit 35287cc

Please sign in to comment.