From 89a139f0a77593dc2f32919990641ebcebf224fe Mon Sep 17 00:00:00 2001 From: nscipione Date: Mon, 16 Sep 2024 14:56:02 +0100 Subject: [PATCH 01/10] Rename macros used in headers This commit update the macros used internally adding the prefix ONEAPI_ONEMKL_. This change creates a mismatch between the cmake variables used for configuration and the internal macros. Cmake configuration stays the same while, macros are now conformant with C++ guidelines. Signed-off-by: nscipione --- CMakeLists.txt | 140 ++++++++++++------ cmake/CMakeLists.txt | 2 +- cmake/FindCompiler.cmake | 14 +- deps/googletest/CMakeLists.txt | 4 +- deps/googletest/cmake/internal_utils.cmake | 6 +- docs/building_and_running_tests.rst | 4 +- .../building_the_project_with_adaptivecpp.rst | 22 +-- docs/building_the_project_with_dpcpp.rst | 78 +++++----- docs/create_new_backend.rst | 26 ++-- examples/README.md | 2 +- examples/blas/CMakeLists.txt | 2 +- .../level3/CMakeLists.txt | 4 +- .../level3/CMakeLists.txt | 10 +- examples/dft/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 4 +- .../dft/run_time_dispatching/CMakeLists.txt | 14 +- examples/lapack/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 6 +- .../run_time_dispatching/CMakeLists.txt | 8 +- examples/rng/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 5 +- examples/rng/device/CMakeLists.txt | 8 +- .../rng/run_time_dispatching/CMakeLists.txt | 8 +- examples/sparse_blas/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 2 +- .../run_time_dispatching/CMakeLists.txt | 4 +- include/oneapi/mkl/blas.hpp | 12 +- include/oneapi/mkl/detail/backends_table.hpp | 54 +++---- include/oneapi/mkl/detail/export.hpp | 2 +- .../oneapi/mkl/dft/detail/descriptor_impl.hpp | 10 +- include/oneapi/mkl/lapack.hpp | 8 +- include/oneapi/mkl/rng/engines.hpp | 24 +-- include/oneapi/mkl/sparse_blas.hpp | 4 +- scripts/generate_cmake.py | 2 +- src/CMakeLists.txt | 12 +- src/blas/CMakeLists.txt | 2 +- src/blas/backends/CMakeLists.txt | 12 +- src/blas/backends/cublas/CMakeLists.txt | 2 +- src/blas/backends/mklcpu/CMakeLists.txt | 4 +- src/blas/backends/mklgpu/CMakeLists.txt | 4 +- src/blas/backends/netlib/CMakeLists.txt | 4 +- src/blas/backends/portblas/CMakeLists.txt | 32 ++-- src/blas/backends/rocblas/CMakeLists.txt | 2 +- src/config.hpp.in | 36 ++--- src/dft/CMakeLists.txt | 2 +- src/dft/backends/CMakeLists.txt | 10 +- src/dft/backends/cufft/CMakeLists.txt | 4 +- src/dft/backends/mklcpu/CMakeLists.txt | 4 +- src/dft/backends/mklgpu/CMakeLists.txt | 4 +- src/dft/backends/portfft/CMakeLists.txt | 4 +- src/dft/backends/rocfft/CMakeLists.txt | 4 +- src/lapack/CMakeLists.txt | 2 +- src/lapack/backends/CMakeLists.txt | 8 +- src/lapack/backends/cusolver/CMakeLists.txt | 2 +- src/lapack/backends/mklcpu/CMakeLists.txt | 4 +- src/lapack/backends/mklgpu/CMakeLists.txt | 4 +- src/lapack/backends/rocsolver/CMakeLists.txt | 2 +- src/rng/CMakeLists.txt | 2 +- src/rng/backends/CMakeLists.txt | 8 +- src/rng/backends/curand/CMakeLists.txt | 2 +- src/rng/backends/mklcpu/CMakeLists.txt | 4 +- src/rng/backends/mklgpu/CMakeLists.txt | 4 +- src/rng/backends/rocrand/CMakeLists.txt | 2 +- src/sparse_blas/CMakeLists.txt | 2 +- src/sparse_blas/backends/CMakeLists.txt | 4 +- .../backends/mklcpu/CMakeLists.txt | 4 +- .../backends/mklgpu/CMakeLists.txt | 4 +- tests/unit_tests/CMakeLists.txt | 32 ++-- tests/unit_tests/blas/batch/CMakeLists.txt | 2 +- .../unit_tests/blas/extensions/CMakeLists.txt | 2 +- .../blas/include/reference_blas_wrappers.hpp | 8 +- tests/unit_tests/blas/level1/CMakeLists.txt | 2 +- tests/unit_tests/blas/level2/CMakeLists.txt | 2 +- tests/unit_tests/blas/level3/CMakeLists.txt | 2 +- tests/unit_tests/dft/source/CMakeLists.txt | 2 +- tests/unit_tests/include/test_helper.hpp | 34 ++--- tests/unit_tests/lapack/common/CMakeLists.txt | 2 +- tests/unit_tests/lapack/source/CMakeLists.txt | 2 +- tests/unit_tests/main_test.cpp | 28 ++-- .../rng/include/rng_test_common.hpp | 2 +- tests/unit_tests/rng/service/CMakeLists.txt | 2 +- .../rng/statistics_check/CMakeLists.txt | 2 +- .../sparse_blas/source/CMakeLists.txt | 2 +- 83 files changed, 446 insertions(+), 377 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bd39f188..47c1e25a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,11 +34,21 @@ endif() # Build options option(BUILD_SHARED_LIBS "Build dynamic libraries" ON) +if(BUILD_SHARED_LIBS) + set(ONEAPI_ONEMKL_BUILD_SHARED_LIBS True) +endif() + ## 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) + set(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND True) +endif() + +if(ENABLE_MKLGPU_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND True) endif() # blas @@ -60,6 +70,50 @@ 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) +if(ENABLE_CUBLAS_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND True) +endif() + +if(ENABLE_ROCBLAS_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND True) +endif() + +if(ENABLE_NETLIB_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND True) +endif() + +if(ENABLE_PORTBLAS_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND True) +endif() + +if(ENABLE_CURAND_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND True) +endif() + +if(ENABLE_ROCRAND_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND True) +endif() + +if(ENABLE_CUSOLVER_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND True) +endif() + +if(ENABLE_ROCSOLVER_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND True) +endif() + +if(ENABLE_CUFFT_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND True) +endif() + +if(ENABLE_ROCFFT_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND True) +endif() + +if(ENABLE_PORTFFT_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND True) +endif() + set(ONEMKL_SYCL_IMPLEMENTATION "dpc++" CACHE STRING "Name of the SYCL compiler") set(HIP_TARGETS "" CACHE STRING "Target HIP architectures") @@ -74,53 +128,53 @@ option(BUILD_DOC "" OFF) ## Supported domains set(DOMAINS_LIST "") -if(ENABLE_MKLCPU_BACKEND - OR ENABLE_MKLGPU_BACKEND - OR ENABLE_CUBLAS_BACKEND - OR ENABLE_ROCBLAS_BACKEND - OR ENABLE_NETLIB_BACKEND - OR ENABLE_PORTBLAS_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND + OR ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND + OR ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND) list(APPEND DOMAINS_LIST "blas") endif() -if(ENABLE_MKLCPU_BACKEND - OR ENABLE_MKLGPU_BACKEND - OR ENABLE_CUSOLVER_BACKEND - OR ENABLE_ROCSOLVER_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) list(APPEND DOMAINS_LIST "lapack") endif() -if(ENABLE_MKLCPU_BACKEND - OR ENABLE_MKLGPU_BACKEND - OR ENABLE_CURAND_BACKEND - OR ENABLE_ROCRAND_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) list(APPEND DOMAINS_LIST "rng") endif() -if(ENABLE_MKLGPU_BACKEND - OR ENABLE_MKLCPU_BACKEND - OR ENABLE_CUFFT_BACKEND - OR ENABLE_ROCFFT_BACKEND - OR ENABLE_PORTFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND + OR ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) list(APPEND DOMAINS_LIST "dft") endif() -if(ENABLE_MKLCPU_BACKEND - OR ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) list(APPEND DOMAINS_LIST "sparse_blas") endif() -if(ENABLE_PORTBLAS_BACKEND - AND (ENABLE_MKLCPU_BACKEND - OR ENABLE_MKLGPU_BACKEND - OR ENABLE_CUBLAS_BACKEND - OR ENABLE_ROCBLAS_BACKEND - OR ENABLE_NETLIB_BACKEND)) - message(FATAL_ERROR "ENABLE_PORTBLAS_BACKEND cannot be enabled at the same time as other BLAS backends.") +if(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND + AND (ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND + OR ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND)) + message(FATAL_ERROR "ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND cannot be enabled at the same time as other BLAS backends.") endif() -if (ENABLE_PORTFFT_BACKEND - AND (ENABLE_MKLCPU_BACKEND - OR ENABLE_MKLGPU_BACKEND - OR ENABLE_ROCFFT_BACKEND - OR ENABLE_CUFFT_BACKEND)) - message(FATAL_ERROR "ENABLE_PORTFFT_BACKEND cannot be enabled at the same time as other DFT backends.") +if (ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND + AND (ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND + OR ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND)) + message(FATAL_ERROR "ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND cannot be enabled at the same time as other DFT backends.") endif() # Define required CXX compilers before project @@ -129,10 +183,12 @@ if(CMAKE_CXX_COMPILER OR NOT ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++") string(REPLACE "\\" "/" CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER}) endif() else() - if(ENABLE_CUBLAS_BACKEND OR ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND OR ENABLE_CUFFT_BACKEND - OR ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND OR ENABLE_ROCFFT_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND OR + ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND OR ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND OR + ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND OR + ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) set(CMAKE_CXX_COMPILER "clang++") - elseif(ENABLE_MKLGPU_BACKEND) + elseif(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) if(UNIX) set(CMAKE_CXX_COMPILER "icpx") else() @@ -204,7 +260,7 @@ if(WIN32 AND ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++") endif() # Temporary disable sycl 2020 deprecations warnings for cuSOLVER and rocSOLVER -if(ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++" AND (ENABLE_ROCSOLVER_BACKEND)) +if(ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++" AND (ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND)) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSYCL2020_DISABLE_DEPRECATION_WARNINGS") endif() @@ -230,7 +286,7 @@ endif() message(STATUS "TARGET_DOMAINS: ${TARGET_DOMAINS}") # Include Intel oneMKL -if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) set(MKL_ARCH intel64) set(MKL_INTERFACE ilp64) if(ENABLE_MKLCPU_THREAD_TBB) @@ -238,7 +294,7 @@ if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND) else() set(MKL_THREADING sequential) endif() - if(BUILD_SHARED_LIBS AND NOT WIN32) + if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS AND NOT WIN32) set(MKL_LINK dynamic) else() set(MKL_LINK static) @@ -294,8 +350,8 @@ else() endif() if(DEFINED REF_BLAS_ROOT) - find_file(REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) - find_file(REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) + find_file(ONEAPI_ONEMKL_REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) + find_file(ONEAPI_ONEMKL_REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) endif() # Add source directory and output to bin/ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index df7d2fc4c..4e4487c58 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -20,7 +20,7 @@ install(FILES FindCompiler.cmake DESTINATION "lib/cmake/${PROJECT_NAME}" ) -if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) install(FILES mkl/MKLConfig.cmake DESTINATION "lib/cmake/${PROJECT_NAME}" ) diff --git a/cmake/FindCompiler.cmake b/cmake/FindCompiler.cmake index 556211999..626aee9cb 100644 --- a/cmake/FindCompiler.cmake +++ b/cmake/FindCompiler.cmake @@ -37,13 +37,13 @@ if(is_dpcpp) # Check if the Nvidia target is supported. PortFFT uses this for choosing default configuration. check_cxx_compiler_flag("-fsycl -fsycl-targets=nvptx64-nvidia-cuda" dpcpp_supports_nvptx64) - if(ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND OR ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) list(APPEND UNIX_INTERFACE_COMPILE_OPTIONS -fsycl-targets=nvptx64-nvidia-cuda -fsycl-unnamed-lambda) list(APPEND UNIX_INTERFACE_LINK_OPTIONS -fsycl-targets=nvptx64-nvidia-cuda) - elseif(ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND - OR ENABLE_ROCSOLVER_BACKEND) + elseif(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) list(APPEND UNIX_INTERFACE_COMPILE_OPTIONS -fsycl-targets=amdgcn-amd-amdhsa -fsycl-unnamed-lambda -Xsycl-target-backend --offload-arch=${HIP_TARGETS}) @@ -51,8 +51,9 @@ if(is_dpcpp) -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=${HIP_TARGETS}) endif() - if(ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND OR ENABLE_ROCBLAS_BACKEND - OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND OR ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) set_target_properties(ONEMKL::SYCL::SYCL PROPERTIES INTERFACE_COMPILE_OPTIONS "${UNIX_INTERFACE_COMPILE_OPTIONS}" INTERFACE_LINK_OPTIONS "${UNIX_INTERFACE_LINK_OPTIONS}" @@ -69,7 +70,8 @@ if(is_dpcpp) INTERFACE_LINK_LIBRARIES ${SYCL_LIBRARY}) endif() - if(ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND + OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) # Allow find_package(HIP) to find the correct path to libclang_rt.builtins.a # HIP's CMake uses the command `${HIP_CXX_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt` to find this path. # This can print a non-existing file if the compiler used is icpx. diff --git a/deps/googletest/CMakeLists.txt b/deps/googletest/CMakeLists.txt index f6a528753..113c01a08 100644 --- a/deps/googletest/CMakeLists.txt +++ b/deps/googletest/CMakeLists.txt @@ -63,9 +63,9 @@ endif() # These commands only run if this is the main project if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution") - # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to + # ONEAPI_ONEMKL_BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to # make it prominent in the GUI. - option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) + option(ONEAPI_ONEMKL_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) else() diff --git a/deps/googletest/cmake/internal_utils.cmake b/deps/googletest/cmake/internal_utils.cmake index b7b4fdc88..845b6cae4 100644 --- a/deps/googletest/cmake/internal_utils.cmake +++ b/deps/googletest/cmake/internal_utils.cmake @@ -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 BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt) + if (NOT ONEAPI_ONEMKL_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 @@ -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 (BUILD_SHARED_LIBS OR type STREQUAL "SHARED") + if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS OR type STREQUAL "SHARED") set_target_properties(${name} PROPERTIES COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1") @@ -219,7 +219,7 @@ function(cxx_executable_with_flags name cxx_flags libs) PROPERTIES COMPILE_FLAGS "${cxx_flags}") endif() - if (BUILD_SHARED_LIBS) + if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${name} PROPERTIES COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") diff --git a/docs/building_and_running_tests.rst b/docs/building_and_running_tests.rst index 114e4492d..463de5443 100644 --- a/docs/building_and_running_tests.rst +++ b/docs/building_and_running_tests.rst @@ -23,9 +23,9 @@ following: git clone https://github.com/Reference-LAPACK/lapack.git cd lapack; mkdir -p build; cd build - cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=True -DBUILD_SHARED_LIBS=True .. + cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=True -DONEAPI_ONEMKL_BUILD_SHARED_LIBS=True .. cmake --build . -j --target install - cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=False -DBUILD_SHARED_LIBS=True .. + cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=False -DONEAPI_ONEMKL_BUILD_SHARED_LIBS=True .. cmake --build . -j --target install and then used in oneMKL by setting ``-REF_BLAS_ROOT=/path/to/lapack/install`` diff --git a/docs/building_the_project_with_adaptivecpp.rst b/docs/building_the_project_with_adaptivecpp.rst index 98c763b90..ba26ba2aa 100644 --- a/docs/building_the_project_with_adaptivecpp.rst +++ b/docs/building_the_project_with_adaptivecpp.rst @@ -36,7 +36,7 @@ On Linux (other OSes are not supported with the AdaptiveCpp compiler): # Inside mkdir build && cd build cmake .. -DONEMKL_SYCL_IMPLEMENTATION=hipsycl \ # Indicate that AdaptiveCpp is being used. - -DENABLE_MKLGPU_BACKEND=False \ # MKLGPU backend is not supported by AdaptiveCpp + -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ # MKLGPU backend is not supported by AdaptiveCpp -DENABLE__BACKEND=True \ # Enable backend(s) (optional) -DENABLE__BACKEND=True \ # Multiple backends can be enabled at once. -DHIPSYCL_TARGETS=omp/;hip:gfx90a,gfx906 \ # Set target architectures depending on supported devices. @@ -75,22 +75,22 @@ The most important supported build options are: * - CMake Option - Supported Values - Default Value - * - ENABLE_MKLCPU_BACKEND + * - ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - True, False - True - * - ENABLE_CUBLAS_BACKEND + * - ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND - True, False - False - * - ENABLE_CURAND_BACKEND + * - ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND - True, False - False - * - ENABLE_NETLIB_BACKEND + * - ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND - True, False - False - * - ENABLE_ROCBLAS_BACKEND + * - ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND - True, False - False - * - ENABLE_ROCRAND_BACKEND + * - ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND - True, False - False * - ENABLE_MKLCPU_THREAD_TBB @@ -117,8 +117,8 @@ Backends Building for CUDA ~~~~~~~~~~~~~~~~~ -The CUDA backends can be enabled with ``ENABLE_CUBLAS_BACKEND`` and -``ENABLE_CURAND_BACKEND``. +The CUDA backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND`` and +``ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND``. The target architecture must be set using the ``HIPSYCL_TARGETS`` parameter. For example, to target a Nvidia A100 (Ampere architecture), set @@ -137,8 +137,8 @@ the CUDA libraries should be found automatically by CMake. Building for ROCm ~~~~~~~~~~~~~~~~~ -The ROCm backends can be enabled with ``ENABLE_ROCBLAS_BACKEND`` and -``ENABLE_ROCRAND_BACKEND``. +The ROCm backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND`` and +``ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND``. The target architecture must be set using the ``HIPSYCL_TARGETS`` parameter. See the `AdaptiveCpp documentation diff --git a/docs/building_the_project_with_dpcpp.rst b/docs/building_the_project_with_dpcpp.rst index 0da5f06e9..d7a779e45 100644 --- a/docs/building_the_project_with_dpcpp.rst +++ b/docs/building_the_project_with_dpcpp.rst @@ -44,8 +44,8 @@ for Windows`_ for building on Windows): mkdir build && cd build cmake .. -DCMAKE_CXX_COMPILER=$CXX_COMPILER \ # Should be icpx or clang++ -DCMAKE_C_COMPILER=$C_COMPILER \ # Should be icx or clang - -DENABLE_MKLCPU_BACKEND=False \ # Optional: The MKLCPU backend is True by default. - -DENABLE_MKLGPU_BACKEND=False \ # Optional: The MKLGPU backend is True by default. + -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=False \ # Optional: The MKLCPU backend is True by default. + -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ # Optional: The MKLGPU backend is True by default. -DENABLE__BACKEND=True \ # Enable any other backend(s) (optional) -DENABLE__BACKEND=True \ # Multiple backends can be enabled at once. -DBUILD_FUNCTIONAL_TESTS=False \ # See page *Building and Running Tests* for more on building tests. True by default. @@ -86,46 +86,46 @@ The most important supported build options are: * - CMake Option - Supported Values - Default Value - * - ENABLE_MKLCPU_BACKEND + * - ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - True, False - True - * - ENABLE_MKLGPU_BACKEND + * - ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND - True, False - True - * - ENABLE_CUBLAS_BACKEND + * - ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND - True, False - False - * - ENABLE_CUSOLVER_BACKEND + * - ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND - True, False - False - * - ENABLE_CUFFT_BACKEND + * - ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND - True, False - False - * - ENABLE_CURAND_BACKEND + * - ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND - True, False - False - * - ENABLE_NETLIB_BACKEND + * - ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND - True, False - False - * - ENABLE_ROCBLAS_BACKEND + * - ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND - True, False - False - * - ENABLE_ROCFFT_BACKEND + * - ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND - True, False - False - * - ENABLE_ROCSOLVER_BACKEND + * - ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND - True, False - False - * - ENABLE_ROCRAND_BACKEND + * - ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND - True, False - False * - ENABLE_MKLCPU_THREAD_TBB - True, False - True - * - ENABLE_PORTBLAS_BACKEND + * - ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND - True, False - False - * - ENABLE_PORTFFT_BACKEND + * - ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND - True, False - False * - BUILD_FUNCTIONAL_TESTS @@ -166,9 +166,9 @@ Building for Intel(R) oneMKL The Intel(R) oneMKL backend supports multiple domains on both x86 CPUs and Intel GPUs. The MKLCPU backend using Intel(R) oneMKL for x86 CPU is enabled by -default, and controlled with the parameter ``ENABLE_MKLCPU_BACKEND``. The MKLGPU +default, and controlled with the parameter ``ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND``. The MKLGPU backend using Intel(R) oneMKL for Intel GPU is enabled by default, and -controlled with the parameter ``ENABLE_MKLGPU_BACKEND``. +controlled with the parameter ``ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND``. When using the Intel(R) oneAPI DPC++ Compiler, it is likely that Intel(R) oneMKL will be found automatically. If it is not, the parameter ``MKL_ROOT`` can be set @@ -182,9 +182,9 @@ environment script provided by the package. Building for CUDA ^^^^^^^^^^^^^^^^^ -The CUDA backends can be enabled with ``ENABLE_CUBLAS_BACKEND``, -``ENABLE_CUFFT_BACKEND``, ``ENABLE_CURAND_BACKEND``, and -``ENABLE_CUSOLVER_BACKEND``. +The CUDA backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND``, +``ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND``, ``ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND``, and +``ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND``. No additional parameters are required for using CUDA libraries. In most cases, the CUDA libraries should be found automatically by CMake. @@ -194,9 +194,9 @@ the CUDA libraries should be found automatically by CMake. Building for ROCm ^^^^^^^^^^^^^^^^^ -The ROCm backends can be enabled with ``ENABLE_ROCBLAS_BACKEND``, -``ENABLE_ROCFFT_BACKEND``, ``ENABLE_ROCSOLVER_BACKEND`` and -``ENABLE_ROCRAND_BACKEND``. +The ROCm backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND``, +``ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND``, ``ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND`` and +``ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND``. For *RocBLAS*, *RocSOLVER* and *RocRAND*, the target device architecture must be set. This can be set with using the ``HIP_TARGETS`` parameter. For example, to @@ -264,7 +264,7 @@ Building for portBLAS --------------------- `portBLAS `_ is -enabled by setting ``-DENABLE_PORTBLAS_BACKEND=True``. +enabled by setting ``-DONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND=True``. By default, the portBLAS backend is not tuned for any specific device. This tuning is required to achieve best performance. @@ -293,7 +293,7 @@ Building for portFFT --------------------- `portFFT `_ is enabled by setting -``-DENABLE_PORTFFT_BACKEND=True``. +``-DONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND=True``. By default, the portFFT backend is not tuned for any specific device. The tuning flags are detailed in the `portFFT @@ -332,7 +332,7 @@ The following table provides details of CMake options and their default values: * - CMake Option - Supported Values - Default Value - * - BUILD_SHARED_LIBS + * - ONEAPI_ONEMKL_BUILD_SHARED_LIBS - True, False - True * - BUILD_DOC @@ -365,12 +365,12 @@ disabled using the Ninja build system: -GNinja \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ - -DENABLE_MKLGPU_BACKEND=False \ - -DENABLE_MKLCPU_BACKEND=False \ - -DENABLE_CUFFT_BACKEND=True \ - -DENABLE_CUBLAS_BACKEND=True \ - -DENABLE_CUSOLVER_BACKEND=True \ - -DENABLE_CURAND_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ + -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=False \ + -DONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_CURAND_BACKEND=True \ -DBUILD_FUNCTIONAL_TESTS=False ``$ONEMKL_DIR`` points at the oneMKL source directly. The x86 CPU (``MKLCPU``) @@ -386,11 +386,11 @@ disabled: cmake $ONEMKL_DIR \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ - -DENABLE_MKLCPU_BACKEND=False \ - -DENABLE_MKLGPU_BACKEND=False \ - -DENABLE_ROCFFT_BACKEND=True \ - -DENABLE_ROCBLAS_BACKEND=True \ - -DENABLE_ROCSOLVER_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=False \ + -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ + -DONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND=True \ -DHIP_TARGETS=gfx90a \ -DBUILD_FUNCTIONAL_TESTS=False @@ -408,8 +408,8 @@ GPU and Nvidia GPU with testing enabled: cmake $ONEMKL_DIR \ -DCMAKE_CXX_COMPILER=icpx \ -DCMAKE_C_COMPILER=icx \ - -DENABLE_ROCFFT_BACKEND=True \ - -DENABLE_CUFFT_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND=True \ + -DONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND=True \ -DTARGET_DOMAINS=dft \ -DBUILD_EXAMPLES=False diff --git a/docs/create_new_backend.rst b/docs/create_new_backend.rst index 8f25bda33..e180749e8 100644 --- a/docs/create_new_backend.rst +++ b/docs/create_new_backend.rst @@ -157,7 +157,7 @@ To integrate the new third-party library to a oneMKL header-based part, followin { domain::blas, { { device::x86cpu, { - #ifdef ENABLE_MKLCPU_BACKEND + #ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("blas_mklcpu") #endif } }, @@ -335,8 +335,8 @@ Here is the list of files that should be created/updated to integrate the new wr .. code-block:: diff - option(ENABLE_MKLCPU_BACKEND "" ON) - option(ENABLE_MKLGPU_BACKEND "" ON) + option(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND "" ON) + option(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND "" ON) + option(ENABLE_NEWLIB_BACKEND "" ON) * Add the new directory (``src//backends/``) with the wrappers for the new third-party library under the ``ENABLE_XXX_BACKEND`` condition to the ``src//backends/CMakeList.txt`` file. @@ -345,7 +345,7 @@ Here is the list of files that should be created/updated to integrate the new wr .. code-block:: diff - if(ENABLE_MKLCPU_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() + @@ -408,8 +408,8 @@ Now you can build the backend library for ``newlib`` to make sure the third-part cd build/ cmake .. -DNEWLIB_ROOT= \ - -DENABLE_MKLCPU_BACKEND=OFF \ - -DENABLE_MKLGPU_BACKEND=OFF \ + -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=OFF \ + -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=OFF \ -DENABLE_NEWLIB_BACKEND=ON \ # Enable new third-party library backend -DBUILD_FUNCTIONAL_TESTS=OFF # At this step we want build only cmake --build . -j4 @@ -427,7 +427,7 @@ Update the following files to enable the new third-party library for unit tests: .. code-block:: diff - #cmakedefine ENABLE_MKLCPU_BACKEND + #cmakedefine ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + #cmakedefine ENABLE_NEWLIB_BACKEND * ``tests/unit_tests/CMakeLists.txt``: add instructions about how to link tests with the new backend library @@ -436,9 +436,9 @@ Update the following files to enable the new third-party library for unit tests: .. code-block:: diff - if(ENABLE_MKLCPU_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_dependencies(test_main_ct onemkl_blas_mklcpu) - if(BUILD_SHARED_LIBS) + if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) list(APPEND ONEMKL_LIBRARIES onemkl_blas_mklcpu) else() list(APPEND ONEMKL_LIBRARIES -foffload-static-lib=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libonemkl_blas_mklcpu.a) @@ -449,7 +449,7 @@ Update the following files to enable the new third-party library for unit tests: + + if(ENABLE_NEWLIB_BACKEND) + add_dependencies(test_main_ct onemkl_blas_newlib) - + if(BUILD_SHARED_LIBS) + + if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) + list(APPEND ONEMKL_LIBRARIES onemkl_blas_newlib) + else() + list(APPEND ONEMKL_LIBRARIES -foffload-static-lib=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libonemkl_blas_newlib.a) @@ -464,7 +464,7 @@ Update the following files to enable the new third-party library for unit tests: .. code-block:: diff - #ifdef ENABLE_MKLGPU_BACKEND + #ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND #define TEST_RUN_INTELGPU(q, func, args) \ func args #else @@ -505,8 +505,8 @@ Now you can build and run functional testing for enabled third-party libraries ( cd build/ cmake .. -DNEWLIB_ROOT= \ - -DENABLE_MKLCPU_BACKEND=OFF \ - -DENABLE_MKLGPU_BACKEND=OFF \ + -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=OFF \ + -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=OFF \ -DENABLE_NEWLIB_BACKEND=ON \ -DBUILD_FUNCTIONAL_TESTS=ON cmake --build . -j4 diff --git a/examples/README.md b/examples/README.md index 0dad8772d..e97482ee4 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,7 +10,7 @@ Each routine has one run-time dispatching example and one compile-time dispatchi To build examples, use cmake build option `-DBUILD_EXAMPLES=true`. Compile_time_dispatching will be built if `-DBUILD_EXAMPLES=true` and cuda backend is enabled, because the compile-time dispatching example runs on both mklcpu and cuda backends. -Run_time_dispatching will be built if `-DBUILD_EXAMPLES=true` and `-DBUILD_SHARED_LIBS=true`. +Run_time_dispatching will be built if `-DBUILD_EXAMPLES=true` and `-DONEAPI_ONEMKL_BUILD_SHARED_LIBS=true`. The example executable naming convention follows `example_<$domain>_<$routine>_<$backend>` for compile-time dispatching examples or `example_<$domain>_<$routine>` for run-time dispatching examples. diff --git a/examples/blas/CMakeLists.txt b/examples/blas/CMakeLists.txt index 7d692a2cb..9b81a7965 100644 --- a/examples/blas/CMakeLists.txt +++ b/examples/blas/CMakeLists.txt @@ -23,6 +23,6 @@ add_subdirectory(compile_time_dispatching) # run-time dispatching example compilation is only possible # with dynamic libraries -if (BUILD_SHARED_LIBS) +if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/blas/compile_time_dispatching/level3/CMakeLists.txt b/examples/blas/compile_time_dispatching/level3/CMakeLists.txt index 294e000de..f31fafc61 100644 --- a/examples/blas/compile_time_dispatching/level3/CMakeLists.txt +++ b/examples/blas/compile_time_dispatching/level3/CMakeLists.txt @@ -19,7 +19,7 @@ #Build object from all sources set(BLAS_CT_SOURCES "") -if(ENABLE_MKLCPU_BACKEND AND ENABLE_CUBLAS_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) list(APPEND BLAS_CT_SOURCES "gemm_usm_mklcpu_cublas") endif() @@ -31,7 +31,7 @@ foreach(blas_ct_source ${BLAS_CT_SOURCES}) PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "blas" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CUBLAS_BACKEND) + if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) add_dependencies(example_${domain}_${blas_ct_source} onemkl_${domain}_mklcpu onemkl_${domain}_cublas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu onemkl_${domain}_cublas) endif() diff --git a/examples/blas/run_time_dispatching/level3/CMakeLists.txt b/examples/blas/run_time_dispatching/level3/CMakeLists.txt index d0d35fc0d..7c0e8c585 100644 --- a/examples/blas/run_time_dispatching/level3/CMakeLists.txt +++ b/examples/blas/run_time_dispatching/level3/CMakeLists.txt @@ -28,19 +28,19 @@ set(BLAS_RT_SOURCES "gemm_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ENABLE_CUBLAS_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ENABLE_ROCBLAS_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() -if(ENABLE_PORTBLAS_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND) if(PORTBLAS_TUNING_TARGET) if(PORTBLAS_TUNING_TARGET MATCHES "INTEL_CPU") list(APPEND DEVICE_FILTERS "opencl:cpu") diff --git a/examples/dft/CMakeLists.txt b/examples/dft/CMakeLists.txt index 721512429..46c92246a 100644 --- a/examples/dft/CMakeLists.txt +++ b/examples/dft/CMakeLists.txt @@ -20,6 +20,6 @@ add_subdirectory(compile_time_dispatching) # runtime compilation is only possible with dynamic libraries -if (BUILD_SHARED_LIBS) +if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/dft/compile_time_dispatching/CMakeLists.txt b/examples/dft/compile_time_dispatching/CMakeLists.txt index ed0ca2922..09276b54f 100644 --- a/examples/dft/compile_time_dispatching/CMakeLists.txt +++ b/examples/dft/compile_time_dispatching/CMakeLists.txt @@ -19,7 +19,7 @@ #Build object from all sources set(DFT_CT_SOURCES "") -if (ENABLE_MKLCPU_BACKEND AND ENABLE_CUFFT_BACKEND) +if (ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) list(APPEND DFT_CT_SOURCES "complex_fwd_usm_mklcpu_cufft") endif() @@ -33,7 +33,7 @@ foreach(dft_ct_source ${DFT_CT_SOURCES}) PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "dft" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CUFFT_BACKEND) + if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) add_dependencies(${EXAMPLE_NAME} onemkl_${domain}_mklcpu onemkl_${domain}_cufft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu onemkl_${domain}_cufft) endif() diff --git a/examples/dft/run_time_dispatching/CMakeLists.txt b/examples/dft/run_time_dispatching/CMakeLists.txt index e221c7950..7fcaffcf9 100644 --- a/examples/dft/run_time_dispatching/CMakeLists.txt +++ b/examples/dft/run_time_dispatching/CMakeLists.txt @@ -27,23 +27,25 @@ set(DFT_RT_SOURCES "") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND OR ENABLE_CUFFT_BACKEND OR ENABLE_ROCFFT_BACKEND OR ENABLE_PORTFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND OR + ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND OR + ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) list(APPEND DFT_RT_SOURCES "real_fwd_usm") endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ENABLE_PORTFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) list(APPEND DEVICE_FILTERS "*:gpu") endif() -if(ENABLE_CUFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ENABLE_ROCFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/lapack/CMakeLists.txt b/examples/lapack/CMakeLists.txt index 06bd70859..d612722b3 100644 --- a/examples/lapack/CMakeLists.txt +++ b/examples/lapack/CMakeLists.txt @@ -22,6 +22,6 @@ add_subdirectory(compile_time_dispatching) # runtime compilation is only possible with dynamic libraries -if (BUILD_SHARED_LIBS) +if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/lapack/compile_time_dispatching/CMakeLists.txt b/examples/lapack/compile_time_dispatching/CMakeLists.txt index cc126674f..3dcb1adca 100644 --- a/examples/lapack/compile_time_dispatching/CMakeLists.txt +++ b/examples/lapack/compile_time_dispatching/CMakeLists.txt @@ -19,11 +19,11 @@ #Build object from all sources set(LAPACK_CT_SOURCES "") -if(ENABLE_MKLCPU_BACKEND AND ENABLE_CUSOLVER_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) list(APPEND LAPACK_CT_SOURCES "getrs_usm_mklcpu_cusolver") endif() -if(domain STREQUAL "lapack" AND ENABLE_MKLCPU_BACKEND) +if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) find_library(OPENCL_LIBRARY NAMES OpenCL) message(STATUS "Found OpenCL: ${OPENCL_LIBRARY}") endif() @@ -35,7 +35,7 @@ foreach(lapack_ct_source ${LAPACK_CT_SOURCES}) PUBLIC ${PROJECT_SOURCE_DIR}/include PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "lapack" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CUSOLVER_BACKEND) + if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) add_dependencies(example_${domain}_${lapack_ct_source} onemkl_${domain}_mklcpu onemkl_${domain}_cusolver) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu onemkl_${domain}_cusolver) target_link_libraries(example_${domain}_${lapack_ct_source} PUBLIC ${OPENCL_LIBRARY}) diff --git a/examples/lapack/run_time_dispatching/CMakeLists.txt b/examples/lapack/run_time_dispatching/CMakeLists.txt index 5fcf6a311..7ce58a359 100644 --- a/examples/lapack/run_time_dispatching/CMakeLists.txt +++ b/examples/lapack/run_time_dispatching/CMakeLists.txt @@ -26,16 +26,16 @@ set(LAPACK_RT_SOURCES "getrs_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ENABLE_CUSOLVER_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ENABLE_ROCSOLVER_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/rng/CMakeLists.txt b/examples/rng/CMakeLists.txt index b2890bf19..b02ab2e3b 100644 --- a/examples/rng/CMakeLists.txt +++ b/examples/rng/CMakeLists.txt @@ -23,6 +23,6 @@ add_subdirectory(compile_time_dispatching) add_subdirectory(device) # runtime compilation is only possible with dynamic libraries -if (BUILD_SHARED_LIBS) +if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/rng/compile_time_dispatching/CMakeLists.txt b/examples/rng/compile_time_dispatching/CMakeLists.txt index 4f57db38c..6a522d9ec 100644 --- a/examples/rng/compile_time_dispatching/CMakeLists.txt +++ b/examples/rng/compile_time_dispatching/CMakeLists.txt @@ -19,7 +19,7 @@ #Build object from all sources set(RNG_CT_SOURCES "") -if(ENABLE_MKLCPU_BACKEND AND ENABLE_CURAND_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) list(APPEND RNG_CT_SOURCES "uniform_usm_mklcpu_curand") endif() @@ -31,7 +31,8 @@ foreach(rng_ct_source ${RNG_CT_SOURCES}) PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "rng" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CURAND_BACKEND) + if(domain STREQUAL "rng" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND + ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) add_dependencies(example_${domain}_${rng_ct_source} onemkl_${domain}_mklcpu onemkl_${domain}_curand) diff --git a/examples/rng/device/CMakeLists.txt b/examples/rng/device/CMakeLists.txt index 1b6ecf2dd..f0f8be082 100644 --- a/examples/rng/device/CMakeLists.txt +++ b/examples/rng/device/CMakeLists.txt @@ -26,17 +26,17 @@ set(RNG_DEVICE_SOURCES "uniform") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() # RNG only supports mklcpu backend on Windows -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ENABLE_CURAND_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ENABLE_ROCRAND_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/rng/run_time_dispatching/CMakeLists.txt b/examples/rng/run_time_dispatching/CMakeLists.txt index d3bcc0f19..1875447c3 100644 --- a/examples/rng/run_time_dispatching/CMakeLists.txt +++ b/examples/rng/run_time_dispatching/CMakeLists.txt @@ -26,17 +26,17 @@ set(RNG_RT_SOURCES "uniform_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() # RNG only supports mklcpu backend on Windows -if(UNIX AND ENABLE_MKLGPU_BACKEND) +if(UNIX AND ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(UNIX AND ENABLE_CURAND_BACKEND) +if(UNIX AND ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(UNIX AND ENABLE_ROCRAND_BACKEND) +if(UNIX AND ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/sparse_blas/CMakeLists.txt b/examples/sparse_blas/CMakeLists.txt index 721512429..46c92246a 100644 --- a/examples/sparse_blas/CMakeLists.txt +++ b/examples/sparse_blas/CMakeLists.txt @@ -20,6 +20,6 @@ add_subdirectory(compile_time_dispatching) # runtime compilation is only possible with dynamic libraries -if (BUILD_SHARED_LIBS) +if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt b/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt index 5dbbba8a4..3923b51be 100644 --- a/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt +++ b/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt @@ -20,7 +20,7 @@ #Build object from all sources set(SPARSE_BLAS_BACKENDS "") -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) list(APPEND SPARSE_BLAS_BACKENDS "mklcpu") endif() diff --git a/examples/sparse_blas/run_time_dispatching/CMakeLists.txt b/examples/sparse_blas/run_time_dispatching/CMakeLists.txt index 398f3e0f2..67864853c 100644 --- a/examples/sparse_blas/run_time_dispatching/CMakeLists.txt +++ b/examples/sparse_blas/run_time_dispatching/CMakeLists.txt @@ -27,10 +27,10 @@ set(SPARSE_BLAS_RT_SOURCES "sparse_blas_spmv_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() diff --git a/include/oneapi/mkl/blas.hpp b/include/oneapi/mkl/blas.hpp index 05458d9aa..574ba47de 100644 --- a/include/oneapi/mkl/blas.hpp +++ b/include/oneapi/mkl/blas.hpp @@ -34,22 +34,22 @@ #include "oneapi/mkl/detail/get_device_id.hpp" #include "oneapi/mkl/blas/detail/blas_loader.hpp" -#ifdef ENABLE_CUBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND #include "oneapi/mkl/blas/detail/cublas/blas_ct.hpp" #endif -#ifdef ENABLE_ROCBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND #include "oneapi/mkl/blas/detail/rocblas/blas_ct.hpp" #endif -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND #include "oneapi/mkl/blas/detail/mklcpu/blas_ct.hpp" #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND #include "oneapi/mkl/blas/detail/mklgpu/blas_ct.hpp" #endif -#ifdef ENABLE_NETLIB_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND #include "oneapi/mkl/blas/detail/netlib/blas_ct.hpp" #endif -#ifdef ENABLE_PORTBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND #include "oneapi/mkl/blas/detail/portblas/blas_ct.hpp" #endif diff --git a/include/oneapi/mkl/detail/backends_table.hpp b/include/oneapi/mkl/detail/backends_table.hpp index eacc99763..1abc502bd 100644 --- a/include/oneapi/mkl/detail/backends_table.hpp +++ b/include/oneapi/mkl/detail/backends_table.hpp @@ -47,40 +47,40 @@ static std::map>> libraries = { domain::blas, { { device::x86cpu, { -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("blas_mklcpu"), #endif -#ifdef ENABLE_NETLIB_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND LIB_NAME("blas_netlib"), #endif -#ifdef ENABLE_PORTBLAS_BACKEND_INTEL_CPU +#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU LIB_NAME("blas_portblas"), #endif } }, { device::intelgpu, { -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("blas_mklgpu"), #endif -#ifdef ENABLE_PORTBLAS_BACKEND_INTEL_GPU +#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU LIB_NAME("blas_portblas"), #endif } }, { device::amdgpu, { -#ifdef ENABLE_ROCBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND LIB_NAME("blas_rocblas"), #endif -#ifdef ENABLE_PORTBLAS_BACKEND_AMD_GPU +#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU LIB_NAME("blas_portblas"), #endif } }, { device::nvidiagpu, { -#ifdef ENABLE_CUBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND LIB_NAME("blas_cublas"), #endif -#ifdef ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU +#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU LIB_NAME("blas_portblas"), #endif } }, @@ -94,37 +94,37 @@ static std::map>> libraries = { domain::dft, { { device::x86cpu, { -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("dft_mklcpu") #endif -#ifdef ENABLE_PORTFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, { device::intelgpu, { -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("dft_mklgpu") #endif -#ifdef ENABLE_PORTFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, { device::amdgpu, { -#ifdef ENABLE_ROCFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND LIB_NAME("dft_rocfft") #endif -#ifdef ENABLE_PORTFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, { device::nvidiagpu, { -#ifdef ENABLE_CUFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND LIB_NAME("dft_cufft") #endif -#ifdef ENABLE_PORTFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, @@ -138,25 +138,25 @@ static std::map>> libraries = { domain::lapack, { { device::x86cpu, { -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("lapack_mklcpu") #endif } }, { device::intelgpu, { -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("lapack_mklgpu") #endif } }, { device::amdgpu, { -#ifdef ENABLE_ROCSOLVER_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND LIB_NAME("lapack_rocsolver") #endif } }, { device::nvidiagpu, { -#ifdef ENABLE_CUSOLVER_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND LIB_NAME("lapack_cusolver") #endif } } } }, @@ -164,25 +164,25 @@ static std::map>> libraries = { domain::rng, { { device::x86cpu, { -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("rng_mklcpu") #endif } }, { device::intelgpu, { -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("rng_mklgpu") #endif } }, { device::amdgpu, { -#ifdef ENABLE_ROCRAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND LIB_NAME("rng_rocrand") #endif } }, { device::nvidiagpu, { -#ifdef ENABLE_CURAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND LIB_NAME("rng_curand") #endif } } } }, @@ -190,13 +190,13 @@ static std::map>> libraries = { domain::sparse_blas, { { device::x86cpu, { -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("sparse_blas_mklcpu") #endif } }, { device::intelgpu, { -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("sparse_blas_mklgpu") #endif } } } }, diff --git a/include/oneapi/mkl/detail/export.hpp b/include/oneapi/mkl/detail/export.hpp index cbdd0d08c..01170e735 100644 --- a/include/oneapi/mkl/detail/export.hpp +++ b/include/oneapi/mkl/detail/export.hpp @@ -22,7 +22,7 @@ #include "oneapi/mkl/detail/config.hpp" -#if !defined(BUILD_SHARED_LIBS) || !defined(_WIN64) +#if !defined(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) || !defined(_WIN64) #define ONEMKL_EXPORT #define ONEMKL_NO_EXPORT #else diff --git a/include/oneapi/mkl/dft/detail/descriptor_impl.hpp b/include/oneapi/mkl/dft/detail/descriptor_impl.hpp index a9c3f946c..4050493e8 100644 --- a/include/oneapi/mkl/dft/detail/descriptor_impl.hpp +++ b/include/oneapi/mkl/dft/detail/descriptor_impl.hpp @@ -71,23 +71,23 @@ class descriptor { void commit(sycl::queue& queue); -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND void commit(backend_selector selector); #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND void commit(backend_selector selector); #endif -#ifdef ENABLE_CUFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND void commit(backend_selector selector); #endif -#ifdef ENABLE_ROCFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND void commit(backend_selector selector); #endif -#ifdef ENABLE_PORTFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND void commit(backend_selector selector); #endif diff --git a/include/oneapi/mkl/lapack.hpp b/include/oneapi/mkl/lapack.hpp index 2340c16ba..8b92cc4f0 100644 --- a/include/oneapi/mkl/lapack.hpp +++ b/include/oneapi/mkl/lapack.hpp @@ -21,16 +21,16 @@ #include "oneapi/mkl/detail/config.hpp" -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND #include "oneapi/mkl/lapack/detail/mklcpu/lapack_ct.hpp" #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND #include "oneapi/mkl/lapack/detail/mklgpu/lapack_ct.hpp" #endif -#ifdef ENABLE_CUSOLVER_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND #include "oneapi/mkl/lapack/detail/cusolver/lapack_ct.hpp" #endif -#ifdef ENABLE_ROCSOLVER_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND #include "oneapi/mkl/lapack/detail/rocsolver/lapack_ct.hpp" #endif diff --git a/include/oneapi/mkl/rng/engines.hpp b/include/oneapi/mkl/rng/engines.hpp index c28ae2b45..7b52bb3d7 100644 --- a/include/oneapi/mkl/rng/engines.hpp +++ b/include/oneapi/mkl/rng/engines.hpp @@ -35,16 +35,16 @@ #include "oneapi/mkl/rng/detail/engine_impl.hpp" #include "oneapi/mkl/rng/detail/rng_loader.hpp" -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND #include "oneapi/mkl/rng/detail/mklcpu/onemkl_rng_mklcpu.hpp" #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND #include "oneapi/mkl/rng/detail/mklgpu/onemkl_rng_mklgpu.hpp" #endif -#ifdef ENABLE_CURAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND #include "oneapi/mkl/rng/detail/curand/onemkl_rng_curand.hpp" #endif -#ifdef ENABLE_ROCRAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND #include "oneapi/mkl/rng/detail/rocrand/onemkl_rng_rocrand.hpp" #endif @@ -68,7 +68,7 @@ class philox4x32x10 { philox4x32x10(sycl::queue queue, std::initializer_list seed) : pimpl_(detail::create_philox4x32x10(get_device_id(queue), queue, seed)) {} -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(mklcpu::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -77,7 +77,7 @@ class philox4x32x10 { : pimpl_(mklcpu::create_philox4x32x10(selector.get_queue(), seed)) {} #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(mklgpu::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -86,7 +86,7 @@ class philox4x32x10 { : pimpl_(mklgpu::create_philox4x32x10(selector.get_queue(), seed)) {} #endif -#ifdef ENABLE_CURAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(curand::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -94,7 +94,7 @@ class philox4x32x10 { std::initializer_list seed) : pimpl_(curand::create_philox4x32x10(selector.get_queue(), seed)) {} #endif -#ifdef ENABLE_ROCRAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(rocrand::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -160,7 +160,7 @@ class mrg32k3a { mrg32k3a(sycl::queue queue, std::initializer_list seed) : pimpl_(detail::create_mrg32k3a(get_device_id(queue), queue, seed)) {} -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(mklcpu::create_mrg32k3a(selector.get_queue(), seed)) {} @@ -168,7 +168,7 @@ class mrg32k3a { : pimpl_(mklcpu::create_mrg32k3a(selector.get_queue(), seed)) {} #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(mklgpu::create_mrg32k3a(selector.get_queue(), seed)) {} @@ -176,7 +176,7 @@ class mrg32k3a { : pimpl_(mklgpu::create_mrg32k3a(selector.get_queue(), seed)) {} #endif -#ifdef ENABLE_CURAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(curand::create_mrg32k3a(selector.get_queue(), seed)) {} @@ -184,7 +184,7 @@ class mrg32k3a { : pimpl_(curand::create_mrg32k3a(selector.get_queue(), seed)) {} #endif -#ifdef ENABLE_ROCRAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(rocrand::create_mrg32k3a(selector.get_queue(), seed)) {} diff --git a/include/oneapi/mkl/sparse_blas.hpp b/include/oneapi/mkl/sparse_blas.hpp index 912a20eb8..be8aa53b8 100644 --- a/include/oneapi/mkl/sparse_blas.hpp +++ b/include/oneapi/mkl/sparse_blas.hpp @@ -28,10 +28,10 @@ #include "oneapi/mkl/detail/config.hpp" -#ifdef ENABLE_MKLCPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND #include "sparse_blas/detail/mklcpu/sparse_blas_ct.hpp" #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND #include "sparse_blas/detail/mklgpu/sparse_blas_ct.hpp" #endif diff --git a/scripts/generate_cmake.py b/scripts/generate_cmake.py index 02efedb25..2d4748ad4 100644 --- a/scripts/generate_cmake.py +++ b/scripts/generate_cmake.py @@ -84,7 +84,7 @@ def usage(err = None): for f in file_list: if re.search('_dyn.c', f): - out_file.write(""" $<$: {filename}> + out_file.write(""" $<$: {filename}> """.format(filename=f)) else: out_file.write(""" {filename} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0beadc3ec..71f768d03 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,16 +19,16 @@ # Define common build flags for oneMKL libraries set(ONEMKL_BUILD_COPT "") -if(WIN32 AND BUILD_SHARED_LIBS) +if(WIN32 AND ONEAPI_ONEMKL_BUILD_SHARED_LIBS) list(APPEND ONEMKL_BUILD_COPT "-Donemkl_EXPORTS") endif() # portBLAS backend variables must be accessible here to correctly # generate the config file. -set(ENABLE_PORTBLAS_BACKEND_INTEL_CPU OFF CACHE INTERNAL "") -set(ENABLE_PORTBLAS_BACKEND_INTEL_GPU OFF CACHE INTERNAL "") -set(ENABLE_PORTBLAS_BACKEND_AMD_GPU OFF CACHE INTERNAL "") -set(ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU OFF CACHE INTERNAL "") +set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU OFF CACHE INTERNAL "") +set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU OFF CACHE INTERNAL "") +set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU OFF CACHE INTERNAL "") +set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU OFF CACHE INTERNAL "") # store path to CMAKE_CURRENT_BINARY_DIR to use it later (makes FetchContent_Declare workable) set(ONEMKL_GENERATED_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}) @@ -57,7 +57,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/detail/config.hpp" ) # Add recipe for onemkl loader library -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(onemkl SHARED) # The loader library depends on all the backend libraries as it uses diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 1edf2e445..8ee72b9e7 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for BLAS loader object -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(onemkl_blas OBJECT) target_sources(onemkl_blas PRIVATE blas_loader.cpp) target_include_directories(onemkl_blas diff --git a/src/blas/backends/CMakeLists.txt b/src/blas/backends/CMakeLists.txt index 351f4b0e5..aa09c6e95 100644 --- a/src/blas/backends/CMakeLists.txt +++ b/src/blas/backends/CMakeLists.txt @@ -20,26 +20,26 @@ add_custom_target(onemkl_backend_libs_blas) add_dependencies(onemkl_backend_libs onemkl_backend_libs_blas) -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ENABLE_NETLIB_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) add_subdirectory(netlib) endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ENABLE_CUBLAS_BACKEND AND UNIX) +if(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND AND UNIX) add_subdirectory(cublas) endif() -if(ENABLE_ROCBLAS_BACKEND AND UNIX) +if(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND AND UNIX) add_subdirectory(rocblas) endif() -if(ENABLE_PORTBLAS_BACKEND AND UNIX) +if(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND AND UNIX) add_subdirectory(portblas) endif() diff --git a/src/blas/backends/cublas/CMakeLists.txt b/src/blas/backends/cublas/CMakeLists.txt index b64e7c37d..c41cebf96 100644 --- a/src/blas/backends/cublas/CMakeLists.txt +++ b/src/blas/backends/cublas/CMakeLists.txt @@ -27,7 +27,7 @@ set(SOURCES cublas_level1.cpp cublas_extensions.cpp $<$:cublas_scope_handle.cpp > $<$:cublas_scope_handle_hipsycl.cpp > - $<$: cublas_wrappers.cpp>) + $<$: cublas_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) diff --git a/src/blas/backends/mklcpu/CMakeLists.txt b/src/blas/backends/mklcpu/CMakeLists.txt index 322741d26..725e211e7 100644 --- a/src/blas/backends/mklcpu/CMakeLists.txt +++ b/src/blas/backends/mklcpu/CMakeLists.txt @@ -22,7 +22,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) set(SOURCES mklcpu_level1.cpp mklcpu_level2.cpp mklcpu_level3.cpp mklcpu_batch.cpp mklcpu_extensions.cpp - $<$: mklcpu_wrappers.cpp>) + $<$: mklcpu_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) @@ -52,7 +52,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/mklgpu/CMakeLists.txt b/src/blas/backends/mklgpu/CMakeLists.txt index c971d1afd..5cb62469d 100644 --- a/src/blas/backends/mklgpu/CMakeLists.txt +++ b/src/blas/backends/mklgpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mklgpu_level1.cpp mklgpu_level2.cpp mklgpu_level3.cpp mklgpu_batch.cpp mklgpu_extensions.cpp - $<$: mklgpu_wrappers.cpp> + $<$: mklgpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) @@ -49,7 +49,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/netlib/CMakeLists.txt b/src/blas/backends/netlib/CMakeLists.txt index fd5275fc0..7442138d1 100644 --- a/src/blas/backends/netlib/CMakeLists.txt +++ b/src/blas/backends/netlib/CMakeLists.txt @@ -25,7 +25,7 @@ find_package(NETLIB REQUIRED) set(SOURCES netlib_common.hpp netlib_level1.cpp netlib_level2.cpp netlib_level3.cpp netlib_batch.cpp netlib_extensions.cpp - $<$: netlib_wrappers.cpp> + $<$: netlib_wrappers.cpp> ) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) @@ -53,7 +53,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES ) target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/portblas/CMakeLists.txt b/src/blas/backends/portblas/CMakeLists.txt index 03fddbb38..9a362b087 100644 --- a/src/blas/backends/portblas/CMakeLists.txt +++ b/src/blas/backends/portblas/CMakeLists.txt @@ -50,16 +50,16 @@ if(PORTBLAS_TUNING_TARGET) # Allow the user to manually enable a specific device type # for tuned portBLAS configurations and sets sycl-target. if(PORTBLAS_TUNING_TARGET STREQUAL "INTEL_CPU") - set(ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "") target_compile_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=spir64_x86_64 -fsycl-unnamed-lambda) target_link_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=spir64_x86_64) elseif(PORTBLAS_TUNING_TARGET STREQUAL "INTEL_GPU") - set(ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") elseif(PORTBLAS_TUNING_TARGET STREQUAL "AMD_GPU") - set(ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") if (is_dpcpp) target_compile_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=amdgcn-amd-amdhsa -fsycl-unnamed-lambda @@ -72,7 +72,7 @@ if(PORTBLAS_TUNING_TARGET) " Compilation may fail.") endif() elseif(PORTBLAS_TUNING_TARGET STREQUAL "NVIDIA_GPU") - set(ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") if (is_dpcpp) target_compile_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=nvptx64-nvidia-cuda -fsycl-unnamed-lambda) @@ -94,27 +94,27 @@ if(PORTBLAS_TUNING_TARGET) endif() elseif(NUM_TARGETS EQUAL 0) # Enable portBLAS backend for all devices types - set(ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") - set(ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") - set(ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") - set(ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") else() # Try to automatically detect the PORTBLAS_TUNING_TARGET foreach(SYCL_TARGET IN LISTS SYCL_TARGETS) if(SYCL_TARGETS MATCHES "^intel_gpu" OR SYCL_TARGETS MATCHES "^spir64_gen") - set(ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "INTEL_GPU") elseif(SYCL_TARGETS MATCHES "^spir64_x86_64") - set(ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") elseif(SYCL_TARGETS MATCHES "^spir64") - set(ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") - set(ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "INTEL_GPU") elseif(SYCL_TARGETS MATCHES "^amd_gpu" OR SYCL_TARGETS MATCHES "-amd-") - set(ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "AMD_GPU") elseif(SYCL_TARGETS MATCHES "^nvidia_gpu" OR SYCL_TARGETS MATCHES "-nvidia-") - set(ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") + set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "NVIDIA_GPU") endif() endforeach() @@ -174,7 +174,7 @@ set(SOURCES portblas_level3_double.cpp portblas_level3_float.cpp portblas_level3_half.cpp portblas_level3_bfloat16.cpp portblas_batch.cpp - $<$: portblas_wrappers.cpp>) + $<$: portblas_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) @@ -199,7 +199,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/rocblas/CMakeLists.txt b/src/blas/backends/rocblas/CMakeLists.txt index 76dc126ad..af5e6a126 100644 --- a/src/blas/backends/rocblas/CMakeLists.txt +++ b/src/blas/backends/rocblas/CMakeLists.txt @@ -32,7 +32,7 @@ set(SOURCES rocblas_level1.cpp rocblas_extensions.cpp $<$:rocblas_scope_handle.cpp > $<$:rocblas_scope_handle_hipsycl.cpp > - $<$: rocblas_wrappers.cpp>) + $<$: rocblas_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) diff --git a/src/config.hpp.in b/src/config.hpp.in index 16ee5a43f..85c876a72 100644 --- a/src/config.hpp.in +++ b/src/config.hpp.in @@ -20,23 +20,23 @@ #ifndef ONEMKL_CONFIG_H #define ONEMKL_CONFIG_H -#cmakedefine ENABLE_CUBLAS_BACKEND -#cmakedefine ENABLE_CUFFT_BACKEND -#cmakedefine ENABLE_CURAND_BACKEND -#cmakedefine ENABLE_CUSOLVER_BACKEND -#cmakedefine ENABLE_MKLCPU_BACKEND -#cmakedefine ENABLE_MKLGPU_BACKEND -#cmakedefine ENABLE_NETLIB_BACKEND -#cmakedefine ENABLE_PORTBLAS_BACKEND -#cmakedefine ENABLE_PORTBLAS_BACKEND_AMD_GPU -#cmakedefine ENABLE_PORTBLAS_BACKEND_INTEL_CPU -#cmakedefine ENABLE_PORTBLAS_BACKEND_INTEL_GPU -#cmakedefine ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU -#cmakedefine ENABLE_PORTFFT_BACKEND -#cmakedefine ENABLE_ROCBLAS_BACKEND -#cmakedefine ENABLE_ROCFFT_BACKEND -#cmakedefine ENABLE_ROCRAND_BACKEND -#cmakedefine ENABLE_ROCSOLVER_BACKEND -#cmakedefine BUILD_SHARED_LIBS +#cmakedefine ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU +#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU +#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU +#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU +#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND +#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND +#cmakedefine ONEAPI_ONEMKL_BUILD_SHARED_LIBS #endif diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt index e3b373645..1c1e05d78 100644 --- a/src/dft/CMakeLists.txt +++ b/src/dft/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for DFT loader object -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(onemkl_dft OBJECT) target_sources(onemkl_dft PRIVATE backends/descriptor.cpp dft_loader.cpp) target_include_directories(onemkl_dft diff --git a/src/dft/backends/CMakeLists.txt b/src/dft/backends/CMakeLists.txt index b03a63e8a..eeee4be78 100644 --- a/src/dft/backends/CMakeLists.txt +++ b/src/dft/backends/CMakeLists.txt @@ -20,22 +20,22 @@ add_custom_target(onemkl_backend_libs_dft) add_dependencies(onemkl_backend_libs onemkl_backend_libs_dft) -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ENABLE_CUFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) add_subdirectory(cufft) endif() -if(ENABLE_ROCFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) add_subdirectory(rocfft) endif() -if(ENABLE_PORTFFT_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) add_subdirectory(portfft) endif() diff --git a/src/dft/backends/cufft/CMakeLists.txt b/src/dft/backends/cufft/CMakeLists.txt index 010905546..5e66c1375 100644 --- a/src/dft/backends/cufft/CMakeLists.txt +++ b/src/dft/backends/cufft/CMakeLists.txt @@ -27,7 +27,7 @@ add_library(${LIB_OBJ} OBJECT commit.cpp forward.cpp backward.cpp - $<$: mkl_dft_cufft_wrappers.cpp> + $<$: mkl_dft_cufft_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -62,7 +62,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/mklcpu/CMakeLists.txt b/src/dft/backends/mklcpu/CMakeLists.txt index 6d0f1276d..1a610c96b 100644 --- a/src/dft/backends/mklcpu/CMakeLists.txt +++ b/src/dft/backends/mklcpu/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(${LIB_OBJ} OBJECT descriptor.cpp forward.cpp backward.cpp - $<$: mkl_dft_cpu_wrappers.cpp> + $<$: mkl_dft_cpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -70,7 +70,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/mklgpu/CMakeLists.txt b/src/dft/backends/mklgpu/CMakeLists.txt index 7e88a23d9..c4250fccf 100644 --- a/src/dft/backends/mklgpu/CMakeLists.txt +++ b/src/dft/backends/mklgpu/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(${LIB_OBJ} OBJECT commit.cpp forward.cpp backward.cpp - $<$: mkl_dft_gpu_wrappers.cpp> + $<$: mkl_dft_gpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -66,7 +66,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/portfft/CMakeLists.txt b/src/dft/backends/portfft/CMakeLists.txt index 752fae8d5..f4fd375b4 100644 --- a/src/dft/backends/portfft/CMakeLists.txt +++ b/src/dft/backends/portfft/CMakeLists.txt @@ -65,7 +65,7 @@ add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT descriptor.cpp commit.cpp - $<$: mkl_dft_portfft_wrappers.cpp> + $<$: mkl_dft_portfft_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -111,7 +111,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/rocfft/CMakeLists.txt b/src/dft/backends/rocfft/CMakeLists.txt index 1380c8f0a..a11ca4b78 100644 --- a/src/dft/backends/rocfft/CMakeLists.txt +++ b/src/dft/backends/rocfft/CMakeLists.txt @@ -27,7 +27,7 @@ add_library(${LIB_OBJ} OBJECT commit.cpp forward.cpp backward.cpp - $<$: mkl_dft_rocfft_wrappers.cpp> + $<$: mkl_dft_rocfft_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -72,7 +72,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) # Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index 524edde03..3e589678f 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for LAPACK loader object -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(onemkl_lapack OBJECT) target_sources(onemkl_lapack PRIVATE lapack_loader.cpp) target_include_directories(onemkl_lapack diff --git a/src/lapack/backends/CMakeLists.txt b/src/lapack/backends/CMakeLists.txt index 636f6728f..530116c0a 100644 --- a/src/lapack/backends/CMakeLists.txt +++ b/src/lapack/backends/CMakeLists.txt @@ -20,18 +20,18 @@ add_custom_target(onemkl_backend_libs_lapack) add_dependencies(onemkl_backend_libs onemkl_backend_libs_lapack) -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ENABLE_CUSOLVER_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) add_subdirectory(cusolver) endif() -if(ENABLE_ROCSOLVER_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) add_subdirectory(rocsolver) endif() diff --git a/src/lapack/backends/cusolver/CMakeLists.txt b/src/lapack/backends/cusolver/CMakeLists.txt index dfd1267d7..fbd280024 100644 --- a/src/lapack/backends/cusolver/CMakeLists.txt +++ b/src/lapack/backends/cusolver/CMakeLists.txt @@ -24,7 +24,7 @@ find_package(cuBLAS REQUIRED) set(SOURCES cusolver_lapack.cpp cusolver_batch.cpp $<$:cusolver_scope_handle.cpp > - $<$: cusolver_wrappers.cpp>) + $<$: cusolver_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) diff --git a/src/lapack/backends/mklcpu/CMakeLists.txt b/src/lapack/backends/mklcpu/CMakeLists.txt index fcc60a8e7..802134084 100644 --- a/src/lapack/backends/mklcpu/CMakeLists.txt +++ b/src/lapack/backends/mklcpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mkl_lapack.cpp - $<$: lapack_cpu_wrappers.cpp> + $<$: lapack_cpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) @@ -48,7 +48,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/lapack/backends/mklgpu/CMakeLists.txt b/src/lapack/backends/mklgpu/CMakeLists.txt index e11592f82..53bf95aaf 100644 --- a/src/lapack/backends/mklgpu/CMakeLists.txt +++ b/src/lapack/backends/mklgpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mkl_lapack.cpp - $<$: lapack_gpu_wrappers.cpp> + $<$: lapack_gpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) @@ -48,7 +48,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/lapack/backends/rocsolver/CMakeLists.txt b/src/lapack/backends/rocsolver/CMakeLists.txt index c91089118..4280c26f1 100644 --- a/src/lapack/backends/rocsolver/CMakeLists.txt +++ b/src/lapack/backends/rocsolver/CMakeLists.txt @@ -28,7 +28,7 @@ find_package(Threads REQUIRED) set(SOURCES rocsolver_lapack.cpp rocsolver_batch.cpp $<$:rocsolver_scope_handle.cpp> - $<$: rocsolver_wrappers.cpp>) + $<$: rocsolver_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) diff --git a/src/rng/CMakeLists.txt b/src/rng/CMakeLists.txt index 30df39403..68916015d 100644 --- a/src/rng/CMakeLists.txt +++ b/src/rng/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for RNG loader object -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(onemkl_rng OBJECT) target_sources(onemkl_rng PRIVATE rng_loader.cpp) target_include_directories(onemkl_rng diff --git a/src/rng/backends/CMakeLists.txt b/src/rng/backends/CMakeLists.txt index 9045f7e75..5608520de 100644 --- a/src/rng/backends/CMakeLists.txt +++ b/src/rng/backends/CMakeLists.txt @@ -20,19 +20,19 @@ add_custom_target(onemkl_backend_libs_rng) add_dependencies(onemkl_backend_libs onemkl_backend_libs_rng) -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ENABLE_CURAND_BACKEND AND UNIX) +if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND AND UNIX) add_subdirectory(curand) endif() -if(ENABLE_ROCRAND_BACKEND AND UNIX) +if(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND AND UNIX) add_subdirectory(rocrand) endif() diff --git a/src/rng/backends/curand/CMakeLists.txt b/src/rng/backends/curand/CMakeLists.txt index f37a34f1d..8782fe6dc 100644 --- a/src/rng/backends/curand/CMakeLists.txt +++ b/src/rng/backends/curand/CMakeLists.txt @@ -62,7 +62,7 @@ find_package(cuRAND REQUIRED) set(SOURCES philox4x32x10.cpp mrg32k3a.cpp - $<$: mkl_rng_curand_wrappers.cpp>) + $<$: mkl_rng_curand_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) diff --git a/src/rng/backends/mklcpu/CMakeLists.txt b/src/rng/backends/mklcpu/CMakeLists.txt index e72ce048f..e4fd1fddc 100644 --- a/src/rng/backends/mklcpu/CMakeLists.txt +++ b/src/rng/backends/mklcpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) set(SOURCES cpu_common.hpp philox4x32x10.cpp mrg32k3a.cpp - $<$: mkl_rng_cpu_wrappers.cpp> + $<$: mkl_rng_cpu_wrappers.cpp> ) add_library(${LIB_NAME}) @@ -48,7 +48,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) # Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/rng/backends/mklgpu/CMakeLists.txt b/src/rng/backends/mklgpu/CMakeLists.txt index 150f90136..3270eb705 100644 --- a/src/rng/backends/mklgpu/CMakeLists.txt +++ b/src/rng/backends/mklgpu/CMakeLists.txt @@ -25,7 +25,7 @@ add_library(${LIB_OBJ} OBJECT mkl_internal_rng_gpu.hpp philox4x32x10.cpp mrg32k3a.cpp - $<$: mkl_rng_gpu_wrappers.cpp> + $<$: mkl_rng_gpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_rng ${LIB_NAME}) @@ -50,7 +50,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) # Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/rng/backends/rocrand/CMakeLists.txt b/src/rng/backends/rocrand/CMakeLists.txt index 47929703b..f4a148c46 100644 --- a/src/rng/backends/rocrand/CMakeLists.txt +++ b/src/rng/backends/rocrand/CMakeLists.txt @@ -58,7 +58,7 @@ find_package(hip REQUIRED) find_package(rocrand REQUIRED) find_package(Threads REQUIRED) -set(SOURCES philox4x32x10.cpp mrg32k3a.cpp $<$: +set(SOURCES philox4x32x10.cpp mrg32k3a.cpp $<$: mkl_rng_rocrand_wrappers.cpp>) add_library(${LIB_NAME}) diff --git a/src/sparse_blas/CMakeLists.txt b/src/sparse_blas/CMakeLists.txt index b01cc63fd..9977a1b4c 100644 --- a/src/sparse_blas/CMakeLists.txt +++ b/src/sparse_blas/CMakeLists.txt @@ -19,7 +19,7 @@ add_subdirectory(backends) -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(onemkl_sparse_blas OBJECT) target_sources(onemkl_sparse_blas PRIVATE sparse_blas_loader.cpp) target_include_directories(onemkl_sparse_blas diff --git a/src/sparse_blas/backends/CMakeLists.txt b/src/sparse_blas/backends/CMakeLists.txt index 294040808..d856f9a3f 100644 --- a/src/sparse_blas/backends/CMakeLists.txt +++ b/src/sparse_blas/backends/CMakeLists.txt @@ -20,10 +20,10 @@ add_custom_target(onemkl_backend_libs_sparse_blas) add_dependencies(onemkl_backend_libs onemkl_backend_libs_sparse_blas) -if(ENABLE_MKLCPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ENABLE_MKLGPU_BACKEND) +if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() diff --git a/src/sparse_blas/backends/mklcpu/CMakeLists.txt b/src/sparse_blas/backends/mklcpu/CMakeLists.txt index e41cae268..aa9c531f7 100644 --- a/src/sparse_blas/backends/mklcpu/CMakeLists.txt +++ b/src/sparse_blas/backends/mklcpu/CMakeLists.txt @@ -26,7 +26,7 @@ add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mklcpu_handles.cpp mklcpu_operations.cpp - $<$: mklcpu_wrappers.cpp> + $<$: mklcpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_sparse_blas ${LIB_NAME}) @@ -59,7 +59,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/sparse_blas/backends/mklgpu/CMakeLists.txt b/src/sparse_blas/backends/mklgpu/CMakeLists.txt index cd25babc2..3d667f1b6 100644 --- a/src/sparse_blas/backends/mklgpu/CMakeLists.txt +++ b/src/sparse_blas/backends/mklgpu/CMakeLists.txt @@ -26,7 +26,7 @@ add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mklgpu_handles.cpp mklgpu_operations.cpp - $<$: mklgpu_wrappers.cpp> + $<$: mklgpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_sparse_blas ${LIB_NAME}) @@ -59,7 +59,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index e7fe8e110..7ac8b4e6e 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -93,7 +93,7 @@ foreach(domain ${TARGET_DOMAINS}) target_compile_options(test_main_${domain}_ct PRIVATE -fsycl) endif() - if(BUILD_SHARED_LIBS) + if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_executable(test_main_${domain}_rt main_test.cpp) target_include_directories(test_main_${domain}_rt PUBLIC ${GTEST_INCLUDE_DIR}) if(NOT ${ONEMKL_SYCL_IMPLEMENTATION} STREQUAL "hipsycl") @@ -113,67 +113,67 @@ foreach(domain ${TARGET_DOMAINS}) endif() endif() - if(ENABLE_MKLCPU_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_mklcpu) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu) endif() - if(ENABLE_MKLGPU_BACKEND) + if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_mklgpu) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklgpu) endif() - if(domain STREQUAL "blas" AND ENABLE_CUBLAS_BACKEND) + if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_cublas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_cublas) endif() - if(domain STREQUAL "blas" AND ENABLE_ROCBLAS_BACKEND) + if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_rocblas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_rocblas) endif() - if(domain STREQUAL "blas" AND ENABLE_NETLIB_BACKEND) + if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_netlib) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_netlib) endif() - if(domain STREQUAL "blas" AND ENABLE_PORTBLAS_BACKEND) + if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_portblas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_portblas) endif() - if(domain STREQUAL "lapack" AND ENABLE_CUSOLVER_BACKEND) + if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_cusolver) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_cusolver) endif() - if(domain STREQUAL "lapack" AND ENABLE_ROCSOLVER_BACKEND) + if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_rocsolver) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_rocsolver) endif() - if(domain STREQUAL "rng" AND ENABLE_CURAND_BACKEND) + if(domain STREQUAL "rng" AND ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_curand) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_curand) endif() - if(domain STREQUAL "rng" AND ENABLE_ROCRAND_BACKEND) + if(domain STREQUAL "rng" AND ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_rocrand) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_rocrand) endif() - if(domain STREQUAL "dft" AND ENABLE_CUFFT_BACKEND) + if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_cufft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_cufft) endif() - if(domain STREQUAL "dft" AND ENABLE_ROCFFT_BACKEND) + if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_dft_rocfft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_dft_rocfft) endif() - if(domain STREQUAL "dft" AND ENABLE_PORTFFT_BACKEND) + if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_dft_portfft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_dft_portfft) endif() @@ -201,7 +201,7 @@ foreach(domain ${TARGET_DOMAINS}) set(TEST_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}) endif() - if(BUILD_SHARED_LIBS) + if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) set_target_properties(test_main_${domain}_rt PROPERTIES BUILD_RPATH $) # Find individual tests within executable @@ -220,7 +220,7 @@ foreach(domain ${TARGET_DOMAINS}) DISCOVERY_TIMEOUT 30 ) - if(BUILD_SHARED_LIBS) + if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) if (USE_ADD_SYCL_TO_TARGET_INTEGRATION) add_sycl_to_target(TARGET test_main_${domain}_rt) endif() diff --git a/tests/unit_tests/blas/batch/CMakeLists.txt b/tests/unit_tests/blas/batch/CMakeLists.txt index 0f47f37af..b219a4e25 100644 --- a/tests/unit_tests/blas/batch/CMakeLists.txt +++ b/tests/unit_tests/blas/batch/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(BATCH_SOURCES "copy_batch_stride.cpp" "axpy_batch_stride.cpp" "dgmm_batch_stride.cpp" "gemm_batch_stride.cpp" "gemv_batch_stride.cpp" "trsm_batch_stride.cpp" "syrk_batch_stride.cpp" "copy_batch_usm.cpp" "copy_batch_stride_usm.cpp" "axpy_batch_usm.cpp" "axpy_batch_stride_usm.cpp" "dgmm_batch_usm.cpp" "dgmm_batch_stride_usm.cpp" "gemm_batch_usm.cpp" "gemm_batch_stride_usm.cpp" "gemv_batch_usm.cpp" "gemv_batch_stride_usm.cpp" "trsm_batch_usm.cpp" "trsm_batch_stride_usm.cpp" "syrk_batch_usm.cpp" "syrk_batch_stride_usm.cpp" "omatcopy_batch_stride.cpp" "omatcopy_batch_stride_usm.cpp" "imatcopy_batch_stride.cpp" "imatcopy_batch_stride_usm.cpp" "omatadd_batch_stride.cpp" "omatadd_batch_stride_usm.cpp" "omatcopy_batch_usm.cpp" "imatcopy_batch_usm.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(blas_batch_rt OBJECT ${BATCH_SOURCES}) target_compile_options(blas_batch_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_batch_rt diff --git a/tests/unit_tests/blas/extensions/CMakeLists.txt b/tests/unit_tests/blas/extensions/CMakeLists.txt index af58e5076..35817051d 100644 --- a/tests/unit_tests/blas/extensions/CMakeLists.txt +++ b/tests/unit_tests/blas/extensions/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(EXTENSIONS_SOURCES "gemm_bias.cpp" "gemmt.cpp" "gemm_bias_usm.cpp" "gemmt_usm.cpp" "omatcopy.cpp" "omatcopy_usm.cpp" "imatcopy.cpp" "imatcopy_usm.cpp" "omatadd.cpp" "omatadd_usm.cpp" "omatcopy2.cpp" "omatcopy2_usm.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(blas_extensions_rt OBJECT ${EXTENSIONS_SOURCES}) target_compile_options(blas_extensions_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_extensions_rt diff --git a/tests/unit_tests/blas/include/reference_blas_wrappers.hpp b/tests/unit_tests/blas/include/reference_blas_wrappers.hpp index 8c7d0938a..a3841085d 100644 --- a/tests/unit_tests/blas/include/reference_blas_wrappers.hpp +++ b/tests/unit_tests/blas/include/reference_blas_wrappers.hpp @@ -41,11 +41,11 @@ extern "C" { static LIB_TYPE h_libblas = NULL; static LIB_TYPE blas_library() { if (h_libblas == NULL) { - h_libblas = GET_LIB_HANDLE(REF_BLAS_LIBNAME); + h_libblas = GET_LIB_HANDLE(ONEAPI_ONEMKL_REF_BLAS_LIBNAME); if (h_libblas == NULL) { throw oneapi::mkl::library_not_found( "BLAS", "blas_library()", - std::string("failed to load BLAS library ") + REF_BLAS_LIBNAME); + std::string("failed to load BLAS library ") + ONEAPI_ONEMKL_REF_BLAS_LIBNAME); } } return h_libblas; @@ -54,11 +54,11 @@ static LIB_TYPE blas_library() { static LIB_TYPE h_libcblas = NULL; static LIB_TYPE cblas_library() { if (h_libcblas == NULL) { - h_libcblas = GET_LIB_HANDLE(REF_CBLAS_LIBNAME); + h_libcblas = GET_LIB_HANDLE(ONEAPI_ONEMKL_REF_CBLAS_LIBNAME); if (h_libcblas == NULL) { throw oneapi::mkl::library_not_found( "BLAS", "cblas_library()", - std::string("failed to load CBLAS library ") + REF_CBLAS_LIBNAME); + std::string("failed to load CBLAS library ") + ONEAPI_ONEMKL_REF_CBLAS_LIBNAME); } } return h_libcblas; diff --git a/tests/unit_tests/blas/level1/CMakeLists.txt b/tests/unit_tests/blas/level1/CMakeLists.txt index f02adbde3..01ddeca19 100644 --- a/tests/unit_tests/blas/level1/CMakeLists.txt +++ b/tests/unit_tests/blas/level1/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(L1_SOURCES "nrm2.cpp" "iamin.cpp" "iamax.cpp" "dotu.cpp" "dot.cpp" "dotc.cpp" "copy.cpp" "axpy.cpp" "axpby.cpp" "asum.cpp" "swap.cpp" "sdsdot.cpp" "scal.cpp" "rotmg.cpp" "rotm.cpp" "rotg.cpp" "rot.cpp" "nrm2_usm.cpp" "iamin_usm.cpp" "iamax_usm.cpp" "dotu_usm.cpp" "dot_usm.cpp" "dotc_usm.cpp" "copy_usm.cpp" "axpy_usm.cpp" "axpby_usm.cpp" "asum_usm.cpp" "swap_usm.cpp" "sdsdot_usm.cpp" "scal_usm.cpp" "rotmg_usm.cpp" "rotm_usm.cpp" "rotg_usm.cpp" "rot_usm.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(blas_level1_rt OBJECT ${L1_SOURCES}) target_compile_options(blas_level1_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_level1_rt diff --git a/tests/unit_tests/blas/level2/CMakeLists.txt b/tests/unit_tests/blas/level2/CMakeLists.txt index a61bcfeef..5840bafb4 100644 --- a/tests/unit_tests/blas/level2/CMakeLists.txt +++ b/tests/unit_tests/blas/level2/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(L2_SOURCES "hpr2.cpp" "hpmv.cpp" "her.cpp" "her2.cpp" "hemv.cpp" "hbmv.cpp" "geru.cpp" "ger.cpp" "gerc.cpp" "gemv.cpp" "gbmv.cpp" "trsv.cpp" "trmv.cpp" "tpsv.cpp" "tpmv.cpp" "tbsv.cpp" "tbmv.cpp" "syr.cpp" "syr2.cpp" "symv.cpp" "spr.cpp" "spr2.cpp" "spmv.cpp" "sbmv.cpp" "hpr.cpp" "hpr2_usm.cpp" "hpmv_usm.cpp" "her_usm.cpp" "her2_usm.cpp" "hemv_usm.cpp" "hbmv_usm.cpp" "geru_usm.cpp" "ger_usm.cpp" "gerc_usm.cpp" "gemv_usm.cpp" "gbmv_usm.cpp" "trsv_usm.cpp" "trmv_usm.cpp" "tpsv_usm.cpp" "tpmv_usm.cpp" "tbsv_usm.cpp" "tbmv_usm.cpp" "syr_usm.cpp" "syr2_usm.cpp" "symv_usm.cpp" "spr_usm.cpp" "spr2_usm.cpp" "spmv_usm.cpp" "sbmv_usm.cpp" "hpr_usm.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(blas_level2_rt OBJECT ${L2_SOURCES}) target_compile_options(blas_level2_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_level2_rt diff --git a/tests/unit_tests/blas/level3/CMakeLists.txt b/tests/unit_tests/blas/level3/CMakeLists.txt index 53cba3f4c..c8eb00f88 100644 --- a/tests/unit_tests/blas/level3/CMakeLists.txt +++ b/tests/unit_tests/blas/level3/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(L3_SOURCES "gemm.cpp" "symm.cpp" "syrk.cpp" "hemm.cpp" "herk.cpp" "syr2k.cpp" "her2k.cpp" "trmm.cpp" "trsm.cpp" "gemm_usm.cpp" "symm_usm.cpp" "syrk_usm.cpp" "hemm_usm.cpp" "herk_usm.cpp" "syr2k_usm.cpp" "her2k_usm.cpp" "trmm_usm.cpp" "trsm_usm.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(blas_level3_rt OBJECT ${L3_SOURCES}) target_compile_options(blas_level3_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_level3_rt diff --git a/tests/unit_tests/dft/source/CMakeLists.txt b/tests/unit_tests/dft/source/CMakeLists.txt index 364ad564f..8a685783e 100644 --- a/tests/unit_tests/dft/source/CMakeLists.txt +++ b/tests/unit_tests/dft/source/CMakeLists.txt @@ -21,7 +21,7 @@ set(DFT_SOURCES "compute_tests.cpp" "descriptor_tests.cpp" "workspace_external_t include(WarningsUtils) -if (BUILD_SHARED_LIBS) +if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(dft_source_rt OBJECT ${DFT_SOURCES}) target_compile_options(dft_source_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(dft_source_rt diff --git a/tests/unit_tests/include/test_helper.hpp b/tests/unit_tests/include/test_helper.hpp index ad215761f..bf00ffa77 100644 --- a/tests/unit_tests/include/test_helper.hpp +++ b/tests/unit_tests/include/test_helper.hpp @@ -73,8 +73,8 @@ if (d->get_info().size() == 0) \ GTEST_SKIP() << "Double precision is not supported on the device" -#if defined(ENABLE_MKLCPU_BACKEND) || defined(ENABLE_NETLIB_BACKEND) -#ifdef ENABLE_MKLCPU_BACKEND +#if defined(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) || defined(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) +#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND #define TEST_RUN_INTELCPU_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_INTELCPU_SELECT(q, func, ...) \ @@ -88,7 +88,7 @@ #define TEST_RUN_INTELCPU_SELECT(q, func, ...) #endif -#ifdef ENABLE_MKLGPU_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND #define TEST_RUN_INTELGPU_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_INTELGPU_SELECT(q, func, ...) \ @@ -98,55 +98,55 @@ #define TEST_RUN_INTELGPU_SELECT(q, func, ...) #endif -#ifdef ENABLE_CUBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND #define TEST_RUN_NVIDIAGPU_CUBLAS_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_NVIDIAGPU_CUBLAS_SELECT(q, func, ...) #endif -#ifdef ENABLE_CUSOLVER_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND #define TEST_RUN_NVIDIAGPU_CUSOLVER_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_NVIDIAGPU_CUSOLVER_SELECT(q, func, ...) #endif -#ifdef ENABLE_ROCBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND #define TEST_RUN_AMDGPU_ROCBLAS_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_AMDGPU_ROCBLAS_SELECT(q, func, ...) #endif -#ifdef ENABLE_CURAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND #define TEST_RUN_NVIDIAGPU_CURAND_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_NVIDIAGPU_CURAND_SELECT(q, func, ...) #endif -#ifdef ENABLE_ROCRAND_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND #define TEST_RUN_AMDGPU_ROCRAND_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_AMDGPU_ROCRAND_SELECT(q, func, ...) #endif -#ifdef ENABLE_ROCSOLVER_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND #define TEST_RUN_AMDGPU_ROCSOLVER_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_AMDGPU_ROCSOLVER_SELECT(q, func, ...) #endif -#ifdef ENABLE_PORTBLAS_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND #define TEST_RUN_PORTBLAS_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_PORTBLAS_SELECT(q, func, ...) #endif -#ifdef ENABLE_CUFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND #define TEST_RUN_NVIDIAGPU_CUFFT_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_NVIDIAGPU_CUFFT_SELECT(q, func, ...) \ @@ -156,7 +156,7 @@ #define TEST_RUN_NVIDIAGPU_CUFFT_SELECT(q, func, ...) #endif -#ifdef ENABLE_ROCFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND #define TEST_RUN_AMDGPU_ROCFFT_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_AMDGPU_ROCFFT_SELECT(q, func, ...) \ @@ -166,7 +166,7 @@ #define TEST_RUN_AMDGPU_ROCFFT_SELECT(q, func, ...) #endif -#ifdef ENABLE_PORTFFT_BACKEND +#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND #define TEST_RUN_PORTFFT_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_PORTFFT_SELECT(q, func, ...) \ @@ -330,10 +330,10 @@ static inline void *malloc_shared(size_t align, size_t size, sycl::device dev, s #ifdef _WIN64 return sycl::malloc_shared(size, dev, ctx); #else -#if defined(ENABLE_CUBLAS_BACKEND) || defined(ENABLE_ROCBLAS_BACKEND) +#if defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) || defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::aligned_alloc_shared(align, size, dev, ctx); #endif -#if !defined(ENABLE_CUBLAS_BACKEND) && !defined(ENABLE_ROCBLAS_BACKEND) +#if !defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) && !defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::malloc_shared(size, dev, ctx); #endif #endif @@ -344,10 +344,10 @@ static inline void *malloc_device(size_t align, size_t size, sycl::device dev, s #ifdef _WIN64 return sycl::malloc_device(size, dev, ctx); #else -#if defined(ENABLE_CUBLAS_BACKEND) || defined(ENABLE_ROCBLAS_BACKEND) +#if defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) || defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::aligned_alloc_device(align, size, dev, ctx); #endif -#if !defined(ENABLE_CUBLAS_BACKEND) && !defined(ENABLE_ROCBLAS_BACKEND) +#if !defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) && !defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::malloc_device(size, dev, ctx); #endif #endif diff --git a/tests/unit_tests/lapack/common/CMakeLists.txt b/tests/unit_tests/lapack/common/CMakeLists.txt index 53479702b..a2081a7de 100644 --- a/tests/unit_tests/lapack/common/CMakeLists.txt +++ b/tests/unit_tests/lapack/common/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(LAPACK_COMMON_SOURCES "dependency_check.cpp" "test_log.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) target_sources(lapack_source_rt PRIVATE ${LAPACK_COMMON_SOURCES}) endif() diff --git a/tests/unit_tests/lapack/source/CMakeLists.txt b/tests/unit_tests/lapack/source/CMakeLists.txt index c61403c40..6dfad2157 100644 --- a/tests/unit_tests/lapack/source/CMakeLists.txt +++ b/tests/unit_tests/lapack/source/CMakeLists.txt @@ -68,7 +68,7 @@ set(LAPACK_SOURCES "unmtr.cpp" ) -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(lapack_source_rt OBJECT ${LAPACK_SOURCES}) target_compile_options(lapack_source_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(lapack_source_rt diff --git a/tests/unit_tests/main_test.cpp b/tests/unit_tests/main_test.cpp index 7a20e0ed8..dcbcbee1f 100644 --- a/tests/unit_tests/main_test.cpp +++ b/tests/unit_tests/main_test.cpp @@ -112,25 +112,33 @@ int main(int argc, char** argv) { if (unique_devices.find(dev.get_info()) == unique_devices.end()) { unique_devices.insert(dev.get_info()); -#if !defined(ENABLE_MKLCPU_BACKEND) && !defined(ENABLE_PORTBLAS_BACKEND_INTEL_CPU) && \ - !defined(ENABLE_PORTFFT_BACKEND) && !defined(ENABLE_NETLIB_BACKEND) +#if !defined(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU) && \ + !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) if (dev.is_cpu()) continue; #endif -#if !defined(ENABLE_MKLGPU_BACKEND) && !defined(ENABLE_PORTBLAS_BACKEND_INTEL_GPU) && \ - !defined(ENABLE_PORTFFT_BACKEND) +#if !defined(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU) && \ + !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) if (dev.is_gpu() && vendor_id == INTEL_ID) continue; #endif -#if !defined(ENABLE_CUBLAS_BACKEND) && !defined(ENABLE_CURAND_BACKEND) && \ - !defined(ENABLE_CUSOLVER_BACKEND) && !defined(ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU) && \ - !defined(ENABLE_CUFFT_BACKEND) && !defined(ENABLE_PORTFFT_BACKEND) +#if !defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU) && \ + !defined(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) && !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) if (dev.is_gpu() && vendor_id == NVIDIA_ID) continue; #endif -#if !defined(ENABLE_ROCBLAS_BACKEND) && !defined(ENABLE_ROCRAND_BACKEND) && \ - !defined(ENABLE_ROCSOLVER_BACKEND) && !defined(ENABLE_PORTBLAS_BACKEND_AMD_GPU) && \ - !defined(ENABLE_ROCFFT_BACKEND) && !defined(ENABLE_PORTFFT_BACKEND) +#if !defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU) && \ + !defined(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) && \ + !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) if (dev.is_gpu() && vendor_id == AMD_ID) continue; #endif diff --git a/tests/unit_tests/rng/include/rng_test_common.hpp b/tests/unit_tests/rng/include/rng_test_common.hpp index d01b04cce..b3a963bbd 100644 --- a/tests/unit_tests/rng/include/rng_test_common.hpp +++ b/tests/unit_tests/rng/include/rng_test_common.hpp @@ -92,7 +92,7 @@ class rng_test { } }; -#ifdef ENABLE_CURAND_BACKEND // w/a for cuda backend hangs when there are several queues with different contexts +#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND // w/a for cuda backend hangs when there are several queues with different contexts static sycl::device* previous_device = nullptr; static sycl::context* context = nullptr; diff --git a/tests/unit_tests/rng/service/CMakeLists.txt b/tests/unit_tests/rng/service/CMakeLists.txt index 8436ce9eb..eadc88118 100644 --- a/tests/unit_tests/rng/service/CMakeLists.txt +++ b/tests/unit_tests/rng/service/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(SERVICE_TESTS_SOURCES "skip_ahead.cpp" "engines_api_test.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(rng_service_rt OBJECT ${SERVICE_TESTS_SOURCES}) target_compile_options(rng_service_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(rng_service_rt diff --git a/tests/unit_tests/rng/statistics_check/CMakeLists.txt b/tests/unit_tests/rng/statistics_check/CMakeLists.txt index 244d33976..6515b3897 100644 --- a/tests/unit_tests/rng/statistics_check/CMakeLists.txt +++ b/tests/unit_tests/rng/statistics_check/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(STATS_CHECK_SOURCES "uniform.cpp" "uniform_usm.cpp" "gaussian_usm.cpp" "gaussian.cpp" "lognormal_usm.cpp" "lognormal.cpp" "bernoulli_usm.cpp" "bernoulli.cpp" "poisson_usm.cpp" "poisson.cpp") -if(BUILD_SHARED_LIBS) +if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(rng_statistics_rt OBJECT ${STATS_CHECK_SOURCES}) target_compile_options(rng_statistics_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(rng_statistics_rt diff --git a/tests/unit_tests/sparse_blas/source/CMakeLists.txt b/tests/unit_tests/sparse_blas/source/CMakeLists.txt index a9271bfa2..dfea29515 100644 --- a/tests/unit_tests/sparse_blas/source/CMakeLists.txt +++ b/tests/unit_tests/sparse_blas/source/CMakeLists.txt @@ -28,7 +28,7 @@ set(SPBLAS_SOURCES include(WarningsUtils) -if (BUILD_SHARED_LIBS) +if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) add_library(spblas_source_rt OBJECT ${SPBLAS_SOURCES}) target_compile_options(spblas_source_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(spblas_source_rt From d4d236454b7678a6e33fa4b503c0a2cbba47f849 Mon Sep 17 00:00:00 2001 From: nscipione Date: Mon, 16 Sep 2024 17:33:59 +0100 Subject: [PATCH 02/10] Add comment to justify cmake changes and reason --- CMakeLists.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47c1e25a0..a8b164afa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,15 +42,6 @@ endif() 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) - set(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND True) -endif() - -if(ENABLE_MKLGPU_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND True) -endif() - # blas option(ENABLE_CUBLAS_BACKEND "Enable the cuBLAS backend for the BLAS interface" OFF) option(ENABLE_ROCBLAS_BACKEND "Enable the rocBLAS backend for the BLAS interface" OFF) @@ -70,6 +61,18 @@ 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) +# 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 +if(ENABLE_MKLCPU_BACKEND) + option(ENABLE_MKLCPU_THREAD_TBB "Enable the use of Intel TBB with the oneMKL CPU backend" ON) + set(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND True) +endif() + +if(ENABLE_MKLGPU_BACKEND) + set(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND True) +endif() + if(ENABLE_CUBLAS_BACKEND) set(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND True) endif() From 6edba7d82d0e67737ba11d84a1fc21b8f33228a6 Mon Sep 17 00:00:00 2001 From: nscipione Date: Tue, 17 Sep 2024 09:03:32 +0100 Subject: [PATCH 03/10] Revert some changes only in CMake files and documentation --- CMakeLists.txt | 84 +++++++++---------- cmake/CMakeLists.txt | 2 +- deps/googletest/CMakeLists.txt | 4 +- docs/building_and_running_tests.rst | 4 +- .../building_the_project_with_adaptivecpp.rst | 22 ++--- docs/building_the_project_with_dpcpp.rst | 78 ++++++++--------- docs/create_new_backend.rst | 28 +++---- examples/README.md | 2 +- examples/blas/CMakeLists.txt | 2 +- .../level3/CMakeLists.txt | 4 +- .../level3/CMakeLists.txt | 10 +-- examples/dft/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 4 +- .../dft/run_time_dispatching/CMakeLists.txt | 16 ++-- examples/lapack/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 6 +- .../run_time_dispatching/CMakeLists.txt | 8 +- examples/rng/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 6 +- examples/rng/device/CMakeLists.txt | 8 +- .../rng/run_time_dispatching/CMakeLists.txt | 8 +- examples/sparse_blas/CMakeLists.txt | 2 +- .../compile_time_dispatching/CMakeLists.txt | 2 +- .../run_time_dispatching/CMakeLists.txt | 4 +- src/CMakeLists.txt | 12 +-- src/blas/CMakeLists.txt | 2 +- src/blas/backends/CMakeLists.txt | 12 +-- src/blas/backends/cublas/CMakeLists.txt | 2 +- src/blas/backends/mklcpu/CMakeLists.txt | 4 +- src/blas/backends/mklgpu/CMakeLists.txt | 4 +- src/blas/backends/netlib/CMakeLists.txt | 4 +- src/blas/backends/portblas/CMakeLists.txt | 4 +- src/blas/backends/rocblas/CMakeLists.txt | 2 +- src/dft/CMakeLists.txt | 2 +- src/dft/backends/CMakeLists.txt | 10 +-- src/dft/backends/cufft/CMakeLists.txt | 4 +- src/dft/backends/mklcpu/CMakeLists.txt | 4 +- src/dft/backends/mklgpu/CMakeLists.txt | 4 +- src/dft/backends/portfft/CMakeLists.txt | 4 +- src/dft/backends/rocfft/CMakeLists.txt | 4 +- src/lapack/CMakeLists.txt | 2 +- src/lapack/backends/CMakeLists.txt | 8 +- src/lapack/backends/cusolver/CMakeLists.txt | 2 +- src/lapack/backends/mklcpu/CMakeLists.txt | 4 +- src/lapack/backends/mklgpu/CMakeLists.txt | 4 +- src/lapack/backends/rocsolver/CMakeLists.txt | 2 +- src/rng/CMakeLists.txt | 2 +- src/rng/backends/CMakeLists.txt | 8 +- src/rng/backends/curand/CMakeLists.txt | 2 +- src/rng/backends/mklcpu/CMakeLists.txt | 4 +- src/rng/backends/mklgpu/CMakeLists.txt | 4 +- src/rng/backends/rocrand/CMakeLists.txt | 2 +- src/sparse_blas/CMakeLists.txt | 2 +- src/sparse_blas/backends/CMakeLists.txt | 4 +- .../backends/mklcpu/CMakeLists.txt | 4 +- .../backends/mklgpu/CMakeLists.txt | 4 +- tests/unit_tests/CMakeLists.txt | 32 +++---- tests/unit_tests/blas/batch/CMakeLists.txt | 2 +- .../unit_tests/blas/extensions/CMakeLists.txt | 2 +- tests/unit_tests/blas/level1/CMakeLists.txt | 2 +- tests/unit_tests/blas/level2/CMakeLists.txt | 2 +- tests/unit_tests/blas/level3/CMakeLists.txt | 2 +- tests/unit_tests/dft/source/CMakeLists.txt | 2 +- tests/unit_tests/lapack/common/CMakeLists.txt | 2 +- tests/unit_tests/lapack/source/CMakeLists.txt | 2 +- tests/unit_tests/rng/service/CMakeLists.txt | 2 +- .../rng/statistics_check/CMakeLists.txt | 2 +- .../sparse_blas/source/CMakeLists.txt | 2 +- 68 files changed, 250 insertions(+), 250 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8b164afa..beea29f47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,53 +131,53 @@ option(BUILD_DOC "" OFF) ## Supported domains set(DOMAINS_LIST "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND - OR ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND - OR ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND) +if(ENABLE_MKLCPU_BACKEND + OR ENABLE_MKLGPU_BACKEND + OR ENABLE_CUBLAS_BACKEND + OR ENABLE_ROCBLAS_BACKEND + OR ENABLE_NETLIB_BACKEND + OR ENABLE_PORTBLAS_BACKEND) list(APPEND DOMAINS_LIST "blas") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) +if(ENABLE_MKLCPU_BACKEND + OR ENABLE_MKLGPU_BACKEND + OR ENABLE_CUSOLVER_BACKEND + OR ENABLE_ROCSOLVER_BACKEND) list(APPEND DOMAINS_LIST "lapack") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) +if(ENABLE_MKLCPU_BACKEND + OR ENABLE_MKLGPU_BACKEND + OR ENABLE_CURAND_BACKEND + OR ENABLE_ROCRAND_BACKEND) list(APPEND DOMAINS_LIST "rng") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND - OR ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) +if(ENABLE_MKLGPU_BACKEND + OR ENABLE_MKLCPU_BACKEND + OR ENABLE_CUFFT_BACKEND + OR ENABLE_ROCFFT_BACKEND + OR ENABLE_PORTFFT_BACKEND) list(APPEND DOMAINS_LIST "dft") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND + OR ENABLE_MKLGPU_BACKEND) list(APPEND DOMAINS_LIST "sparse_blas") endif() -if(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND - AND (ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND - OR ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND)) - message(FATAL_ERROR "ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND cannot be enabled at the same time as other BLAS backends.") +if(ENABLE_PORTBLAS_BACKEND + AND (ENABLE_MKLCPU_BACKEND + OR ENABLE_MKLGPU_BACKEND + OR ENABLE_CUBLAS_BACKEND + OR ENABLE_ROCBLAS_BACKEND + OR ENABLE_NETLIB_BACKEND)) + message(FATAL_ERROR "ENABLE_PORTBLAS_BACKEND cannot be enabled at the same time as other BLAS backends.") endif() -if (ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND - AND (ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND - OR ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND)) - message(FATAL_ERROR "ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND cannot be enabled at the same time as other DFT backends.") +if (ENABLE_PORTFFT_BACKEND + AND (ENABLE_MKLCPU_BACKEND + OR ENABLE_MKLGPU_BACKEND + OR ENABLE_ROCFFT_BACKEND + OR ENABLE_CUFFT_BACKEND)) + message(FATAL_ERROR "ENABLE_PORTFFT_BACKEND cannot be enabled at the same time as other DFT backends.") endif() # Define required CXX compilers before project @@ -186,12 +186,12 @@ if(CMAKE_CXX_COMPILER OR NOT ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++") string(REPLACE "\\" "/" CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER}) endif() else() - if(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND OR - ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND OR ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND OR - ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND OR - ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) + if(ENABLE_CUBLAS_BACKEND OR ENABLE_CURAND_BACKEND OR + ENABLE_CUSOLVER_BACKEND OR ENABLE_CUFFT_BACKEND OR + ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND OR + ENABLE_ROCSOLVER_BACKEND OR ENABLE_ROCFFT_BACKEND) set(CMAKE_CXX_COMPILER "clang++") - elseif(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) + elseif(ENABLE_MKLGPU_BACKEND) if(UNIX) set(CMAKE_CXX_COMPILER "icpx") else() @@ -263,7 +263,7 @@ if(WIN32 AND ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++") endif() # Temporary disable sycl 2020 deprecations warnings for cuSOLVER and rocSOLVER -if(ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++" AND (ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND)) +if(ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++" AND (ENABLE_ROCSOLVER_BACKEND)) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSYCL2020_DISABLE_DEPRECATION_WARNINGS") endif() @@ -289,7 +289,7 @@ endif() message(STATUS "TARGET_DOMAINS: ${TARGET_DOMAINS}") # Include Intel oneMKL -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND) set(MKL_ARCH intel64) set(MKL_INTERFACE ilp64) if(ENABLE_MKLCPU_THREAD_TBB) @@ -297,7 +297,7 @@ if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) else() set(MKL_THREADING sequential) endif() - if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS AND NOT WIN32) + if(BUILD_SHARED_LIBS AND NOT WIN32) set(MKL_LINK dynamic) else() set(MKL_LINK static) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 4e4487c58..df7d2fc4c 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -20,7 +20,7 @@ install(FILES FindCompiler.cmake DESTINATION "lib/cmake/${PROJECT_NAME}" ) -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND) install(FILES mkl/MKLConfig.cmake DESTINATION "lib/cmake/${PROJECT_NAME}" ) diff --git a/deps/googletest/CMakeLists.txt b/deps/googletest/CMakeLists.txt index 113c01a08..f6a528753 100644 --- a/deps/googletest/CMakeLists.txt +++ b/deps/googletest/CMakeLists.txt @@ -63,9 +63,9 @@ endif() # These commands only run if this is the main project if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution") - # ONEAPI_ONEMKL_BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to # make it prominent in the GUI. - option(ONEAPI_ONEMKL_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) + option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) else() diff --git a/docs/building_and_running_tests.rst b/docs/building_and_running_tests.rst index 463de5443..4cf5c9187 100644 --- a/docs/building_and_running_tests.rst +++ b/docs/building_and_running_tests.rst @@ -23,9 +23,9 @@ following: git clone https://github.com/Reference-LAPACK/lapack.git cd lapack; mkdir -p build; cd build - cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=True -DONEAPI_ONEMKL_BUILD_SHARED_LIBS=True .. + cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=True -DBUILD_SHARED_LIBS=True .. cmake --build . -j --target install - cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=False -DONEAPI_ONEMKL_BUILD_SHARED_LIBS=True .. + cmake -DCMAKE_INSTALL_PREFIX=~/lapack -DCBLAS=True -DLAPACK=True -DLAPACKE=True -DBUILD_INDEX64=False -DBUILD_SHARED_LIBS=True .. cmake --build . -j --target install and then used in oneMKL by setting ``-REF_BLAS_ROOT=/path/to/lapack/install`` diff --git a/docs/building_the_project_with_adaptivecpp.rst b/docs/building_the_project_with_adaptivecpp.rst index ba26ba2aa..98c763b90 100644 --- a/docs/building_the_project_with_adaptivecpp.rst +++ b/docs/building_the_project_with_adaptivecpp.rst @@ -36,7 +36,7 @@ On Linux (other OSes are not supported with the AdaptiveCpp compiler): # Inside mkdir build && cd build cmake .. -DONEMKL_SYCL_IMPLEMENTATION=hipsycl \ # Indicate that AdaptiveCpp is being used. - -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ # MKLGPU backend is not supported by AdaptiveCpp + -DENABLE_MKLGPU_BACKEND=False \ # MKLGPU backend is not supported by AdaptiveCpp -DENABLE__BACKEND=True \ # Enable backend(s) (optional) -DENABLE__BACKEND=True \ # Multiple backends can be enabled at once. -DHIPSYCL_TARGETS=omp/;hip:gfx90a,gfx906 \ # Set target architectures depending on supported devices. @@ -75,22 +75,22 @@ The most important supported build options are: * - CMake Option - Supported Values - Default Value - * - ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + * - ENABLE_MKLCPU_BACKEND - True, False - True - * - ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND + * - ENABLE_CUBLAS_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND + * - ENABLE_CURAND_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND + * - ENABLE_NETLIB_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND + * - ENABLE_ROCBLAS_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND + * - ENABLE_ROCRAND_BACKEND - True, False - False * - ENABLE_MKLCPU_THREAD_TBB @@ -117,8 +117,8 @@ Backends Building for CUDA ~~~~~~~~~~~~~~~~~ -The CUDA backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND`` and -``ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND``. +The CUDA backends can be enabled with ``ENABLE_CUBLAS_BACKEND`` and +``ENABLE_CURAND_BACKEND``. The target architecture must be set using the ``HIPSYCL_TARGETS`` parameter. For example, to target a Nvidia A100 (Ampere architecture), set @@ -137,8 +137,8 @@ the CUDA libraries should be found automatically by CMake. Building for ROCm ~~~~~~~~~~~~~~~~~ -The ROCm backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND`` and -``ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND``. +The ROCm backends can be enabled with ``ENABLE_ROCBLAS_BACKEND`` and +``ENABLE_ROCRAND_BACKEND``. The target architecture must be set using the ``HIPSYCL_TARGETS`` parameter. See the `AdaptiveCpp documentation diff --git a/docs/building_the_project_with_dpcpp.rst b/docs/building_the_project_with_dpcpp.rst index d7a779e45..6076117f7 100644 --- a/docs/building_the_project_with_dpcpp.rst +++ b/docs/building_the_project_with_dpcpp.rst @@ -44,8 +44,8 @@ for Windows`_ for building on Windows): mkdir build && cd build cmake .. -DCMAKE_CXX_COMPILER=$CXX_COMPILER \ # Should be icpx or clang++ -DCMAKE_C_COMPILER=$C_COMPILER \ # Should be icx or clang - -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=False \ # Optional: The MKLCPU backend is True by default. - -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ # Optional: The MKLGPU backend is True by default. + -DENABLE_MKLCPU_BACKEND=False \ # Optional: The MKLCPU backend is True by default. + -DENABLE_MKLGPU_BACKEND=False \ # Optional: The MKLGPU backend is True by default. -DENABLE__BACKEND=True \ # Enable any other backend(s) (optional) -DENABLE__BACKEND=True \ # Multiple backends can be enabled at once. -DBUILD_FUNCTIONAL_TESTS=False \ # See page *Building and Running Tests* for more on building tests. True by default. @@ -86,46 +86,46 @@ The most important supported build options are: * - CMake Option - Supported Values - Default Value - * - ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + * - ENABLE_MKLCPU_BACKEND - True, False - True - * - ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + * - ENABLE_MKLGPU_BACKEND - True, False - True - * - ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND + * - ENABLE_CUBLAS_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND + * - ENABLE_CUSOLVER_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND + * - ENABLE_CUFFT_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND + * - ENABLE_CURAND_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND + * - ENABLE_NETLIB_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND + * - ENABLE_ROCBLAS_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND + * - ENABLE_ROCFFT_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND + * - ENABLE_ROCSOLVER_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND + * - ENABLE_ROCRAND_BACKEND - True, False - False * - ENABLE_MKLCPU_THREAD_TBB - True, False - True - * - ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND + * - ENABLE_PORTBLAS_BACKEND - True, False - False - * - ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND + * - ENABLE_PORTFFT_BACKEND - True, False - False * - BUILD_FUNCTIONAL_TESTS @@ -166,9 +166,9 @@ Building for Intel(R) oneMKL The Intel(R) oneMKL backend supports multiple domains on both x86 CPUs and Intel GPUs. The MKLCPU backend using Intel(R) oneMKL for x86 CPU is enabled by -default, and controlled with the parameter ``ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND``. The MKLGPU +default, and controlled with the parameter ``ENABLE_MKLCPU_BACKEND``. The MKLGPU backend using Intel(R) oneMKL for Intel GPU is enabled by default, and -controlled with the parameter ``ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND``. +controlled with the parameter ``ENABLE_MKLGPU_BACKEND``. When using the Intel(R) oneAPI DPC++ Compiler, it is likely that Intel(R) oneMKL will be found automatically. If it is not, the parameter ``MKL_ROOT`` can be set @@ -182,9 +182,9 @@ environment script provided by the package. Building for CUDA ^^^^^^^^^^^^^^^^^ -The CUDA backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND``, -``ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND``, ``ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND``, and -``ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND``. +The CUDA backends can be enabled with ``ENABLE_CUBLAS_BACKEND``, +``ENABLE_CUFFT_BACKEND``, ``ENABLE_CURAND_BACKEND``, and +``ENABLE_CUSOLVER_BACKEND``. No additional parameters are required for using CUDA libraries. In most cases, the CUDA libraries should be found automatically by CMake. @@ -194,9 +194,9 @@ the CUDA libraries should be found automatically by CMake. Building for ROCm ^^^^^^^^^^^^^^^^^ -The ROCm backends can be enabled with ``ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND``, -``ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND``, ``ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND`` and -``ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND``. +The ROCm backends can be enabled with ``ENABLE_ROCBLAS_BACKEND``, +``ENABLE_ROCFFT_BACKEND``, ``ENABLE_ROCSOLVER_BACKEND`` and +``ENABLE_ROCRAND_BACKEND``. For *RocBLAS*, *RocSOLVER* and *RocRAND*, the target device architecture must be set. This can be set with using the ``HIP_TARGETS`` parameter. For example, to @@ -264,7 +264,7 @@ Building for portBLAS --------------------- `portBLAS `_ is -enabled by setting ``-DONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND=True``. +enabled by setting ``-DENABLE_PORTBLAS_BACKEND=True``. By default, the portBLAS backend is not tuned for any specific device. This tuning is required to achieve best performance. @@ -293,7 +293,7 @@ Building for portFFT --------------------- `portFFT `_ is enabled by setting -``-DONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND=True``. +``-DENABLE_PORTFFT_BACKEND=True``. By default, the portFFT backend is not tuned for any specific device. The tuning flags are detailed in the `portFFT @@ -332,7 +332,7 @@ The following table provides details of CMake options and their default values: * - CMake Option - Supported Values - Default Value - * - ONEAPI_ONEMKL_BUILD_SHARED_LIBS + * - BUILD_SHARED_LIBS - True, False - True * - BUILD_DOC @@ -365,12 +365,12 @@ disabled using the Ninja build system: -GNinja \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ - -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ - -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=False \ - -DONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND=True \ - -DONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND=True \ - -DONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND=True \ - -DONEAPI_ONEMKL_ENABLE_CURAND_BACKEND=True \ + -DENABLE_MKLGPU_BACKEND=False \ + -DENABLE_MKLCPU_BACKEND=False \ + -DENABLE_CUFFT_BACKEND=True \ + -DENABLE_CUBLAS_BACKEND=True \ + -DENABLE_CUSOLVER_BACKEND=True \ + -DENABLE_CURAND_BACKEND=True \ -DBUILD_FUNCTIONAL_TESTS=False ``$ONEMKL_DIR`` points at the oneMKL source directly. The x86 CPU (``MKLCPU``) @@ -386,11 +386,11 @@ disabled: cmake $ONEMKL_DIR \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ - -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=False \ - -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=False \ - -DONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND=True \ - -DONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND=True \ - -DONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND=True \ + -DENABLE_MKLCPU_BACKEND=False \ + -DENABLE_MKLGPU_BACKEND=False \ + -DENABLE_ROCFFT_BACKEND=True \ + -DENABLE_ROCBLAS_BACKEND=True \ + -DENABLE_ROCSOLVER_BACKEND=True \ -DHIP_TARGETS=gfx90a \ -DBUILD_FUNCTIONAL_TESTS=False @@ -408,8 +408,8 @@ GPU and Nvidia GPU with testing enabled: cmake $ONEMKL_DIR \ -DCMAKE_CXX_COMPILER=icpx \ -DCMAKE_C_COMPILER=icx \ - -DONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND=True \ - -DONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND=True \ + -DENABLE_ROCFFT_BACKEND=True \ + -DENABLE_CUFFT_BACKEND=True \ -DTARGET_DOMAINS=dft \ -DBUILD_EXAMPLES=False diff --git a/docs/create_new_backend.rst b/docs/create_new_backend.rst index e180749e8..5298ec3cc 100644 --- a/docs/create_new_backend.rst +++ b/docs/create_new_backend.rst @@ -163,7 +163,7 @@ To integrate the new third-party library to a oneMKL header-based part, followin } }, + { device::newdevice, + { - + #ifdef ENABLE_NEWLIB_BACKEND + + #ifdef ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND + LIB_NAME("blas_newlib") + #endif + } }, @@ -335,8 +335,8 @@ Here is the list of files that should be created/updated to integrate the new wr .. code-block:: diff - option(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND "" ON) - option(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND "" ON) + option(ENABLE_MKLCPU_BACKEND "" ON) + option(ENABLE_MKLGPU_BACKEND "" ON) + option(ENABLE_NEWLIB_BACKEND "" ON) * Add the new directory (``src//backends/``) with the wrappers for the new third-party library under the ``ENABLE_XXX_BACKEND`` condition to the ``src//backends/CMakeList.txt`` file. @@ -345,7 +345,7 @@ Here is the list of files that should be created/updated to integrate the new wr .. code-block:: diff - if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) + if(ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() + @@ -408,8 +408,8 @@ Now you can build the backend library for ``newlib`` to make sure the third-part cd build/ cmake .. -DNEWLIB_ROOT= \ - -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=OFF \ - -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=OFF \ + -DENABLE_MKLCPU_BACKEND=OFF \ + -DENABLE_MKLGPU_BACKEND=OFF \ -DENABLE_NEWLIB_BACKEND=ON \ # Enable new third-party library backend -DBUILD_FUNCTIONAL_TESTS=OFF # At this step we want build only cmake --build . -j4 @@ -428,7 +428,7 @@ Update the following files to enable the new third-party library for unit tests: .. code-block:: diff #cmakedefine ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - + #cmakedefine ENABLE_NEWLIB_BACKEND + + #cmakedefine ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND * ``tests/unit_tests/CMakeLists.txt``: add instructions about how to link tests with the new backend library @@ -436,9 +436,9 @@ Update the following files to enable the new third-party library for unit tests: .. code-block:: diff - if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) + if(ENABLE_MKLCPU_BACKEND) add_dependencies(test_main_ct onemkl_blas_mklcpu) - if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) + if(BUILD_SHARED_LIBS) list(APPEND ONEMKL_LIBRARIES onemkl_blas_mklcpu) else() list(APPEND ONEMKL_LIBRARIES -foffload-static-lib=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libonemkl_blas_mklcpu.a) @@ -449,7 +449,7 @@ Update the following files to enable the new third-party library for unit tests: + + if(ENABLE_NEWLIB_BACKEND) + add_dependencies(test_main_ct onemkl_blas_newlib) - + if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) + + if(BUILD_SHARED_LIBS) + list(APPEND ONEMKL_LIBRARIES onemkl_blas_newlib) + else() + list(APPEND ONEMKL_LIBRARIES -foffload-static-lib=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libonemkl_blas_newlib.a) @@ -471,7 +471,7 @@ Update the following files to enable the new third-party library for unit tests: #define TEST_RUN_INTELGPU(q, func, args) #endif + - + #ifdef ENABLE_NEWLIB_BACKEND + + #ifdef ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND + #define TEST_RUN_NEWDEVICE(q, func, args) \ + func args + #else @@ -495,7 +495,7 @@ Update the following files to enable the new third-party library for unit tests: } } + - + #ifdef ENABLE_NEWLIB_BACKEND + + #ifdef ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND + devices.push_back(sycl::device(sycl::host_selector())); + #endif @@ -505,8 +505,8 @@ Now you can build and run functional testing for enabled third-party libraries ( cd build/ cmake .. -DNEWLIB_ROOT= \ - -DONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND=OFF \ - -DONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND=OFF \ + -DENABLE_MKLCPU_BACKEND=OFF \ + -DENABLE_MKLGPU_BACKEND=OFF \ -DENABLE_NEWLIB_BACKEND=ON \ -DBUILD_FUNCTIONAL_TESTS=ON cmake --build . -j4 diff --git a/examples/README.md b/examples/README.md index e97482ee4..0dad8772d 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,7 +10,7 @@ Each routine has one run-time dispatching example and one compile-time dispatchi To build examples, use cmake build option `-DBUILD_EXAMPLES=true`. Compile_time_dispatching will be built if `-DBUILD_EXAMPLES=true` and cuda backend is enabled, because the compile-time dispatching example runs on both mklcpu and cuda backends. -Run_time_dispatching will be built if `-DBUILD_EXAMPLES=true` and `-DONEAPI_ONEMKL_BUILD_SHARED_LIBS=true`. +Run_time_dispatching will be built if `-DBUILD_EXAMPLES=true` and `-DBUILD_SHARED_LIBS=true`. The example executable naming convention follows `example_<$domain>_<$routine>_<$backend>` for compile-time dispatching examples or `example_<$domain>_<$routine>` for run-time dispatching examples. diff --git a/examples/blas/CMakeLists.txt b/examples/blas/CMakeLists.txt index 9b81a7965..7d692a2cb 100644 --- a/examples/blas/CMakeLists.txt +++ b/examples/blas/CMakeLists.txt @@ -23,6 +23,6 @@ add_subdirectory(compile_time_dispatching) # run-time dispatching example compilation is only possible # with dynamic libraries -if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/blas/compile_time_dispatching/level3/CMakeLists.txt b/examples/blas/compile_time_dispatching/level3/CMakeLists.txt index f31fafc61..294e000de 100644 --- a/examples/blas/compile_time_dispatching/level3/CMakeLists.txt +++ b/examples/blas/compile_time_dispatching/level3/CMakeLists.txt @@ -19,7 +19,7 @@ #Build object from all sources set(BLAS_CT_SOURCES "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) +if(ENABLE_MKLCPU_BACKEND AND ENABLE_CUBLAS_BACKEND) list(APPEND BLAS_CT_SOURCES "gemm_usm_mklcpu_cublas") endif() @@ -31,7 +31,7 @@ foreach(blas_ct_source ${BLAS_CT_SOURCES}) PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) + if(domain STREQUAL "blas" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CUBLAS_BACKEND) add_dependencies(example_${domain}_${blas_ct_source} onemkl_${domain}_mklcpu onemkl_${domain}_cublas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu onemkl_${domain}_cublas) endif() diff --git a/examples/blas/run_time_dispatching/level3/CMakeLists.txt b/examples/blas/run_time_dispatching/level3/CMakeLists.txt index 7c0e8c585..d0d35fc0d 100644 --- a/examples/blas/run_time_dispatching/level3/CMakeLists.txt +++ b/examples/blas/run_time_dispatching/level3/CMakeLists.txt @@ -28,19 +28,19 @@ set(BLAS_RT_SOURCES "gemm_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) +if(ENABLE_CUBLAS_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) +if(ENABLE_ROCBLAS_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND) +if(ENABLE_PORTBLAS_BACKEND) if(PORTBLAS_TUNING_TARGET) if(PORTBLAS_TUNING_TARGET MATCHES "INTEL_CPU") list(APPEND DEVICE_FILTERS "opencl:cpu") diff --git a/examples/dft/CMakeLists.txt b/examples/dft/CMakeLists.txt index 46c92246a..721512429 100644 --- a/examples/dft/CMakeLists.txt +++ b/examples/dft/CMakeLists.txt @@ -20,6 +20,6 @@ add_subdirectory(compile_time_dispatching) # runtime compilation is only possible with dynamic libraries -if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/dft/compile_time_dispatching/CMakeLists.txt b/examples/dft/compile_time_dispatching/CMakeLists.txt index 09276b54f..ed0ca2922 100644 --- a/examples/dft/compile_time_dispatching/CMakeLists.txt +++ b/examples/dft/compile_time_dispatching/CMakeLists.txt @@ -19,7 +19,7 @@ #Build object from all sources set(DFT_CT_SOURCES "") -if (ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) +if (ENABLE_MKLCPU_BACKEND AND ENABLE_CUFFT_BACKEND) list(APPEND DFT_CT_SOURCES "complex_fwd_usm_mklcpu_cufft") endif() @@ -33,7 +33,7 @@ foreach(dft_ct_source ${DFT_CT_SOURCES}) PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) + if(domain STREQUAL "dft" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CUFFT_BACKEND) add_dependencies(${EXAMPLE_NAME} onemkl_${domain}_mklcpu onemkl_${domain}_cufft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu onemkl_${domain}_cufft) endif() diff --git a/examples/dft/run_time_dispatching/CMakeLists.txt b/examples/dft/run_time_dispatching/CMakeLists.txt index 7fcaffcf9..687249e5e 100644 --- a/examples/dft/run_time_dispatching/CMakeLists.txt +++ b/examples/dft/run_time_dispatching/CMakeLists.txt @@ -27,25 +27,25 @@ set(DFT_RT_SOURCES "") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND OR ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND OR - ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND OR - ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) +if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND OR + ENABLE_CUFFT_BACKEND OR ENABLE_ROCFFT_BACKEND OR + ENABLE_PORTFFT_BACKEND) list(APPEND DFT_RT_SOURCES "real_fwd_usm") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) +if(ENABLE_PORTFFT_BACKEND) list(APPEND DEVICE_FILTERS "*:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) +if(ENABLE_CUFFT_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) +if(ENABLE_ROCFFT_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/lapack/CMakeLists.txt b/examples/lapack/CMakeLists.txt index d612722b3..06bd70859 100644 --- a/examples/lapack/CMakeLists.txt +++ b/examples/lapack/CMakeLists.txt @@ -22,6 +22,6 @@ add_subdirectory(compile_time_dispatching) # runtime compilation is only possible with dynamic libraries -if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/lapack/compile_time_dispatching/CMakeLists.txt b/examples/lapack/compile_time_dispatching/CMakeLists.txt index 3dcb1adca..cc126674f 100644 --- a/examples/lapack/compile_time_dispatching/CMakeLists.txt +++ b/examples/lapack/compile_time_dispatching/CMakeLists.txt @@ -19,11 +19,11 @@ #Build object from all sources set(LAPACK_CT_SOURCES "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) +if(ENABLE_MKLCPU_BACKEND AND ENABLE_CUSOLVER_BACKEND) list(APPEND LAPACK_CT_SOURCES "getrs_usm_mklcpu_cusolver") endif() -if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(domain STREQUAL "lapack" AND ENABLE_MKLCPU_BACKEND) find_library(OPENCL_LIBRARY NAMES OpenCL) message(STATUS "Found OpenCL: ${OPENCL_LIBRARY}") endif() @@ -35,7 +35,7 @@ foreach(lapack_ct_source ${LAPACK_CT_SOURCES}) PUBLIC ${PROJECT_SOURCE_DIR}/include PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) + if(domain STREQUAL "lapack" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CUSOLVER_BACKEND) add_dependencies(example_${domain}_${lapack_ct_source} onemkl_${domain}_mklcpu onemkl_${domain}_cusolver) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu onemkl_${domain}_cusolver) target_link_libraries(example_${domain}_${lapack_ct_source} PUBLIC ${OPENCL_LIBRARY}) diff --git a/examples/lapack/run_time_dispatching/CMakeLists.txt b/examples/lapack/run_time_dispatching/CMakeLists.txt index 7ce58a359..5fcf6a311 100644 --- a/examples/lapack/run_time_dispatching/CMakeLists.txt +++ b/examples/lapack/run_time_dispatching/CMakeLists.txt @@ -26,16 +26,16 @@ set(LAPACK_RT_SOURCES "getrs_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) +if(ENABLE_CUSOLVER_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) +if(ENABLE_ROCSOLVER_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/rng/CMakeLists.txt b/examples/rng/CMakeLists.txt index b02ab2e3b..b2890bf19 100644 --- a/examples/rng/CMakeLists.txt +++ b/examples/rng/CMakeLists.txt @@ -23,6 +23,6 @@ add_subdirectory(compile_time_dispatching) add_subdirectory(device) # runtime compilation is only possible with dynamic libraries -if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/rng/compile_time_dispatching/CMakeLists.txt b/examples/rng/compile_time_dispatching/CMakeLists.txt index 6a522d9ec..7e01d42f7 100644 --- a/examples/rng/compile_time_dispatching/CMakeLists.txt +++ b/examples/rng/compile_time_dispatching/CMakeLists.txt @@ -19,7 +19,7 @@ #Build object from all sources set(RNG_CT_SOURCES "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) +if(ENABLE_MKLCPU_BACKEND AND ENABLE_CURAND_BACKEND) list(APPEND RNG_CT_SOURCES "uniform_usm_mklcpu_curand") endif() @@ -31,8 +31,8 @@ foreach(rng_ct_source ${RNG_CT_SOURCES}) PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "rng" AND ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND AND - ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) + if(domain STREQUAL "rng" AND ENABLE_MKLCPU_BACKEND AND + ENABLE_CURAND_BACKEND) add_dependencies(example_${domain}_${rng_ct_source} onemkl_${domain}_mklcpu onemkl_${domain}_curand) diff --git a/examples/rng/device/CMakeLists.txt b/examples/rng/device/CMakeLists.txt index f0f8be082..1b6ecf2dd 100644 --- a/examples/rng/device/CMakeLists.txt +++ b/examples/rng/device/CMakeLists.txt @@ -26,17 +26,17 @@ set(RNG_DEVICE_SOURCES "uniform") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() # RNG only supports mklcpu backend on Windows -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) +if(ENABLE_CURAND_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) +if(ENABLE_ROCRAND_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/rng/run_time_dispatching/CMakeLists.txt b/examples/rng/run_time_dispatching/CMakeLists.txt index 1875447c3..d3bcc0f19 100644 --- a/examples/rng/run_time_dispatching/CMakeLists.txt +++ b/examples/rng/run_time_dispatching/CMakeLists.txt @@ -26,17 +26,17 @@ set(RNG_RT_SOURCES "uniform_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() # RNG only supports mklcpu backend on Windows -if(UNIX AND ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(UNIX AND ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() -if(UNIX AND ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) +if(UNIX AND ENABLE_CURAND_BACKEND) list(APPEND DEVICE_FILTERS "cuda:gpu") endif() -if(UNIX AND ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) +if(UNIX AND ENABLE_ROCRAND_BACKEND) list(APPEND DEVICE_FILTERS "hip:gpu") endif() diff --git a/examples/sparse_blas/CMakeLists.txt b/examples/sparse_blas/CMakeLists.txt index 46c92246a..721512429 100644 --- a/examples/sparse_blas/CMakeLists.txt +++ b/examples/sparse_blas/CMakeLists.txt @@ -20,6 +20,6 @@ add_subdirectory(compile_time_dispatching) # runtime compilation is only possible with dynamic libraries -if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) add_subdirectory(run_time_dispatching) endif() diff --git a/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt b/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt index 3923b51be..5dbbba8a4 100644 --- a/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt +++ b/examples/sparse_blas/compile_time_dispatching/CMakeLists.txt @@ -20,7 +20,7 @@ #Build object from all sources set(SPARSE_BLAS_BACKENDS "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) list(APPEND SPARSE_BLAS_BACKENDS "mklcpu") endif() diff --git a/examples/sparse_blas/run_time_dispatching/CMakeLists.txt b/examples/sparse_blas/run_time_dispatching/CMakeLists.txt index 67864853c..398f3e0f2 100644 --- a/examples/sparse_blas/run_time_dispatching/CMakeLists.txt +++ b/examples/sparse_blas/run_time_dispatching/CMakeLists.txt @@ -27,10 +27,10 @@ set(SPARSE_BLAS_RT_SOURCES "sparse_blas_spmv_usm") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) list(APPEND DEVICE_FILTERS "opencl:cpu") endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) list(APPEND DEVICE_FILTERS "level_zero:gpu") endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 71f768d03..0beadc3ec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,16 +19,16 @@ # Define common build flags for oneMKL libraries set(ONEMKL_BUILD_COPT "") -if(WIN32 AND ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(WIN32 AND BUILD_SHARED_LIBS) list(APPEND ONEMKL_BUILD_COPT "-Donemkl_EXPORTS") endif() # portBLAS backend variables must be accessible here to correctly # generate the config file. -set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU OFF CACHE INTERNAL "") -set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU OFF CACHE INTERNAL "") -set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU OFF CACHE INTERNAL "") -set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU OFF CACHE INTERNAL "") +set(ENABLE_PORTBLAS_BACKEND_INTEL_CPU OFF CACHE INTERNAL "") +set(ENABLE_PORTBLAS_BACKEND_INTEL_GPU OFF CACHE INTERNAL "") +set(ENABLE_PORTBLAS_BACKEND_AMD_GPU OFF CACHE INTERNAL "") +set(ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU OFF CACHE INTERNAL "") # store path to CMAKE_CURRENT_BINARY_DIR to use it later (makes FetchContent_Declare workable) set(ONEMKL_GENERATED_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}) @@ -57,7 +57,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/detail/config.hpp" ) # Add recipe for onemkl loader library -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(onemkl SHARED) # The loader library depends on all the backend libraries as it uses diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 8ee72b9e7..1edf2e445 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for BLAS loader object -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(onemkl_blas OBJECT) target_sources(onemkl_blas PRIVATE blas_loader.cpp) target_include_directories(onemkl_blas diff --git a/src/blas/backends/CMakeLists.txt b/src/blas/backends/CMakeLists.txt index aa09c6e95..351f4b0e5 100644 --- a/src/blas/backends/CMakeLists.txt +++ b/src/blas/backends/CMakeLists.txt @@ -20,26 +20,26 @@ add_custom_target(onemkl_backend_libs_blas) add_dependencies(onemkl_backend_libs onemkl_backend_libs_blas) -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) +if(ENABLE_NETLIB_BACKEND) add_subdirectory(netlib) endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND AND UNIX) +if(ENABLE_CUBLAS_BACKEND AND UNIX) add_subdirectory(cublas) endif() -if(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND AND UNIX) +if(ENABLE_ROCBLAS_BACKEND AND UNIX) add_subdirectory(rocblas) endif() -if(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND AND UNIX) +if(ENABLE_PORTBLAS_BACKEND AND UNIX) add_subdirectory(portblas) endif() diff --git a/src/blas/backends/cublas/CMakeLists.txt b/src/blas/backends/cublas/CMakeLists.txt index c41cebf96..b64e7c37d 100644 --- a/src/blas/backends/cublas/CMakeLists.txt +++ b/src/blas/backends/cublas/CMakeLists.txt @@ -27,7 +27,7 @@ set(SOURCES cublas_level1.cpp cublas_extensions.cpp $<$:cublas_scope_handle.cpp > $<$:cublas_scope_handle_hipsycl.cpp > - $<$: cublas_wrappers.cpp>) + $<$: cublas_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) diff --git a/src/blas/backends/mklcpu/CMakeLists.txt b/src/blas/backends/mklcpu/CMakeLists.txt index 725e211e7..322741d26 100644 --- a/src/blas/backends/mklcpu/CMakeLists.txt +++ b/src/blas/backends/mklcpu/CMakeLists.txt @@ -22,7 +22,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) set(SOURCES mklcpu_level1.cpp mklcpu_level2.cpp mklcpu_level3.cpp mklcpu_batch.cpp mklcpu_extensions.cpp - $<$: mklcpu_wrappers.cpp>) + $<$: mklcpu_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) @@ -52,7 +52,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/mklgpu/CMakeLists.txt b/src/blas/backends/mklgpu/CMakeLists.txt index 5cb62469d..c971d1afd 100644 --- a/src/blas/backends/mklgpu/CMakeLists.txt +++ b/src/blas/backends/mklgpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mklgpu_level1.cpp mklgpu_level2.cpp mklgpu_level3.cpp mklgpu_batch.cpp mklgpu_extensions.cpp - $<$: mklgpu_wrappers.cpp> + $<$: mklgpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) @@ -49,7 +49,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/netlib/CMakeLists.txt b/src/blas/backends/netlib/CMakeLists.txt index 7442138d1..fd5275fc0 100644 --- a/src/blas/backends/netlib/CMakeLists.txt +++ b/src/blas/backends/netlib/CMakeLists.txt @@ -25,7 +25,7 @@ find_package(NETLIB REQUIRED) set(SOURCES netlib_common.hpp netlib_level1.cpp netlib_level2.cpp netlib_level3.cpp netlib_batch.cpp netlib_extensions.cpp - $<$: netlib_wrappers.cpp> + $<$: netlib_wrappers.cpp> ) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) @@ -53,7 +53,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES ) target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/portblas/CMakeLists.txt b/src/blas/backends/portblas/CMakeLists.txt index 9a362b087..4c0645239 100644 --- a/src/blas/backends/portblas/CMakeLists.txt +++ b/src/blas/backends/portblas/CMakeLists.txt @@ -174,7 +174,7 @@ set(SOURCES portblas_level3_double.cpp portblas_level3_float.cpp portblas_level3_half.cpp portblas_level3_bfloat16.cpp portblas_batch.cpp - $<$: portblas_wrappers.cpp>) + $<$: portblas_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) @@ -199,7 +199,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/blas/backends/rocblas/CMakeLists.txt b/src/blas/backends/rocblas/CMakeLists.txt index af5e6a126..76dc126ad 100644 --- a/src/blas/backends/rocblas/CMakeLists.txt +++ b/src/blas/backends/rocblas/CMakeLists.txt @@ -32,7 +32,7 @@ set(SOURCES rocblas_level1.cpp rocblas_extensions.cpp $<$:rocblas_scope_handle.cpp > $<$:rocblas_scope_handle_hipsycl.cpp > - $<$: rocblas_wrappers.cpp>) + $<$: rocblas_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_blas ${LIB_NAME}) diff --git a/src/dft/CMakeLists.txt b/src/dft/CMakeLists.txt index 1c1e05d78..e3b373645 100644 --- a/src/dft/CMakeLists.txt +++ b/src/dft/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for DFT loader object -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(onemkl_dft OBJECT) target_sources(onemkl_dft PRIVATE backends/descriptor.cpp dft_loader.cpp) target_include_directories(onemkl_dft diff --git a/src/dft/backends/CMakeLists.txt b/src/dft/backends/CMakeLists.txt index eeee4be78..b03a63e8a 100644 --- a/src/dft/backends/CMakeLists.txt +++ b/src/dft/backends/CMakeLists.txt @@ -20,22 +20,22 @@ add_custom_target(onemkl_backend_libs_dft) add_dependencies(onemkl_backend_libs onemkl_backend_libs_dft) -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) +if(ENABLE_CUFFT_BACKEND) add_subdirectory(cufft) endif() -if(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) +if(ENABLE_ROCFFT_BACKEND) add_subdirectory(rocfft) endif() -if(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) +if(ENABLE_PORTFFT_BACKEND) add_subdirectory(portfft) endif() diff --git a/src/dft/backends/cufft/CMakeLists.txt b/src/dft/backends/cufft/CMakeLists.txt index 5e66c1375..010905546 100644 --- a/src/dft/backends/cufft/CMakeLists.txt +++ b/src/dft/backends/cufft/CMakeLists.txt @@ -27,7 +27,7 @@ add_library(${LIB_OBJ} OBJECT commit.cpp forward.cpp backward.cpp - $<$: mkl_dft_cufft_wrappers.cpp> + $<$: mkl_dft_cufft_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -62,7 +62,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/mklcpu/CMakeLists.txt b/src/dft/backends/mklcpu/CMakeLists.txt index 1a610c96b..6d0f1276d 100644 --- a/src/dft/backends/mklcpu/CMakeLists.txt +++ b/src/dft/backends/mklcpu/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(${LIB_OBJ} OBJECT descriptor.cpp forward.cpp backward.cpp - $<$: mkl_dft_cpu_wrappers.cpp> + $<$: mkl_dft_cpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -70,7 +70,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/mklgpu/CMakeLists.txt b/src/dft/backends/mklgpu/CMakeLists.txt index c4250fccf..7e88a23d9 100644 --- a/src/dft/backends/mklgpu/CMakeLists.txt +++ b/src/dft/backends/mklgpu/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(${LIB_OBJ} OBJECT commit.cpp forward.cpp backward.cpp - $<$: mkl_dft_gpu_wrappers.cpp> + $<$: mkl_dft_gpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -66,7 +66,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/portfft/CMakeLists.txt b/src/dft/backends/portfft/CMakeLists.txt index f4fd375b4..752fae8d5 100644 --- a/src/dft/backends/portfft/CMakeLists.txt +++ b/src/dft/backends/portfft/CMakeLists.txt @@ -65,7 +65,7 @@ add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT descriptor.cpp commit.cpp - $<$: mkl_dft_portfft_wrappers.cpp> + $<$: mkl_dft_portfft_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -111,7 +111,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/dft/backends/rocfft/CMakeLists.txt b/src/dft/backends/rocfft/CMakeLists.txt index a11ca4b78..1380c8f0a 100644 --- a/src/dft/backends/rocfft/CMakeLists.txt +++ b/src/dft/backends/rocfft/CMakeLists.txt @@ -27,7 +27,7 @@ add_library(${LIB_OBJ} OBJECT commit.cpp forward.cpp backward.cpp - $<$: mkl_dft_rocfft_wrappers.cpp> + $<$: mkl_dft_rocfft_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_dft ${LIB_NAME}) @@ -72,7 +72,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) # Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index 3e589678f..524edde03 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for LAPACK loader object -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(onemkl_lapack OBJECT) target_sources(onemkl_lapack PRIVATE lapack_loader.cpp) target_include_directories(onemkl_lapack diff --git a/src/lapack/backends/CMakeLists.txt b/src/lapack/backends/CMakeLists.txt index 530116c0a..636f6728f 100644 --- a/src/lapack/backends/CMakeLists.txt +++ b/src/lapack/backends/CMakeLists.txt @@ -20,18 +20,18 @@ add_custom_target(onemkl_backend_libs_lapack) add_dependencies(onemkl_backend_libs onemkl_backend_libs_lapack) -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) +if(ENABLE_CUSOLVER_BACKEND) add_subdirectory(cusolver) endif() -if(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) +if(ENABLE_ROCSOLVER_BACKEND) add_subdirectory(rocsolver) endif() diff --git a/src/lapack/backends/cusolver/CMakeLists.txt b/src/lapack/backends/cusolver/CMakeLists.txt index fbd280024..dfd1267d7 100644 --- a/src/lapack/backends/cusolver/CMakeLists.txt +++ b/src/lapack/backends/cusolver/CMakeLists.txt @@ -24,7 +24,7 @@ find_package(cuBLAS REQUIRED) set(SOURCES cusolver_lapack.cpp cusolver_batch.cpp $<$:cusolver_scope_handle.cpp > - $<$: cusolver_wrappers.cpp>) + $<$: cusolver_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) diff --git a/src/lapack/backends/mklcpu/CMakeLists.txt b/src/lapack/backends/mklcpu/CMakeLists.txt index 802134084..fcc60a8e7 100644 --- a/src/lapack/backends/mklcpu/CMakeLists.txt +++ b/src/lapack/backends/mklcpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mkl_lapack.cpp - $<$: lapack_cpu_wrappers.cpp> + $<$: lapack_cpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) @@ -48,7 +48,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/lapack/backends/mklgpu/CMakeLists.txt b/src/lapack/backends/mklgpu/CMakeLists.txt index 53bf95aaf..e11592f82 100644 --- a/src/lapack/backends/mklgpu/CMakeLists.txt +++ b/src/lapack/backends/mklgpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mkl_lapack.cpp - $<$: lapack_gpu_wrappers.cpp> + $<$: lapack_gpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) @@ -48,7 +48,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/lapack/backends/rocsolver/CMakeLists.txt b/src/lapack/backends/rocsolver/CMakeLists.txt index 4280c26f1..c91089118 100644 --- a/src/lapack/backends/rocsolver/CMakeLists.txt +++ b/src/lapack/backends/rocsolver/CMakeLists.txt @@ -28,7 +28,7 @@ find_package(Threads REQUIRED) set(SOURCES rocsolver_lapack.cpp rocsolver_batch.cpp $<$:rocsolver_scope_handle.cpp> - $<$: rocsolver_wrappers.cpp>) + $<$: rocsolver_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) add_dependencies(onemkl_backend_libs_lapack ${LIB_NAME}) diff --git a/src/rng/CMakeLists.txt b/src/rng/CMakeLists.txt index 68916015d..30df39403 100644 --- a/src/rng/CMakeLists.txt +++ b/src/rng/CMakeLists.txt @@ -21,7 +21,7 @@ add_subdirectory(backends) # Recipe for RNG loader object -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(onemkl_rng OBJECT) target_sources(onemkl_rng PRIVATE rng_loader.cpp) target_include_directories(onemkl_rng diff --git a/src/rng/backends/CMakeLists.txt b/src/rng/backends/CMakeLists.txt index 5608520de..9045f7e75 100644 --- a/src/rng/backends/CMakeLists.txt +++ b/src/rng/backends/CMakeLists.txt @@ -20,19 +20,19 @@ add_custom_target(onemkl_backend_libs_rng) add_dependencies(onemkl_backend_libs onemkl_backend_libs_rng) -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() -if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND AND UNIX) +if(ENABLE_CURAND_BACKEND AND UNIX) add_subdirectory(curand) endif() -if(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND AND UNIX) +if(ENABLE_ROCRAND_BACKEND AND UNIX) add_subdirectory(rocrand) endif() diff --git a/src/rng/backends/curand/CMakeLists.txt b/src/rng/backends/curand/CMakeLists.txt index 8782fe6dc..f37a34f1d 100644 --- a/src/rng/backends/curand/CMakeLists.txt +++ b/src/rng/backends/curand/CMakeLists.txt @@ -62,7 +62,7 @@ find_package(cuRAND REQUIRED) set(SOURCES philox4x32x10.cpp mrg32k3a.cpp - $<$: mkl_rng_curand_wrappers.cpp>) + $<$: mkl_rng_curand_wrappers.cpp>) add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT ${SOURCES}) diff --git a/src/rng/backends/mklcpu/CMakeLists.txt b/src/rng/backends/mklcpu/CMakeLists.txt index e4fd1fddc..e72ce048f 100644 --- a/src/rng/backends/mklcpu/CMakeLists.txt +++ b/src/rng/backends/mklcpu/CMakeLists.txt @@ -23,7 +23,7 @@ set(LIB_OBJ ${LIB_NAME}_obj) set(SOURCES cpu_common.hpp philox4x32x10.cpp mrg32k3a.cpp - $<$: mkl_rng_cpu_wrappers.cpp> + $<$: mkl_rng_cpu_wrappers.cpp> ) add_library(${LIB_NAME}) @@ -48,7 +48,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) # Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/rng/backends/mklgpu/CMakeLists.txt b/src/rng/backends/mklgpu/CMakeLists.txt index 3270eb705..150f90136 100644 --- a/src/rng/backends/mklgpu/CMakeLists.txt +++ b/src/rng/backends/mklgpu/CMakeLists.txt @@ -25,7 +25,7 @@ add_library(${LIB_OBJ} OBJECT mkl_internal_rng_gpu.hpp philox4x32x10.cpp mrg32k3a.cpp - $<$: mkl_rng_gpu_wrappers.cpp> + $<$: mkl_rng_gpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_rng ${LIB_NAME}) @@ -50,7 +50,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) # Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/rng/backends/rocrand/CMakeLists.txt b/src/rng/backends/rocrand/CMakeLists.txt index f4a148c46..47929703b 100644 --- a/src/rng/backends/rocrand/CMakeLists.txt +++ b/src/rng/backends/rocrand/CMakeLists.txt @@ -58,7 +58,7 @@ find_package(hip REQUIRED) find_package(rocrand REQUIRED) find_package(Threads REQUIRED) -set(SOURCES philox4x32x10.cpp mrg32k3a.cpp $<$: +set(SOURCES philox4x32x10.cpp mrg32k3a.cpp $<$: mkl_rng_rocrand_wrappers.cpp>) add_library(${LIB_NAME}) diff --git a/src/sparse_blas/CMakeLists.txt b/src/sparse_blas/CMakeLists.txt index 9977a1b4c..b01cc63fd 100644 --- a/src/sparse_blas/CMakeLists.txt +++ b/src/sparse_blas/CMakeLists.txt @@ -19,7 +19,7 @@ add_subdirectory(backends) -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(onemkl_sparse_blas OBJECT) target_sources(onemkl_sparse_blas PRIVATE sparse_blas_loader.cpp) target_include_directories(onemkl_sparse_blas diff --git a/src/sparse_blas/backends/CMakeLists.txt b/src/sparse_blas/backends/CMakeLists.txt index d856f9a3f..294040808 100644 --- a/src/sparse_blas/backends/CMakeLists.txt +++ b/src/sparse_blas/backends/CMakeLists.txt @@ -20,10 +20,10 @@ add_custom_target(onemkl_backend_libs_sparse_blas) add_dependencies(onemkl_backend_libs onemkl_backend_libs_sparse_blas) -if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) +if(ENABLE_MKLCPU_BACKEND) add_subdirectory(mklcpu) endif() -if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) +if(ENABLE_MKLGPU_BACKEND) add_subdirectory(mklgpu) endif() diff --git a/src/sparse_blas/backends/mklcpu/CMakeLists.txt b/src/sparse_blas/backends/mklcpu/CMakeLists.txt index aa9c531f7..e41cae268 100644 --- a/src/sparse_blas/backends/mklcpu/CMakeLists.txt +++ b/src/sparse_blas/backends/mklcpu/CMakeLists.txt @@ -26,7 +26,7 @@ add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mklcpu_handles.cpp mklcpu_operations.cpp - $<$: mklcpu_wrappers.cpp> + $<$: mklcpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_sparse_blas ${LIB_NAME}) @@ -59,7 +59,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/src/sparse_blas/backends/mklgpu/CMakeLists.txt b/src/sparse_blas/backends/mklgpu/CMakeLists.txt index 3d667f1b6..cd25babc2 100644 --- a/src/sparse_blas/backends/mklgpu/CMakeLists.txt +++ b/src/sparse_blas/backends/mklgpu/CMakeLists.txt @@ -26,7 +26,7 @@ add_library(${LIB_NAME}) add_library(${LIB_OBJ} OBJECT mklgpu_handles.cpp mklgpu_operations.cpp - $<$: mklgpu_wrappers.cpp> + $<$: mklgpu_wrappers.cpp> ) add_dependencies(onemkl_backend_libs_sparse_blas ${LIB_NAME}) @@ -59,7 +59,7 @@ set_target_properties(${LIB_OBJ} PROPERTIES target_link_libraries(${LIB_NAME} PUBLIC ${LIB_OBJ}) #Set oneMKL libraries as not transitive for dynamic -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES ONEMKL::SYCL::SYCL ) diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index 7ac8b4e6e..e7fe8e110 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -93,7 +93,7 @@ foreach(domain ${TARGET_DOMAINS}) target_compile_options(test_main_${domain}_ct PRIVATE -fsycl) endif() - if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) + if(BUILD_SHARED_LIBS) add_executable(test_main_${domain}_rt main_test.cpp) target_include_directories(test_main_${domain}_rt PUBLIC ${GTEST_INCLUDE_DIR}) if(NOT ${ONEMKL_SYCL_IMPLEMENTATION} STREQUAL "hipsycl") @@ -113,67 +113,67 @@ foreach(domain ${TARGET_DOMAINS}) endif() endif() - if(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) + if(ENABLE_MKLCPU_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_mklcpu) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklcpu) endif() - if(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) + if(ENABLE_MKLGPU_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_mklgpu) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_mklgpu) endif() - if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) + if(domain STREQUAL "blas" AND ENABLE_CUBLAS_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_cublas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_cublas) endif() - if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) + if(domain STREQUAL "blas" AND ENABLE_ROCBLAS_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_rocblas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_rocblas) endif() - if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) + if(domain STREQUAL "blas" AND ENABLE_NETLIB_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_netlib) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_netlib) endif() - if(domain STREQUAL "blas" AND ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND) + if(domain STREQUAL "blas" AND ENABLE_PORTBLAS_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_portblas) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_portblas) endif() - if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) + if(domain STREQUAL "lapack" AND ENABLE_CUSOLVER_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_cusolver) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_cusolver) endif() - if(domain STREQUAL "lapack" AND ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) + if(domain STREQUAL "lapack" AND ENABLE_ROCSOLVER_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_rocsolver) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_rocsolver) endif() - if(domain STREQUAL "rng" AND ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) + if(domain STREQUAL "rng" AND ENABLE_CURAND_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_curand) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_curand) endif() - if(domain STREQUAL "rng" AND ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) + if(domain STREQUAL "rng" AND ENABLE_ROCRAND_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_rocrand) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_rocrand) endif() - if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) + if(domain STREQUAL "dft" AND ENABLE_CUFFT_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_${domain}_cufft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_${domain}_cufft) endif() - if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) + if(domain STREQUAL "dft" AND ENABLE_ROCFFT_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_dft_rocfft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_dft_rocfft) endif() - if(domain STREQUAL "dft" AND ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) + if(domain STREQUAL "dft" AND ENABLE_PORTFFT_BACKEND) add_dependencies(test_main_${domain}_ct onemkl_dft_portfft) list(APPEND ONEMKL_LIBRARIES_${domain} onemkl_dft_portfft) endif() @@ -201,7 +201,7 @@ foreach(domain ${TARGET_DOMAINS}) set(TEST_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}) endif() - if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) + if(BUILD_SHARED_LIBS) set_target_properties(test_main_${domain}_rt PROPERTIES BUILD_RPATH $) # Find individual tests within executable @@ -220,7 +220,7 @@ foreach(domain ${TARGET_DOMAINS}) DISCOVERY_TIMEOUT 30 ) - if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) + if(BUILD_SHARED_LIBS) if (USE_ADD_SYCL_TO_TARGET_INTEGRATION) add_sycl_to_target(TARGET test_main_${domain}_rt) endif() diff --git a/tests/unit_tests/blas/batch/CMakeLists.txt b/tests/unit_tests/blas/batch/CMakeLists.txt index b219a4e25..0f47f37af 100644 --- a/tests/unit_tests/blas/batch/CMakeLists.txt +++ b/tests/unit_tests/blas/batch/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(BATCH_SOURCES "copy_batch_stride.cpp" "axpy_batch_stride.cpp" "dgmm_batch_stride.cpp" "gemm_batch_stride.cpp" "gemv_batch_stride.cpp" "trsm_batch_stride.cpp" "syrk_batch_stride.cpp" "copy_batch_usm.cpp" "copy_batch_stride_usm.cpp" "axpy_batch_usm.cpp" "axpy_batch_stride_usm.cpp" "dgmm_batch_usm.cpp" "dgmm_batch_stride_usm.cpp" "gemm_batch_usm.cpp" "gemm_batch_stride_usm.cpp" "gemv_batch_usm.cpp" "gemv_batch_stride_usm.cpp" "trsm_batch_usm.cpp" "trsm_batch_stride_usm.cpp" "syrk_batch_usm.cpp" "syrk_batch_stride_usm.cpp" "omatcopy_batch_stride.cpp" "omatcopy_batch_stride_usm.cpp" "imatcopy_batch_stride.cpp" "imatcopy_batch_stride_usm.cpp" "omatadd_batch_stride.cpp" "omatadd_batch_stride_usm.cpp" "omatcopy_batch_usm.cpp" "imatcopy_batch_usm.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(blas_batch_rt OBJECT ${BATCH_SOURCES}) target_compile_options(blas_batch_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_batch_rt diff --git a/tests/unit_tests/blas/extensions/CMakeLists.txt b/tests/unit_tests/blas/extensions/CMakeLists.txt index 35817051d..af58e5076 100644 --- a/tests/unit_tests/blas/extensions/CMakeLists.txt +++ b/tests/unit_tests/blas/extensions/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(EXTENSIONS_SOURCES "gemm_bias.cpp" "gemmt.cpp" "gemm_bias_usm.cpp" "gemmt_usm.cpp" "omatcopy.cpp" "omatcopy_usm.cpp" "imatcopy.cpp" "imatcopy_usm.cpp" "omatadd.cpp" "omatadd_usm.cpp" "omatcopy2.cpp" "omatcopy2_usm.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(blas_extensions_rt OBJECT ${EXTENSIONS_SOURCES}) target_compile_options(blas_extensions_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_extensions_rt diff --git a/tests/unit_tests/blas/level1/CMakeLists.txt b/tests/unit_tests/blas/level1/CMakeLists.txt index 01ddeca19..f02adbde3 100644 --- a/tests/unit_tests/blas/level1/CMakeLists.txt +++ b/tests/unit_tests/blas/level1/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(L1_SOURCES "nrm2.cpp" "iamin.cpp" "iamax.cpp" "dotu.cpp" "dot.cpp" "dotc.cpp" "copy.cpp" "axpy.cpp" "axpby.cpp" "asum.cpp" "swap.cpp" "sdsdot.cpp" "scal.cpp" "rotmg.cpp" "rotm.cpp" "rotg.cpp" "rot.cpp" "nrm2_usm.cpp" "iamin_usm.cpp" "iamax_usm.cpp" "dotu_usm.cpp" "dot_usm.cpp" "dotc_usm.cpp" "copy_usm.cpp" "axpy_usm.cpp" "axpby_usm.cpp" "asum_usm.cpp" "swap_usm.cpp" "sdsdot_usm.cpp" "scal_usm.cpp" "rotmg_usm.cpp" "rotm_usm.cpp" "rotg_usm.cpp" "rot_usm.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(blas_level1_rt OBJECT ${L1_SOURCES}) target_compile_options(blas_level1_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_level1_rt diff --git a/tests/unit_tests/blas/level2/CMakeLists.txt b/tests/unit_tests/blas/level2/CMakeLists.txt index 5840bafb4..a61bcfeef 100644 --- a/tests/unit_tests/blas/level2/CMakeLists.txt +++ b/tests/unit_tests/blas/level2/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(L2_SOURCES "hpr2.cpp" "hpmv.cpp" "her.cpp" "her2.cpp" "hemv.cpp" "hbmv.cpp" "geru.cpp" "ger.cpp" "gerc.cpp" "gemv.cpp" "gbmv.cpp" "trsv.cpp" "trmv.cpp" "tpsv.cpp" "tpmv.cpp" "tbsv.cpp" "tbmv.cpp" "syr.cpp" "syr2.cpp" "symv.cpp" "spr.cpp" "spr2.cpp" "spmv.cpp" "sbmv.cpp" "hpr.cpp" "hpr2_usm.cpp" "hpmv_usm.cpp" "her_usm.cpp" "her2_usm.cpp" "hemv_usm.cpp" "hbmv_usm.cpp" "geru_usm.cpp" "ger_usm.cpp" "gerc_usm.cpp" "gemv_usm.cpp" "gbmv_usm.cpp" "trsv_usm.cpp" "trmv_usm.cpp" "tpsv_usm.cpp" "tpmv_usm.cpp" "tbsv_usm.cpp" "tbmv_usm.cpp" "syr_usm.cpp" "syr2_usm.cpp" "symv_usm.cpp" "spr_usm.cpp" "spr2_usm.cpp" "spmv_usm.cpp" "sbmv_usm.cpp" "hpr_usm.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(blas_level2_rt OBJECT ${L2_SOURCES}) target_compile_options(blas_level2_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_level2_rt diff --git a/tests/unit_tests/blas/level3/CMakeLists.txt b/tests/unit_tests/blas/level3/CMakeLists.txt index c8eb00f88..53cba3f4c 100644 --- a/tests/unit_tests/blas/level3/CMakeLists.txt +++ b/tests/unit_tests/blas/level3/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(L3_SOURCES "gemm.cpp" "symm.cpp" "syrk.cpp" "hemm.cpp" "herk.cpp" "syr2k.cpp" "her2k.cpp" "trmm.cpp" "trsm.cpp" "gemm_usm.cpp" "symm_usm.cpp" "syrk_usm.cpp" "hemm_usm.cpp" "herk_usm.cpp" "syr2k_usm.cpp" "her2k_usm.cpp" "trmm_usm.cpp" "trsm_usm.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(blas_level3_rt OBJECT ${L3_SOURCES}) target_compile_options(blas_level3_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(blas_level3_rt diff --git a/tests/unit_tests/dft/source/CMakeLists.txt b/tests/unit_tests/dft/source/CMakeLists.txt index 8a685783e..364ad564f 100644 --- a/tests/unit_tests/dft/source/CMakeLists.txt +++ b/tests/unit_tests/dft/source/CMakeLists.txt @@ -21,7 +21,7 @@ set(DFT_SOURCES "compute_tests.cpp" "descriptor_tests.cpp" "workspace_external_t include(WarningsUtils) -if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) add_library(dft_source_rt OBJECT ${DFT_SOURCES}) target_compile_options(dft_source_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(dft_source_rt diff --git a/tests/unit_tests/lapack/common/CMakeLists.txt b/tests/unit_tests/lapack/common/CMakeLists.txt index a2081a7de..53479702b 100644 --- a/tests/unit_tests/lapack/common/CMakeLists.txt +++ b/tests/unit_tests/lapack/common/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(LAPACK_COMMON_SOURCES "dependency_check.cpp" "test_log.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) target_sources(lapack_source_rt PRIVATE ${LAPACK_COMMON_SOURCES}) endif() diff --git a/tests/unit_tests/lapack/source/CMakeLists.txt b/tests/unit_tests/lapack/source/CMakeLists.txt index 6dfad2157..c61403c40 100644 --- a/tests/unit_tests/lapack/source/CMakeLists.txt +++ b/tests/unit_tests/lapack/source/CMakeLists.txt @@ -68,7 +68,7 @@ set(LAPACK_SOURCES "unmtr.cpp" ) -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(lapack_source_rt OBJECT ${LAPACK_SOURCES}) target_compile_options(lapack_source_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(lapack_source_rt diff --git a/tests/unit_tests/rng/service/CMakeLists.txt b/tests/unit_tests/rng/service/CMakeLists.txt index eadc88118..8436ce9eb 100644 --- a/tests/unit_tests/rng/service/CMakeLists.txt +++ b/tests/unit_tests/rng/service/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(SERVICE_TESTS_SOURCES "skip_ahead.cpp" "engines_api_test.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(rng_service_rt OBJECT ${SERVICE_TESTS_SOURCES}) target_compile_options(rng_service_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(rng_service_rt diff --git a/tests/unit_tests/rng/statistics_check/CMakeLists.txt b/tests/unit_tests/rng/statistics_check/CMakeLists.txt index 6515b3897..244d33976 100644 --- a/tests/unit_tests/rng/statistics_check/CMakeLists.txt +++ b/tests/unit_tests/rng/statistics_check/CMakeLists.txt @@ -20,7 +20,7 @@ # Build object from all test sources set(STATS_CHECK_SOURCES "uniform.cpp" "uniform_usm.cpp" "gaussian_usm.cpp" "gaussian.cpp" "lognormal_usm.cpp" "lognormal.cpp" "bernoulli_usm.cpp" "bernoulli.cpp" "poisson_usm.cpp" "poisson.cpp") -if(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) add_library(rng_statistics_rt OBJECT ${STATS_CHECK_SOURCES}) target_compile_options(rng_statistics_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(rng_statistics_rt diff --git a/tests/unit_tests/sparse_blas/source/CMakeLists.txt b/tests/unit_tests/sparse_blas/source/CMakeLists.txt index dfea29515..a9271bfa2 100644 --- a/tests/unit_tests/sparse_blas/source/CMakeLists.txt +++ b/tests/unit_tests/sparse_blas/source/CMakeLists.txt @@ -28,7 +28,7 @@ set(SPBLAS_SOURCES include(WarningsUtils) -if (ONEAPI_ONEMKL_BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) add_library(spblas_source_rt OBJECT ${SPBLAS_SOURCES}) target_compile_options(spblas_source_rt PRIVATE -DCALL_RT_API -DNOMINMAX) target_include_directories(spblas_source_rt From 8942c77e96d99b1058fe171fce7bbaf053f8972e Mon Sep 17 00:00:00 2001 From: nscipione Date: Tue, 17 Sep 2024 09:30:06 +0100 Subject: [PATCH 04/10] Revert changes in cmake --- cmake/FindCompiler.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/FindCompiler.cmake b/cmake/FindCompiler.cmake index 626aee9cb..d0feb96d6 100644 --- a/cmake/FindCompiler.cmake +++ b/cmake/FindCompiler.cmake @@ -37,13 +37,13 @@ if(is_dpcpp) # Check if the Nvidia target is supported. PortFFT uses this for choosing default configuration. check_cxx_compiler_flag("-fsycl -fsycl-targets=nvptx64-nvidia-cuda" dpcpp_supports_nvptx64) - if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND OR ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) + if(ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND) list(APPEND UNIX_INTERFACE_COMPILE_OPTIONS -fsycl-targets=nvptx64-nvidia-cuda -fsycl-unnamed-lambda) list(APPEND UNIX_INTERFACE_LINK_OPTIONS -fsycl-targets=nvptx64-nvidia-cuda) - elseif(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) + elseif(ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND + OR ENABLE_ROCSOLVER_BACKEND) list(APPEND UNIX_INTERFACE_COMPILE_OPTIONS -fsycl-targets=amdgcn-amd-amdhsa -fsycl-unnamed-lambda -Xsycl-target-backend --offload-arch=${HIP_TARGETS}) @@ -51,9 +51,9 @@ if(is_dpcpp) -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=${HIP_TARGETS}) endif() - if(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND OR ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) + if(ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND + OR ENABLE_ROCBLAS_BACKEND + OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND) set_target_properties(ONEMKL::SYCL::SYCL PROPERTIES INTERFACE_COMPILE_OPTIONS "${UNIX_INTERFACE_COMPILE_OPTIONS}" INTERFACE_LINK_OPTIONS "${UNIX_INTERFACE_LINK_OPTIONS}" @@ -70,8 +70,8 @@ if(is_dpcpp) INTERFACE_LINK_LIBRARIES ${SYCL_LIBRARY}) endif() - if(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND OR ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND - OR ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) + if(ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND + OR ENABLE_ROCSOLVER_BACKEND) # Allow find_package(HIP) to find the correct path to libclang_rt.builtins.a # HIP's CMake uses the command `${HIP_CXX_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt` to find this path. # This can print a non-existing file if the compiler used is icpx. From e079170978a436a5ce9234cab9591b7f0abdb1c1 Mon Sep 17 00:00:00 2001 From: nscipione Date: Wed, 18 Sep 2024 15:53:14 +0100 Subject: [PATCH 05/10] Address PR comment to reduce noise in this PR --- CMakeLists.txt | 6 ++---- cmake/FindCompiler.cmake | 8 +++----- examples/dft/run_time_dispatching/CMakeLists.txt | 4 +--- examples/rng/compile_time_dispatching/CMakeLists.txt | 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index beea29f47..2e3b509c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,10 +186,8 @@ if(CMAKE_CXX_COMPILER OR NOT ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++") string(REPLACE "\\" "/" CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER}) endif() else() - if(ENABLE_CUBLAS_BACKEND OR ENABLE_CURAND_BACKEND OR - ENABLE_CUSOLVER_BACKEND OR ENABLE_CUFFT_BACKEND OR - ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND OR - ENABLE_ROCSOLVER_BACKEND OR ENABLE_ROCFFT_BACKEND) + if(ENABLE_CUBLAS_BACKEND OR ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND OR ENABLE_CUFFT_BACKEND + OR ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND OR ENABLE_ROCFFT_BACKEND) set(CMAKE_CXX_COMPILER "clang++") elseif(ENABLE_MKLGPU_BACKEND) if(UNIX) diff --git a/cmake/FindCompiler.cmake b/cmake/FindCompiler.cmake index d0feb96d6..556211999 100644 --- a/cmake/FindCompiler.cmake +++ b/cmake/FindCompiler.cmake @@ -51,9 +51,8 @@ if(is_dpcpp) -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=${HIP_TARGETS}) endif() - if(ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND - OR ENABLE_ROCBLAS_BACKEND - OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND) + if(ENABLE_CURAND_BACKEND OR ENABLE_CUSOLVER_BACKEND OR ENABLE_ROCBLAS_BACKEND + OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND) set_target_properties(ONEMKL::SYCL::SYCL PROPERTIES INTERFACE_COMPILE_OPTIONS "${UNIX_INTERFACE_COMPILE_OPTIONS}" INTERFACE_LINK_OPTIONS "${UNIX_INTERFACE_LINK_OPTIONS}" @@ -70,8 +69,7 @@ if(is_dpcpp) INTERFACE_LINK_LIBRARIES ${SYCL_LIBRARY}) endif() - if(ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND - OR ENABLE_ROCSOLVER_BACKEND) + if(ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND) # Allow find_package(HIP) to find the correct path to libclang_rt.builtins.a # HIP's CMake uses the command `${HIP_CXX_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt` to find this path. # This can print a non-existing file if the compiler used is icpx. diff --git a/examples/dft/run_time_dispatching/CMakeLists.txt b/examples/dft/run_time_dispatching/CMakeLists.txt index 687249e5e..e221c7950 100644 --- a/examples/dft/run_time_dispatching/CMakeLists.txt +++ b/examples/dft/run_time_dispatching/CMakeLists.txt @@ -27,9 +27,7 @@ set(DFT_RT_SOURCES "") # If users build more than one backend (i.e. mklcpu and mklgpu, or mklcpu and CUDA), they may need to # overwrite ONEAPI_DEVICE_SELECTOR in their environment to run on the desired backend set(DEVICE_FILTERS "") -if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND OR - ENABLE_CUFFT_BACKEND OR ENABLE_ROCFFT_BACKEND OR - ENABLE_PORTFFT_BACKEND) +if(ENABLE_MKLGPU_BACKEND OR ENABLE_MKLCPU_BACKEND OR ENABLE_CUFFT_BACKEND OR ENABLE_ROCFFT_BACKEND OR ENABLE_PORTFFT_BACKEND) list(APPEND DFT_RT_SOURCES "real_fwd_usm") endif() diff --git a/examples/rng/compile_time_dispatching/CMakeLists.txt b/examples/rng/compile_time_dispatching/CMakeLists.txt index 7e01d42f7..4f57db38c 100644 --- a/examples/rng/compile_time_dispatching/CMakeLists.txt +++ b/examples/rng/compile_time_dispatching/CMakeLists.txt @@ -31,8 +31,7 @@ foreach(rng_ct_source ${RNG_CT_SOURCES}) PUBLIC ${CMAKE_BINARY_DIR}/bin ) - if(domain STREQUAL "rng" AND ENABLE_MKLCPU_BACKEND AND - ENABLE_CURAND_BACKEND) + if(domain STREQUAL "rng" AND ENABLE_MKLCPU_BACKEND AND ENABLE_CURAND_BACKEND) add_dependencies(example_${domain}_${rng_ct_source} onemkl_${domain}_mklcpu onemkl_${domain}_curand) From 7eaa3484e3fc4e4eb5f6fe41442460accf24b9e2 Mon Sep 17 00:00:00 2001 From: nscipione Date: Thu, 19 Sep 2024 14:20:12 +0100 Subject: [PATCH 06/10] Move cmake instruction to keep configuration clean Moved variables setting for headers to a more appropriate section of the configuration. --- CMakeLists.txt | 63 +++------------------------------------------- src/CMakeLists.txt | 25 +++++++++++++----- 2 files changed, 23 insertions(+), 65 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e3b509c2..15fddba59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,14 +34,14 @@ endif() # Build options option(BUILD_SHARED_LIBS "Build dynamic libraries" ON) -if(BUILD_SHARED_LIBS) - set(ONEAPI_ONEMKL_BUILD_SHARED_LIBS True) -endif() - ## 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() + # blas option(ENABLE_CUBLAS_BACKEND "Enable the cuBLAS backend for the BLAS interface" OFF) option(ENABLE_ROCBLAS_BACKEND "Enable the rocBLAS backend for the BLAS interface" OFF) @@ -61,61 +61,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) -# 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 -if(ENABLE_MKLCPU_BACKEND) - option(ENABLE_MKLCPU_THREAD_TBB "Enable the use of Intel TBB with the oneMKL CPU backend" ON) - set(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND True) -endif() - -if(ENABLE_MKLGPU_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND True) -endif() - -if(ENABLE_CUBLAS_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND True) -endif() - -if(ENABLE_ROCBLAS_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND True) -endif() - -if(ENABLE_NETLIB_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND True) -endif() - -if(ENABLE_PORTBLAS_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND True) -endif() - -if(ENABLE_CURAND_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND True) -endif() - -if(ENABLE_ROCRAND_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND True) -endif() - -if(ENABLE_CUSOLVER_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND True) -endif() - -if(ENABLE_ROCSOLVER_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND True) -endif() - -if(ENABLE_CUFFT_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND True) -endif() - -if(ENABLE_ROCFFT_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND True) -endif() - -if(ENABLE_PORTFFT_BACKEND) - set(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND True) -endif() set(ONEMKL_SYCL_IMPLEMENTATION "dpc++" CACHE STRING "Name of the SYCL compiler") set(HIP_TARGETS "" CACHE STRING "Target HIP architectures") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0beadc3ec..fd1db9165 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,12 +23,6 @@ if(WIN32 AND BUILD_SHARED_LIBS) list(APPEND ONEMKL_BUILD_COPT "-Donemkl_EXPORTS") endif() -# portBLAS backend variables must be accessible here to correctly -# generate the config file. -set(ENABLE_PORTBLAS_BACKEND_INTEL_CPU OFF CACHE INTERNAL "") -set(ENABLE_PORTBLAS_BACKEND_INTEL_GPU OFF CACHE INTERNAL "") -set(ENABLE_PORTBLAS_BACKEND_AMD_GPU OFF CACHE INTERNAL "") -set(ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU OFF CACHE INTERNAL "") # store path to CMAKE_CURRENT_BINARY_DIR to use it later (makes FetchContent_Declare workable) set(ONEMKL_GENERATED_INCLUDE_PATH ${CMAKE_CURRENT_BINARY_DIR}) @@ -46,6 +40,25 @@ foreach(domain ${TARGET_DOMAINS}) endforeach() # Generate header with enabled backends for testing + +# 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" From ce6feaa85f162f3f1d168312775d6df75fa6f079 Mon Sep 17 00:00:00 2001 From: nscipione Date: Fri, 20 Sep 2024 11:10:31 +0100 Subject: [PATCH 07/10] Add function to generate header file to reduce specific variable scope --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd1db9165..90ecb3d11 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,7 @@ 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 @@ -68,6 +69,9 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/detail/config.hpp" DESTINATION include/oneapi/mkl/detail COMPONENT Devel ) +endfunction() + +generate_header_file() # Add recipe for onemkl loader library if(BUILD_SHARED_LIBS) From 0f8fb22d089cbb9b601dcf194af239fd26fb34b3 Mon Sep 17 00:00:00 2001 From: nscipione Date: Wed, 25 Sep 2024 10:11:39 +0100 Subject: [PATCH 08/10] Address PR feedback --- CMakeLists.txt | 2 - deps/googletest/cmake/internal_utils.cmake | 6 +-- src/CMakeLists.txt | 52 +++++++++++----------- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15fddba59..b2763cd8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() @@ -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") diff --git a/deps/googletest/cmake/internal_utils.cmake b/deps/googletest/cmake/internal_utils.cmake index 845b6cae4..b7b4fdc88 100644 --- a/deps/googletest/cmake/internal_utils.cmake +++ b/deps/googletest/cmake/internal_utils.cmake @@ -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 @@ -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") @@ -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") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 90ecb3d11..d9ad819f4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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() From 7c79ac8f9da7b5f934f7ffe4539426dc6d4a1140 Mon Sep 17 00:00:00 2001 From: nscipione Date: Thu, 10 Oct 2024 15:44:21 +0100 Subject: [PATCH 09/10] Update cmake define for blas test --- tests/unit_tests/blas/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/blas/CMakeLists.txt b/tests/unit_tests/blas/CMakeLists.txt index 442079833..ea54db581 100644 --- a/tests/unit_tests/blas/CMakeLists.txt +++ b/tests/unit_tests/blas/CMakeLists.txt @@ -19,8 +19,8 @@ # Add compile definitions for the reference libraries add_compile_definitions( - REF_BLAS_LIBNAME="${REF_BLAS_LIBNAME}" - REF_CBLAS_LIBNAME="${REF_CBLAS_LIBNAME}") + ONEAPI_ONEMKL_REF_BLAS_LIBNAME="${ONEAPI_ONEMKL_REF_BLAS_LIBNAME}" + ONEAPI_ONEMKL_REF_CBLAS_LIBNAME="${ONEAPI_ONEMKL_REF_CBLAS_LIBNAME}") add_subdirectory(level1) add_subdirectory(level2) From 2a739a8ff9ca5d965832b4146c52a06be6454d65 Mon Sep 17 00:00:00 2001 From: nscipione Date: Thu, 10 Oct 2024 16:26:53 +0100 Subject: [PATCH 10/10] Update macro to a smaller one following PR conversation Reducing macro name from "ONEAPI_ONEMKL" to "ONEMKL" --- CMakeLists.txt | 4 +- docs/create_new_backend.rst | 14 ++--- include/oneapi/mkl/blas.hpp | 12 ++--- include/oneapi/mkl/detail/backends_table.hpp | 54 +++++++++---------- include/oneapi/mkl/detail/export.hpp | 2 +- .../oneapi/mkl/dft/detail/descriptor_impl.hpp | 10 ++-- include/oneapi/mkl/lapack.hpp | 8 +-- include/oneapi/mkl/rng/engines.hpp | 24 ++++----- include/oneapi/mkl/sparse_blas.hpp | 4 +- scripts/generate_cmake.py | 2 +- src/CMakeLists.txt | 28 +++++----- .../backends/cublas/cublas_scope_handle.cpp | 4 +- .../backends/cublas/cublas_scope_handle.hpp | 6 +-- src/blas/backends/cublas/cublas_task.hpp | 4 +- src/blas/backends/portblas/CMakeLists.txt | 28 +++++----- .../backends/rocblas/rocblas_scope_handle.cpp | 4 +- .../backends/rocblas/rocblas_scope_handle.hpp | 6 +-- src/blas/backends/rocblas/rocblas_task.hpp | 4 +- src/config.hpp.in | 36 ++++++------- .../cusolver/cusolver_scope_handle.cpp | 4 +- .../cusolver/cusolver_scope_handle.hpp | 6 +-- .../backends/cusolver/cusolver_task.hpp | 4 +- .../rocsolver/rocsolver_scope_handle.cpp | 4 +- .../rocsolver/rocsolver_scope_handle.hpp | 6 +-- .../backends/rocsolver/rocsolver_task.hpp | 4 +- tests/unit_tests/blas/CMakeLists.txt | 4 +- .../blas/include/reference_blas_wrappers.hpp | 8 +-- tests/unit_tests/include/test_helper.hpp | 34 ++++++------ tests/unit_tests/main_test.cpp | 36 ++++++------- .../rng/include/rng_test_common.hpp | 2 +- 30 files changed, 183 insertions(+), 183 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2763cd8d..c4cad8e17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -294,8 +294,8 @@ else() endif() if(DEFINED REF_BLAS_ROOT) - find_file(ONEAPI_ONEMKL_REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) - find_file(ONEAPI_ONEMKL_REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) + find_file(ONEMKL_REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) + find_file(ONEMKL_REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64) endif() # Add source directory and output to bin/ diff --git a/docs/create_new_backend.rst b/docs/create_new_backend.rst index 5298ec3cc..b22df014d 100644 --- a/docs/create_new_backend.rst +++ b/docs/create_new_backend.rst @@ -157,13 +157,13 @@ To integrate the new third-party library to a oneMKL header-based part, followin { domain::blas, { { device::x86cpu, { - #ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND + #ifdef ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("blas_mklcpu") #endif } }, + { device::newdevice, + { - + #ifdef ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND + + #ifdef ONEMKL_ENABLE_NEWLIB_BACKEND + LIB_NAME("blas_newlib") + #endif + } }, @@ -427,8 +427,8 @@ Update the following files to enable the new third-party library for unit tests: .. code-block:: diff - #cmakedefine ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND - + #cmakedefine ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND + #cmakedefine ONEMKL_ENABLE_MKLCPU_BACKEND + + #cmakedefine ONEMKL_ENABLE_NEWLIB_BACKEND * ``tests/unit_tests/CMakeLists.txt``: add instructions about how to link tests with the new backend library @@ -464,14 +464,14 @@ Update the following files to enable the new third-party library for unit tests: .. code-block:: diff - #ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND + #ifdef ONEMKL_ENABLE_MKLGPU_BACKEND #define TEST_RUN_INTELGPU(q, func, args) \ func args #else #define TEST_RUN_INTELGPU(q, func, args) #endif + - + #ifdef ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND + + #ifdef ONEMKL_ENABLE_NEWLIB_BACKEND + #define TEST_RUN_NEWDEVICE(q, func, args) \ + func args + #else @@ -495,7 +495,7 @@ Update the following files to enable the new third-party library for unit tests: } } + - + #ifdef ONEAPI_ONEMKL_ENABLE_NEWLIB_BACKEND + + #ifdef ONEMKL_ENABLE_NEWLIB_BACKEND + devices.push_back(sycl::device(sycl::host_selector())); + #endif diff --git a/include/oneapi/mkl/blas.hpp b/include/oneapi/mkl/blas.hpp index 574ba47de..6b8066e69 100644 --- a/include/oneapi/mkl/blas.hpp +++ b/include/oneapi/mkl/blas.hpp @@ -34,22 +34,22 @@ #include "oneapi/mkl/detail/get_device_id.hpp" #include "oneapi/mkl/blas/detail/blas_loader.hpp" -#ifdef ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND +#ifdef ONEMKL_ENABLE_CUBLAS_BACKEND #include "oneapi/mkl/blas/detail/cublas/blas_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND +#ifdef ONEMKL_ENABLE_ROCBLAS_BACKEND #include "oneapi/mkl/blas/detail/rocblas/blas_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND #include "oneapi/mkl/blas/detail/mklcpu/blas_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND #include "oneapi/mkl/blas/detail/mklgpu/blas_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND +#ifdef ONEMKL_ENABLE_NETLIB_BACKEND #include "oneapi/mkl/blas/detail/netlib/blas_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND +#ifdef ONEMKL_ENABLE_PORTBLAS_BACKEND #include "oneapi/mkl/blas/detail/portblas/blas_ct.hpp" #endif diff --git a/include/oneapi/mkl/detail/backends_table.hpp b/include/oneapi/mkl/detail/backends_table.hpp index 1abc502bd..731781375 100644 --- a/include/oneapi/mkl/detail/backends_table.hpp +++ b/include/oneapi/mkl/detail/backends_table.hpp @@ -47,40 +47,40 @@ static std::map>> libraries = { domain::blas, { { device::x86cpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("blas_mklcpu"), #endif -#ifdef ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND +#ifdef ONEMKL_ENABLE_NETLIB_BACKEND LIB_NAME("blas_netlib"), #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU +#ifdef ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU LIB_NAME("blas_portblas"), #endif } }, { device::intelgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("blas_mklgpu"), #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU +#ifdef ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU LIB_NAME("blas_portblas"), #endif } }, { device::amdgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND +#ifdef ONEMKL_ENABLE_ROCBLAS_BACKEND LIB_NAME("blas_rocblas"), #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU +#ifdef ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU LIB_NAME("blas_portblas"), #endif } }, { device::nvidiagpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND +#ifdef ONEMKL_ENABLE_CUBLAS_BACKEND LIB_NAME("blas_cublas"), #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU +#ifdef ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU LIB_NAME("blas_portblas"), #endif } }, @@ -94,37 +94,37 @@ static std::map>> libraries = { domain::dft, { { device::x86cpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("dft_mklcpu") #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND +#ifdef ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, { device::intelgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("dft_mklgpu") #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND +#ifdef ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, { device::amdgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND +#ifdef ONEMKL_ENABLE_ROCFFT_BACKEND LIB_NAME("dft_rocfft") #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND +#ifdef ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, { device::nvidiagpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND +#ifdef ONEMKL_ENABLE_CUFFT_BACKEND LIB_NAME("dft_cufft") #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND +#ifdef ONEMKL_ENABLE_PORTFFT_BACKEND LIB_NAME("dft_portfft") #endif } }, @@ -138,25 +138,25 @@ static std::map>> libraries = { domain::lapack, { { device::x86cpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("lapack_mklcpu") #endif } }, { device::intelgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("lapack_mklgpu") #endif } }, { device::amdgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND +#ifdef ONEMKL_ENABLE_ROCSOLVER_BACKEND LIB_NAME("lapack_rocsolver") #endif } }, { device::nvidiagpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND +#ifdef ONEMKL_ENABLE_CUSOLVER_BACKEND LIB_NAME("lapack_cusolver") #endif } } } }, @@ -164,25 +164,25 @@ static std::map>> libraries = { domain::rng, { { device::x86cpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("rng_mklcpu") #endif } }, { device::intelgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("rng_mklgpu") #endif } }, { device::amdgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND +#ifdef ONEMKL_ENABLE_ROCRAND_BACKEND LIB_NAME("rng_rocrand") #endif } }, { device::nvidiagpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND +#ifdef ONEMKL_ENABLE_CURAND_BACKEND LIB_NAME("rng_curand") #endif } } } }, @@ -190,13 +190,13 @@ static std::map>> libraries = { domain::sparse_blas, { { device::x86cpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND LIB_NAME("sparse_blas_mklcpu") #endif } }, { device::intelgpu, { -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND LIB_NAME("sparse_blas_mklgpu") #endif } } } }, diff --git a/include/oneapi/mkl/detail/export.hpp b/include/oneapi/mkl/detail/export.hpp index 01170e735..55f6a7b15 100644 --- a/include/oneapi/mkl/detail/export.hpp +++ b/include/oneapi/mkl/detail/export.hpp @@ -22,7 +22,7 @@ #include "oneapi/mkl/detail/config.hpp" -#if !defined(ONEAPI_ONEMKL_BUILD_SHARED_LIBS) || !defined(_WIN64) +#if !defined(ONEMKL_BUILD_SHARED_LIBS) || !defined(_WIN64) #define ONEMKL_EXPORT #define ONEMKL_NO_EXPORT #else diff --git a/include/oneapi/mkl/dft/detail/descriptor_impl.hpp b/include/oneapi/mkl/dft/detail/descriptor_impl.hpp index 4050493e8..b2095c49b 100644 --- a/include/oneapi/mkl/dft/detail/descriptor_impl.hpp +++ b/include/oneapi/mkl/dft/detail/descriptor_impl.hpp @@ -71,23 +71,23 @@ class descriptor { void commit(sycl::queue& queue); -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND void commit(backend_selector selector); #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND void commit(backend_selector selector); #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND +#ifdef ONEMKL_ENABLE_CUFFT_BACKEND void commit(backend_selector selector); #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND +#ifdef ONEMKL_ENABLE_ROCFFT_BACKEND void commit(backend_selector selector); #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND +#ifdef ONEMKL_ENABLE_PORTFFT_BACKEND void commit(backend_selector selector); #endif diff --git a/include/oneapi/mkl/lapack.hpp b/include/oneapi/mkl/lapack.hpp index 8b92cc4f0..f9d331e42 100644 --- a/include/oneapi/mkl/lapack.hpp +++ b/include/oneapi/mkl/lapack.hpp @@ -21,16 +21,16 @@ #include "oneapi/mkl/detail/config.hpp" -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND #include "oneapi/mkl/lapack/detail/mklcpu/lapack_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND #include "oneapi/mkl/lapack/detail/mklgpu/lapack_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND +#ifdef ONEMKL_ENABLE_CUSOLVER_BACKEND #include "oneapi/mkl/lapack/detail/cusolver/lapack_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND +#ifdef ONEMKL_ENABLE_ROCSOLVER_BACKEND #include "oneapi/mkl/lapack/detail/rocsolver/lapack_ct.hpp" #endif diff --git a/include/oneapi/mkl/rng/engines.hpp b/include/oneapi/mkl/rng/engines.hpp index 7b52bb3d7..610fda70b 100644 --- a/include/oneapi/mkl/rng/engines.hpp +++ b/include/oneapi/mkl/rng/engines.hpp @@ -35,16 +35,16 @@ #include "oneapi/mkl/rng/detail/engine_impl.hpp" #include "oneapi/mkl/rng/detail/rng_loader.hpp" -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND #include "oneapi/mkl/rng/detail/mklcpu/onemkl_rng_mklcpu.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND #include "oneapi/mkl/rng/detail/mklgpu/onemkl_rng_mklgpu.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND +#ifdef ONEMKL_ENABLE_CURAND_BACKEND #include "oneapi/mkl/rng/detail/curand/onemkl_rng_curand.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND +#ifdef ONEMKL_ENABLE_ROCRAND_BACKEND #include "oneapi/mkl/rng/detail/rocrand/onemkl_rng_rocrand.hpp" #endif @@ -68,7 +68,7 @@ class philox4x32x10 { philox4x32x10(sycl::queue queue, std::initializer_list seed) : pimpl_(detail::create_philox4x32x10(get_device_id(queue), queue, seed)) {} -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(mklcpu::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -77,7 +77,7 @@ class philox4x32x10 { : pimpl_(mklcpu::create_philox4x32x10(selector.get_queue(), seed)) {} #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(mklgpu::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -86,7 +86,7 @@ class philox4x32x10 { : pimpl_(mklgpu::create_philox4x32x10(selector.get_queue(), seed)) {} #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND +#ifdef ONEMKL_ENABLE_CURAND_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(curand::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -94,7 +94,7 @@ class philox4x32x10 { std::initializer_list seed) : pimpl_(curand::create_philox4x32x10(selector.get_queue(), seed)) {} #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND +#ifdef ONEMKL_ENABLE_ROCRAND_BACKEND philox4x32x10(backend_selector selector, std::uint64_t seed = default_seed) : pimpl_(rocrand::create_philox4x32x10(selector.get_queue(), seed)) {} @@ -160,7 +160,7 @@ class mrg32k3a { mrg32k3a(sycl::queue queue, std::initializer_list seed) : pimpl_(detail::create_mrg32k3a(get_device_id(queue), queue, seed)) {} -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(mklcpu::create_mrg32k3a(selector.get_queue(), seed)) {} @@ -168,7 +168,7 @@ class mrg32k3a { : pimpl_(mklcpu::create_mrg32k3a(selector.get_queue(), seed)) {} #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(mklgpu::create_mrg32k3a(selector.get_queue(), seed)) {} @@ -176,7 +176,7 @@ class mrg32k3a { : pimpl_(mklgpu::create_mrg32k3a(selector.get_queue(), seed)) {} #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND +#ifdef ONEMKL_ENABLE_CURAND_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(curand::create_mrg32k3a(selector.get_queue(), seed)) {} @@ -184,7 +184,7 @@ class mrg32k3a { : pimpl_(curand::create_mrg32k3a(selector.get_queue(), seed)) {} #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND +#ifdef ONEMKL_ENABLE_ROCRAND_BACKEND mrg32k3a(backend_selector selector, std::uint32_t seed = default_seed) : pimpl_(rocrand::create_mrg32k3a(selector.get_queue(), seed)) {} diff --git a/include/oneapi/mkl/sparse_blas.hpp b/include/oneapi/mkl/sparse_blas.hpp index be8aa53b8..004b79727 100644 --- a/include/oneapi/mkl/sparse_blas.hpp +++ b/include/oneapi/mkl/sparse_blas.hpp @@ -28,10 +28,10 @@ #include "oneapi/mkl/detail/config.hpp" -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND #include "sparse_blas/detail/mklcpu/sparse_blas_ct.hpp" #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND #include "sparse_blas/detail/mklgpu/sparse_blas_ct.hpp" #endif diff --git a/scripts/generate_cmake.py b/scripts/generate_cmake.py index 2d4748ad4..36cac3669 100644 --- a/scripts/generate_cmake.py +++ b/scripts/generate_cmake.py @@ -84,7 +84,7 @@ def usage(err = None): for f in file_list: if re.search('_dyn.c', f): - out_file.write(""" $<$: {filename}> + out_file.write(""" $<$: {filename}> """.format(filename=f)) else: out_file.write(""" {filename} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d9ad819f4..6ff8d5d11 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,20 +45,20 @@ 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}) + set(ONEMKL_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + set(ONEMKL_ENABLE_MKLCPU_BACKEND ${ENABLE_MKLCPU_BACKEND}) + set(ONEMKL_ENABLE_MKLGPU_BACKEND ${ENABLE_MKLGPU_BACKEND}) + set(ONEMKL_ENABLE_CUBLAS_BACKEND ${ENABLE_CUBLAS_BACKEND}) + set(ONEMKL_ENABLE_ROCBLAS_BACKEND ${ENABLE_ROCBLAS_BACKEND}) + set(ONEMKL_ENABLE_NETLIB_BACKEND ${ENABLE_NETLIB_BACKEND}) + set(ONEMKL_ENABLE_PORTBLAS_BACKEND ${ENABLE_PORTBLAS_BACKEND}) + set(ONEMKL_ENABLE_CURAND_BACKEND ${ENABLE_CURAND_BACKEND}) + set(ONEMKL_ENABLE_ROCRAND_BACKEND ${ENABLE_ROCRAND_BACKEND}) + set(ONEMKL_ENABLE_CUSOLVER_BACKEND ${ENABLE_CUSOLVER_BACKEND}) + set(ONEMKL_ENABLE_ROCSOLVER_BACKEND ${ENABLE_ROCSOLVER_BACKEND}) + set(ONEMKL_ENABLE_CUFFT_BACKEND ${ENABLE_CUFFT_BACKEND}) + set(ONEMKL_ENABLE_ROCFFT_BACKEND ${ENABLE_ROCFFT_BACKEND}) + set(ONEMKL_ENABLE_PORTFFT_BACKEND ${ENABLE_PORTFFT_BACKEND}) configure_file(config.hpp.in "${CMAKE_CURRENT_BINARY_DIR}/oneapi/mkl/config.hpp.configured") file(GENERATE diff --git a/src/blas/backends/cublas/cublas_scope_handle.cpp b/src/blas/backends/cublas/cublas_scope_handle.cpp index 1f84de776..dd12552fb 100644 --- a/src/blas/backends/cublas/cublas_scope_handle.cpp +++ b/src/blas/backends/cublas/cublas_scope_handle.cpp @@ -35,7 +35,7 @@ namespace cublas { * takes place if no other element in the container has a key equivalent to * the one being emplaced (keys in a map container are unique). */ -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED thread_local cublas_handle CublasScopedContextHandler::handle_helper = cublas_handle{}; #else @@ -97,7 +97,7 @@ cublasHandle_t CublasScopedContextHandler::get_handle(const sycl::queue &queue) CUresult cuErr; CUcontext desired; CUDA_ERROR_FUNC(cuDevicePrimaryCtxRetain, cuErr, &desired, cudaDevice); -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED auto piPlacedContext_ = reinterpret_cast(desired); #else auto piPlacedContext_ = reinterpret_cast(desired); diff --git a/src/blas/backends/cublas/cublas_scope_handle.hpp b/src/blas/backends/cublas/cublas_scope_handle.hpp index 341316d2f..d88124ac1 100644 --- a/src/blas/backends/cublas/cublas_scope_handle.hpp +++ b/src/blas/backends/cublas/cublas_scope_handle.hpp @@ -36,8 +36,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include @@ -88,7 +88,7 @@ class CublasScopedContextHandler { sycl::context *placedContext_; bool needToRecover_; sycl::interop_handle &ih; -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED static thread_local cublas_handle handle_helper; #else static thread_local cublas_handle handle_helper; diff --git a/src/blas/backends/cublas/cublas_task.hpp b/src/blas/backends/cublas/cublas_task.hpp index 4fbdfdda2..b3887fcd4 100644 --- a/src/blas/backends/cublas/cublas_task.hpp +++ b/src/blas/backends/cublas/cublas_task.hpp @@ -38,8 +38,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include diff --git a/src/blas/backends/portblas/CMakeLists.txt b/src/blas/backends/portblas/CMakeLists.txt index 4c0645239..3256554a3 100644 --- a/src/blas/backends/portblas/CMakeLists.txt +++ b/src/blas/backends/portblas/CMakeLists.txt @@ -50,16 +50,16 @@ if(PORTBLAS_TUNING_TARGET) # Allow the user to manually enable a specific device type # for tuned portBLAS configurations and sets sycl-target. if(PORTBLAS_TUNING_TARGET STREQUAL "INTEL_CPU") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "") target_compile_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=spir64_x86_64 -fsycl-unnamed-lambda) target_link_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=spir64_x86_64) elseif(PORTBLAS_TUNING_TARGET STREQUAL "INTEL_GPU") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") elseif(PORTBLAS_TUNING_TARGET STREQUAL "AMD_GPU") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") if (is_dpcpp) target_compile_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=amdgcn-amd-amdhsa -fsycl-unnamed-lambda @@ -72,7 +72,7 @@ if(PORTBLAS_TUNING_TARGET) " Compilation may fail.") endif() elseif(PORTBLAS_TUNING_TARGET STREQUAL "NVIDIA_GPU") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") if (is_dpcpp) target_compile_options(ONEMKL::SYCL::SYCL INTERFACE -fsycl-targets=nvptx64-nvidia-cuda -fsycl-unnamed-lambda) @@ -94,27 +94,27 @@ if(PORTBLAS_TUNING_TARGET) endif() elseif(NUM_TARGETS EQUAL 0) # Enable portBLAS backend for all devices types - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") else() # Try to automatically detect the PORTBLAS_TUNING_TARGET foreach(SYCL_TARGET IN LISTS SYCL_TARGETS) if(SYCL_TARGETS MATCHES "^intel_gpu" OR SYCL_TARGETS MATCHES "^spir64_gen") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "INTEL_GPU") elseif(SYCL_TARGETS MATCHES "^spir64_x86_64") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") elseif(SYCL_TARGETS MATCHES "^spir64") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "INTEL_GPU") elseif(SYCL_TARGETS MATCHES "^amd_gpu" OR SYCL_TARGETS MATCHES "-amd-") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "AMD_GPU") elseif(SYCL_TARGETS MATCHES "^nvidia_gpu" OR SYCL_TARGETS MATCHES "-nvidia-") - set(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") + set(ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU "ON" CACHE INTERNAL "") set(PORTBLAS_TUNING_TARGET "NVIDIA_GPU") endif() endforeach() diff --git a/src/blas/backends/rocblas/rocblas_scope_handle.cpp b/src/blas/backends/rocblas/rocblas_scope_handle.cpp index 5edca96f7..8f48aed3d 100644 --- a/src/blas/backends/rocblas/rocblas_scope_handle.cpp +++ b/src/blas/backends/rocblas/rocblas_scope_handle.cpp @@ -50,7 +50,7 @@ rocblas_handle_container::~rocblas_handle_container() noexcept(false) { * takes place if no other element in the container has a key equivalent to * the one being emplaced (keys in a map container are unique). */ -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED thread_local rocblas_handle_container RocblasScopedContextHandler::handle_helper = rocblas_handle_container{}; #else @@ -113,7 +113,7 @@ rocblas_handle RocblasScopedContextHandler::get_handle(const sycl::queue &queue) hipError_t hipErr; hipCtx_t desired; HIP_ERROR_FUNC(hipDevicePrimaryCtxRetain, hipErr, &desired, hipDevice); -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED auto piPlacedContext_ = reinterpret_cast(desired); #else auto piPlacedContext_ = reinterpret_cast(desired); diff --git a/src/blas/backends/rocblas/rocblas_scope_handle.hpp b/src/blas/backends/rocblas/rocblas_scope_handle.hpp index 734e58fb1..76c849ef8 100644 --- a/src/blas/backends/rocblas/rocblas_scope_handle.hpp +++ b/src/blas/backends/rocblas/rocblas_scope_handle.hpp @@ -29,8 +29,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include @@ -55,7 +55,7 @@ class RocblasScopedContextHandler { sycl::context *placedContext_; bool needToRecover_; sycl::interop_handle &interop_h; -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED static thread_local rocblas_handle_container handle_helper; #else static thread_local rocblas_handle_container handle_helper; diff --git a/src/blas/backends/rocblas/rocblas_task.hpp b/src/blas/backends/rocblas/rocblas_task.hpp index a33bf2a2c..3b872e536 100644 --- a/src/blas/backends/rocblas/rocblas_task.hpp +++ b/src/blas/backends/rocblas/rocblas_task.hpp @@ -37,8 +37,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include diff --git a/src/config.hpp.in b/src/config.hpp.in index 85c876a72..de44cb16b 100644 --- a/src/config.hpp.in +++ b/src/config.hpp.in @@ -20,23 +20,23 @@ #ifndef ONEMKL_CONFIG_H #define ONEMKL_CONFIG_H -#cmakedefine ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU -#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU -#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU -#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU -#cmakedefine ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND -#cmakedefine ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND -#cmakedefine ONEAPI_ONEMKL_BUILD_SHARED_LIBS +#cmakedefine ONEMKL_ENABLE_CUBLAS_BACKEND +#cmakedefine ONEMKL_ENABLE_CUFFT_BACKEND +#cmakedefine ONEMKL_ENABLE_CURAND_BACKEND +#cmakedefine ONEMKL_ENABLE_CUSOLVER_BACKEND +#cmakedefine ONEMKL_ENABLE_MKLCPU_BACKEND +#cmakedefine ONEMKL_ENABLE_MKLGPU_BACKEND +#cmakedefine ONEMKL_ENABLE_NETLIB_BACKEND +#cmakedefine ONEMKL_ENABLE_PORTBLAS_BACKEND +#cmakedefine ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU +#cmakedefine ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU +#cmakedefine ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU +#cmakedefine ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU +#cmakedefine ONEMKL_ENABLE_PORTFFT_BACKEND +#cmakedefine ONEMKL_ENABLE_ROCBLAS_BACKEND +#cmakedefine ONEMKL_ENABLE_ROCFFT_BACKEND +#cmakedefine ONEMKL_ENABLE_ROCRAND_BACKEND +#cmakedefine ONEMKL_ENABLE_ROCSOLVER_BACKEND +#cmakedefine ONEMKL_BUILD_SHARED_LIBS #endif diff --git a/src/lapack/backends/cusolver/cusolver_scope_handle.cpp b/src/lapack/backends/cusolver/cusolver_scope_handle.cpp index a0c9c6b6f..f381336d6 100644 --- a/src/lapack/backends/cusolver/cusolver_scope_handle.cpp +++ b/src/lapack/backends/cusolver/cusolver_scope_handle.cpp @@ -35,7 +35,7 @@ namespace cusolver { * takes place if no other element in the container has a key equivalent to * the one being emplaced (keys in a map container are unique). */ -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED thread_local cusolver_handle CusolverScopedContextHandler::handle_helper = cusolver_handle{}; #else @@ -98,7 +98,7 @@ cusolverDnHandle_t CusolverScopedContextHandler::get_handle(const sycl::queue &q CUresult cuErr; CUcontext desired; CUDA_ERROR_FUNC(cuDevicePrimaryCtxRetain, cuErr, &desired, cudaDevice); -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED auto piPlacedContext_ = reinterpret_cast(desired); #else auto piPlacedContext_ = reinterpret_cast(desired); diff --git a/src/lapack/backends/cusolver/cusolver_scope_handle.hpp b/src/lapack/backends/cusolver/cusolver_scope_handle.hpp index 390f9bb46..1bd916f71 100644 --- a/src/lapack/backends/cusolver/cusolver_scope_handle.hpp +++ b/src/lapack/backends/cusolver/cusolver_scope_handle.hpp @@ -42,8 +42,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include @@ -92,7 +92,7 @@ class CusolverScopedContextHandler { sycl::context *placedContext_; bool needToRecover_; sycl::interop_handle &ih; -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED static thread_local cusolver_handle handle_helper; #else static thread_local cusolver_handle handle_helper; diff --git a/src/lapack/backends/cusolver/cusolver_task.hpp b/src/lapack/backends/cusolver/cusolver_task.hpp index 6a35dea84..96107f959 100644 --- a/src/lapack/backends/cusolver/cusolver_task.hpp +++ b/src/lapack/backends/cusolver/cusolver_task.hpp @@ -34,8 +34,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include diff --git a/src/lapack/backends/rocsolver/rocsolver_scope_handle.cpp b/src/lapack/backends/rocsolver/rocsolver_scope_handle.cpp index 480ee9fc3..2a2e7d1ab 100644 --- a/src/lapack/backends/rocsolver/rocsolver_scope_handle.cpp +++ b/src/lapack/backends/rocsolver/rocsolver_scope_handle.cpp @@ -37,7 +37,7 @@ namespace rocsolver { * takes place if no other element in the container has a key equivalent to * the one being emplaced (keys in a map container are unique). */ -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED thread_local rocsolver_handle RocsolverScopedContextHandler::handle_helper = rocsolver_handle{}; #else @@ -100,7 +100,7 @@ rocblas_handle RocsolverScopedContextHandler::get_handle(const sycl::queue &queu hipError_t hipErr; hipCtx_t desired; HIP_ERROR_FUNC(hipDevicePrimaryCtxRetain, hipErr, &desired, hipDevice); -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED auto piPlacedContext_ = reinterpret_cast(desired); #else auto piPlacedContext_ = reinterpret_cast(desired); diff --git a/src/lapack/backends/rocsolver/rocsolver_scope_handle.hpp b/src/lapack/backends/rocsolver/rocsolver_scope_handle.hpp index 1be98a3b9..443a1ca2a 100644 --- a/src/lapack/backends/rocsolver/rocsolver_scope_handle.hpp +++ b/src/lapack/backends/rocsolver/rocsolver_scope_handle.hpp @@ -36,8 +36,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include @@ -55,7 +55,7 @@ class RocsolverScopedContextHandler { sycl::context *placedContext_; bool needToRecover_; sycl::interop_handle &ih; -#ifdef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifdef ONEMKL_PI_INTERFACE_REMOVED static thread_local rocsolver_handle handle_helper; #else static thread_local rocsolver_handle handle_helper; diff --git a/src/lapack/backends/rocsolver/rocsolver_task.hpp b/src/lapack/backends/rocsolver/rocsolver_task.hpp index 43be4b543..4842a18e9 100644 --- a/src/lapack/backends/rocsolver/rocsolver_task.hpp +++ b/src/lapack/backends/rocsolver/rocsolver_task.hpp @@ -36,8 +36,8 @@ // After Plugin Interface removal in DPC++ ur.hpp is the new include #if __has_include() #include -#ifndef ONEAPI_ONEMKL_PI_INTERFACE_REMOVED -#define ONEAPI_ONEMKL_PI_INTERFACE_REMOVED +#ifndef ONEMKL_PI_INTERFACE_REMOVED +#define ONEMKL_PI_INTERFACE_REMOVED #endif #elif __has_include() #include diff --git a/tests/unit_tests/blas/CMakeLists.txt b/tests/unit_tests/blas/CMakeLists.txt index ea54db581..bd37d55f3 100644 --- a/tests/unit_tests/blas/CMakeLists.txt +++ b/tests/unit_tests/blas/CMakeLists.txt @@ -19,8 +19,8 @@ # Add compile definitions for the reference libraries add_compile_definitions( - ONEAPI_ONEMKL_REF_BLAS_LIBNAME="${ONEAPI_ONEMKL_REF_BLAS_LIBNAME}" - ONEAPI_ONEMKL_REF_CBLAS_LIBNAME="${ONEAPI_ONEMKL_REF_CBLAS_LIBNAME}") + ONEMKL_REF_BLAS_LIBNAME="${ONEMKL_REF_BLAS_LIBNAME}" + ONEMKL_REF_CBLAS_LIBNAME="${ONEMKL_REF_CBLAS_LIBNAME}") add_subdirectory(level1) add_subdirectory(level2) diff --git a/tests/unit_tests/blas/include/reference_blas_wrappers.hpp b/tests/unit_tests/blas/include/reference_blas_wrappers.hpp index a3841085d..977d14ca4 100644 --- a/tests/unit_tests/blas/include/reference_blas_wrappers.hpp +++ b/tests/unit_tests/blas/include/reference_blas_wrappers.hpp @@ -41,11 +41,11 @@ extern "C" { static LIB_TYPE h_libblas = NULL; static LIB_TYPE blas_library() { if (h_libblas == NULL) { - h_libblas = GET_LIB_HANDLE(ONEAPI_ONEMKL_REF_BLAS_LIBNAME); + h_libblas = GET_LIB_HANDLE(ONEMKL_REF_BLAS_LIBNAME); if (h_libblas == NULL) { throw oneapi::mkl::library_not_found( "BLAS", "blas_library()", - std::string("failed to load BLAS library ") + ONEAPI_ONEMKL_REF_BLAS_LIBNAME); + std::string("failed to load BLAS library ") + ONEMKL_REF_BLAS_LIBNAME); } } return h_libblas; @@ -54,11 +54,11 @@ static LIB_TYPE blas_library() { static LIB_TYPE h_libcblas = NULL; static LIB_TYPE cblas_library() { if (h_libcblas == NULL) { - h_libcblas = GET_LIB_HANDLE(ONEAPI_ONEMKL_REF_CBLAS_LIBNAME); + h_libcblas = GET_LIB_HANDLE(ONEMKL_REF_CBLAS_LIBNAME); if (h_libcblas == NULL) { throw oneapi::mkl::library_not_found( "BLAS", "cblas_library()", - std::string("failed to load CBLAS library ") + ONEAPI_ONEMKL_REF_CBLAS_LIBNAME); + std::string("failed to load CBLAS library ") + ONEMKL_REF_CBLAS_LIBNAME); } } return h_libcblas; diff --git a/tests/unit_tests/include/test_helper.hpp b/tests/unit_tests/include/test_helper.hpp index bf00ffa77..d4f79c5ce 100644 --- a/tests/unit_tests/include/test_helper.hpp +++ b/tests/unit_tests/include/test_helper.hpp @@ -73,8 +73,8 @@ if (d->get_info().size() == 0) \ GTEST_SKIP() << "Double precision is not supported on the device" -#if defined(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) || defined(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) -#ifdef ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND +#if defined(ONEMKL_ENABLE_MKLCPU_BACKEND) || defined(ONEMKL_ENABLE_NETLIB_BACKEND) +#ifdef ONEMKL_ENABLE_MKLCPU_BACKEND #define TEST_RUN_INTELCPU_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_INTELCPU_SELECT(q, func, ...) \ @@ -88,7 +88,7 @@ #define TEST_RUN_INTELCPU_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND +#ifdef ONEMKL_ENABLE_MKLGPU_BACKEND #define TEST_RUN_INTELGPU_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_INTELGPU_SELECT(q, func, ...) \ @@ -98,55 +98,55 @@ #define TEST_RUN_INTELGPU_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND +#ifdef ONEMKL_ENABLE_CUBLAS_BACKEND #define TEST_RUN_NVIDIAGPU_CUBLAS_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_NVIDIAGPU_CUBLAS_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND +#ifdef ONEMKL_ENABLE_CUSOLVER_BACKEND #define TEST_RUN_NVIDIAGPU_CUSOLVER_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_NVIDIAGPU_CUSOLVER_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND +#ifdef ONEMKL_ENABLE_ROCBLAS_BACKEND #define TEST_RUN_AMDGPU_ROCBLAS_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_AMDGPU_ROCBLAS_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND +#ifdef ONEMKL_ENABLE_CURAND_BACKEND #define TEST_RUN_NVIDIAGPU_CURAND_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_NVIDIAGPU_CURAND_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND +#ifdef ONEMKL_ENABLE_ROCRAND_BACKEND #define TEST_RUN_AMDGPU_ROCRAND_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_AMDGPU_ROCRAND_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND +#ifdef ONEMKL_ENABLE_ROCSOLVER_BACKEND #define TEST_RUN_AMDGPU_ROCSOLVER_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_AMDGPU_ROCSOLVER_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND +#ifdef ONEMKL_ENABLE_PORTBLAS_BACKEND #define TEST_RUN_PORTBLAS_SELECT(q, func, ...) \ func(oneapi::mkl::backend_selector{ q }, __VA_ARGS__) #else #define TEST_RUN_PORTBLAS_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND +#ifdef ONEMKL_ENABLE_CUFFT_BACKEND #define TEST_RUN_NVIDIAGPU_CUFFT_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_NVIDIAGPU_CUFFT_SELECT(q, func, ...) \ @@ -156,7 +156,7 @@ #define TEST_RUN_NVIDIAGPU_CUFFT_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND +#ifdef ONEMKL_ENABLE_ROCFFT_BACKEND #define TEST_RUN_AMDGPU_ROCFFT_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_AMDGPU_ROCFFT_SELECT(q, func, ...) \ @@ -166,7 +166,7 @@ #define TEST_RUN_AMDGPU_ROCFFT_SELECT(q, func, ...) #endif -#ifdef ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND +#ifdef ONEMKL_ENABLE_PORTFFT_BACKEND #define TEST_RUN_PORTFFT_SELECT_NO_ARGS(q, func) \ func(oneapi::mkl::backend_selector{ q }) #define TEST_RUN_PORTFFT_SELECT(q, func, ...) \ @@ -330,10 +330,10 @@ static inline void *malloc_shared(size_t align, size_t size, sycl::device dev, s #ifdef _WIN64 return sycl::malloc_shared(size, dev, ctx); #else -#if defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) || defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) +#if defined(ONEMKL_ENABLE_CUBLAS_BACKEND) || defined(ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::aligned_alloc_shared(align, size, dev, ctx); #endif -#if !defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) && !defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) +#if !defined(ONEMKL_ENABLE_CUBLAS_BACKEND) && !defined(ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::malloc_shared(size, dev, ctx); #endif #endif @@ -344,10 +344,10 @@ static inline void *malloc_device(size_t align, size_t size, sycl::device dev, s #ifdef _WIN64 return sycl::malloc_device(size, dev, ctx); #else -#if defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) || defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) +#if defined(ONEMKL_ENABLE_CUBLAS_BACKEND) || defined(ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::aligned_alloc_device(align, size, dev, ctx); #endif -#if !defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) && !defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) +#if !defined(ONEMKL_ENABLE_CUBLAS_BACKEND) && !defined(ONEMKL_ENABLE_ROCBLAS_BACKEND) return sycl::malloc_device(size, dev, ctx); #endif #endif diff --git a/tests/unit_tests/main_test.cpp b/tests/unit_tests/main_test.cpp index dcbcbee1f..25277e4e0 100644 --- a/tests/unit_tests/main_test.cpp +++ b/tests/unit_tests/main_test.cpp @@ -112,33 +112,33 @@ int main(int argc, char** argv) { if (unique_devices.find(dev.get_info()) == unique_devices.end()) { unique_devices.insert(dev.get_info()); -#if !defined(ONEAPI_ONEMKL_ENABLE_MKLCPU_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU) && \ - !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_NETLIB_BACKEND) +#if !defined(ONEMKL_ENABLE_MKLCPU_BACKEND) && \ + !defined(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_CPU) && \ + !defined(ONEMKL_ENABLE_PORTFFT_BACKEND) && \ + !defined(ONEMKL_ENABLE_NETLIB_BACKEND) if (dev.is_cpu()) continue; #endif -#if !defined(ONEAPI_ONEMKL_ENABLE_MKLGPU_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU) && \ - !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) +#if !defined(ONEMKL_ENABLE_MKLGPU_BACKEND) && \ + !defined(ONEMKL_ENABLE_PORTBLAS_BACKEND_INTEL_GPU) && \ + !defined(ONEMKL_ENABLE_PORTFFT_BACKEND) if (dev.is_gpu() && vendor_id == INTEL_ID) continue; #endif -#if !defined(ONEAPI_ONEMKL_ENABLE_CUBLAS_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_CUSOLVER_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU) && \ - !defined(ONEAPI_ONEMKL_ENABLE_CUFFT_BACKEND) && !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) +#if !defined(ONEMKL_ENABLE_CUBLAS_BACKEND) && \ + !defined(ONEMKL_ENABLE_CURAND_BACKEND) && \ + !defined(ONEMKL_ENABLE_CUSOLVER_BACKEND) && \ + !defined(ONEMKL_ENABLE_PORTBLAS_BACKEND_NVIDIA_GPU) && \ + !defined(ONEMKL_ENABLE_CUFFT_BACKEND) && !defined(ONEMKL_ENABLE_PORTFFT_BACKEND) if (dev.is_gpu() && vendor_id == NVIDIA_ID) continue; #endif -#if !defined(ONEAPI_ONEMKL_ENABLE_ROCBLAS_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_ROCRAND_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_ROCSOLVER_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU) && \ - !defined(ONEAPI_ONEMKL_ENABLE_ROCFFT_BACKEND) && \ - !defined(ONEAPI_ONEMKL_ENABLE_PORTFFT_BACKEND) +#if !defined(ONEMKL_ENABLE_ROCBLAS_BACKEND) && \ + !defined(ONEMKL_ENABLE_ROCRAND_BACKEND) && \ + !defined(ONEMKL_ENABLE_ROCSOLVER_BACKEND) && \ + !defined(ONEMKL_ENABLE_PORTBLAS_BACKEND_AMD_GPU) && \ + !defined(ONEMKL_ENABLE_ROCFFT_BACKEND) && \ + !defined(ONEMKL_ENABLE_PORTFFT_BACKEND) if (dev.is_gpu() && vendor_id == AMD_ID) continue; #endif diff --git a/tests/unit_tests/rng/include/rng_test_common.hpp b/tests/unit_tests/rng/include/rng_test_common.hpp index b3a963bbd..d2bc4859f 100644 --- a/tests/unit_tests/rng/include/rng_test_common.hpp +++ b/tests/unit_tests/rng/include/rng_test_common.hpp @@ -92,7 +92,7 @@ class rng_test { } }; -#ifdef ONEAPI_ONEMKL_ENABLE_CURAND_BACKEND // w/a for cuda backend hangs when there are several queues with different contexts +#ifdef ONEMKL_ENABLE_CURAND_BACKEND // w/a for cuda backend hangs when there are several queues with different contexts static sycl::device* previous_device = nullptr; static sycl::context* context = nullptr;