Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
s-Nick committed Sep 25, 2024
1 parent e8256f5 commit 9ae43f0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 31 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ option(BUILD_SHARED_LIBS "Build dynamic libraries" ON)
## Backends
option(ENABLE_MKLCPU_BACKEND "Enable the Intel oneMKL CPU backend for supported interfaces" ON)
option(ENABLE_MKLGPU_BACKEND "Enable the Intel oneMKL GPU backend for supported interfaces" ON)

if(ENABLE_MKLCPU_BACKEND)
option(ENABLE_MKLCPU_THREAD_TBB "Enable the use of Intel TBB with the oneMKL CPU backend" ON)
endif()
Expand All @@ -61,7 +60,6 @@ option(ENABLE_CUFFT_BACKEND "Enable the cuFFT backend for the DFT interface" OFF
option(ENABLE_ROCFFT_BACKEND "Enable the rocFFT backend for the DFT interface" OFF)
option(ENABLE_PORTFFT_BACKEND "Enable the portFFT DFT backend for the DFT interface. Cannot be used with other DFT backends." OFF)


set(ONEMKL_SYCL_IMPLEMENTATION "dpc++" CACHE STRING "Name of the SYCL compiler")
set(HIP_TARGETS "" CACHE STRING "Target HIP architectures")

Expand Down
6 changes: 3 additions & 3 deletions deps/googletest/cmake/internal_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ macro(fix_default_compiler_settings_)
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if (NOT ONEAPI_ONEMKL_BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
# When Google Test is built as a shared library, it should also use
# shared runtime libraries. Otherwise, it may end up with multiple
# copies of runtime library data in different modules, resulting in
Expand Down Expand Up @@ -173,7 +173,7 @@ function(cxx_library_with_type name type cxx_flags)
COMPILE_PDB_NAME "${name}"
COMPILE_PDB_NAME_DEBUG "${name}${pdb_debug_postfix}")

if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
set_target_properties(${name}
PROPERTIES
COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
Expand Down Expand Up @@ -219,7 +219,7 @@ function(cxx_executable_with_flags name cxx_flags libs)
PROPERTIES
COMPILE_FLAGS "${cxx_flags}")
endif()
if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS)
if (BUILD_SHARED_LIBS)
set_target_properties(${name}
PROPERTIES
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
Expand Down
52 changes: 26 additions & 26 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,33 @@ endforeach()
# Generate header with enabled backends for testing

function(generate_header_file)
# Following if-conditions allow to decouple cmake configuration variables with
# the corresponding generated macro. This is done to be conformant with ES.33
# C++ Core Guidelines
set(ONEAPI_ONEMKL_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND ${ENABLE_MKLCPU_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND ${ENABLE_MKLGPU_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND ${ENABLE_CUBLAS_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND ${ENABLE_ROCBLAS_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND ${ENABLE_NETLIB_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND ${ENABLE_PORTBLAS_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND ${ENABLE_CURAND_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND ${ENABLE_ROCRAND_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND ${ENABLE_CUSOLVER_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND ${ENABLE_ROCSOLVER_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND ${ENABLE_CUFFT_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND ${ENABLE_ROCFFT_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND ${ENABLE_PORTFFT_BACKEND})
# Following if-conditions allow to decouple cmake configuration variables with
# the corresponding generated macro. This is done to be conformant with ES.33
# C++ Core Guidelines
set(ONEAPI_ONEMKL_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND ${ENABLE_MKLCPU_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND ${ENABLE_MKLGPU_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND ${ENABLE_CUBLAS_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND ${ENABLE_ROCBLAS_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND ${ENABLE_NETLIB_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND ${ENABLE_PORTBLAS_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND ${ENABLE_CURAND_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND ${ENABLE_ROCRAND_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND ${ENABLE_CUSOLVER_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND ${ENABLE_ROCSOLVER_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND ${ENABLE_CUFFT_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND ${ENABLE_ROCFFT_BACKEND})
set(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND ${ENABLE_PORTFFT_BACKEND})

configure_file(config.hpp.in "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/config.hpp.configured")
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/detail/config.hpp"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/config.hpp.configured"
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/detail/config.hpp"
DESTINATION include/oneapi/mkl/detail
COMPONENT Devel
)
configure_file(config.hpp.in "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/config.hpp.configured")
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/detail/config.hpp"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/config.hpp.configured"
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/detail/config.hpp"
DESTINATION include/oneapi/mkl/detail
COMPONENT Devel
)
endfunction()

generate_header_file()
Expand Down

0 comments on commit 9ae43f0

Please sign in to comment.