Skip to content

Commit

Permalink
Update mklgpu support to mkl preparing for oneapi 2025.0 release
Browse files Browse the repository at this point in the history
Update how dft mklgpu backend include header files from MKL and how
cmake add them to compilation. This is done to avoid name conflicts
between interface and library backends. Force compiler to look for some
header following the "" and <> inclusions rules accordingly with
C++ Core Guideline SF.12
  • Loading branch information
s-Nick committed Sep 26, 2024
1 parent 4ed3e97 commit ae979c6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/dft/backends/mklgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ add_library(${LIB_OBJ} OBJECT
)
add_dependencies(onemkl_backend_libs_dft ${LIB_NAME})

target_include_directories(${LIB_OBJ}
PUBLIC ${ONEMKL_INTERFACE_INCLUDE_DIRS}
)
target_include_directories(${LIB_NAME}
PUBLIC ${ONEMKL_INTERFACE_INCLUDE_DIRS}
)

target_compile_options(${LIB_OBJ}
BEFORE PRIVATE -iquote $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
)

target_include_directories(${LIB_OBJ}
PRIVATE ${PROJECT_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/bin
Expand Down
6 changes: 5 additions & 1 deletion src/dft/backends/mklgpu/backward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
#include "mklgpu_helpers.hpp"

// MKLGPU header
#include "oneapi/mkl/dfti.hpp"
#if INTEL_MKL_VERSION < 20250000
#include <oneapi/mkl/dfti.hpp>
#else
#include <oneapi/mkl/dft.hpp>
#endif

namespace oneapi::mkl::dft::mklgpu {
namespace detail {
Expand Down
6 changes: 5 additions & 1 deletion src/dft/backends/mklgpu/commit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
#include "../stride_helper.hpp"

// MKLGPU header
#include "oneapi/mkl/dfti.hpp"
#if INTEL_MKL_VERSION < 20250000
#include <oneapi/mkl/dfti.hpp>
#else
#include <oneapi/mkl/dft.hpp>
#endif

// MKL 2024.1 deprecates input/output strides.
#include "mkl_version.h"
Expand Down
6 changes: 5 additions & 1 deletion src/dft/backends/mklgpu/forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#include "mklgpu_helpers.hpp"

// MKLGPU header
#include "oneapi/mkl/dfti.hpp"
#if INTEL_MKL_VERSION < 20250000
#include <oneapi/mkl/dfti.hpp>
#else
#include <oneapi/mkl/dft.hpp>
#endif

/**
Note that in this file, the Intel oneMKL-GPU library's interface mirrors the
Expand Down
6 changes: 5 additions & 1 deletion src/dft/backends/mklgpu/mklgpu_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
#include "oneapi/mkl/dft/detail/types_impl.hpp"

// MKLGPU header
#include "oneapi/mkl/dfti.hpp"
#if INTEL_MKL_VERSION < 20250000
#include <oneapi/mkl/dfti.hpp>
#else
#include <oneapi/mkl/dft.hpp>
#endif

namespace oneapi {
namespace mkl {
Expand Down

0 comments on commit ae979c6

Please sign in to comment.