Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DFT][MKLGPU] Update mklgpu support to mkl preparing for oneapi 2025.0 release #575

Merged
merged 8 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/dft/backends/mklgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ add_library(${LIB_OBJ} OBJECT
)
add_dependencies(onemkl_backend_libs_dft ${LIB_NAME})

target_include_directories(${LIB_OBJ}
PUBLIC ${ONEMKL_INTERFACE_INCLUDE_DIRS}
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving the includes change I made a little bit down. This command is not necessary anymore, so I decided to remove it trying to keep the cmake as lean as possible.

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

# Due to using the same file name for different headers in this library and in
# the Intel(R) oneAPI Math Kernel Library, we force the compiler to follow C++
# Core Guideline SF.12 using the flag "-iquote" to avoid conflicts and find the
# correct header.
target_compile_options(${LIB_OBJ}
BEFORE PRIVATE -iquote $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
Rbiessy marked this conversation as resolved.
Show resolved Hide resolved
)

target_include_directories(${LIB_OBJ}
PRIVATE ${PROJECT_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/bin
Expand Down
7 changes: 6 additions & 1 deletion src/dft/backends/mklgpu/backward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@

#include "mklgpu_helpers.hpp"

#include "mkl_version.h"
// 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
8 changes: 6 additions & 2 deletions src/dft/backends/mklgpu/commit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@
#include "dft/backends/mklgpu/mklgpu_helpers.hpp"
#include "../stride_helper.hpp"

#include "mkl_version.h"
// 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"
#if INTEL_MKL_VERSION < 20240001
#error MKLGPU requires oneMKL 2024.1 or later
#endif
Expand Down
7 changes: 6 additions & 1 deletion src/dft/backends/mklgpu/forward.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@

#include "mklgpu_helpers.hpp"

#include "mkl_version.h"
// 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
10 changes: 6 additions & 4 deletions src/dft/backends/mklgpu/mklgpu_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
#include "oneapi/mkl/detail/exceptions.hpp"
#include "oneapi/mkl/dft/detail/types_impl.hpp"

#include "mkl_version.h"
// 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 Expand Up @@ -64,13 +69,10 @@ inline constexpr dft::config_param to_mklgpu(dft::detail::config_param param) {
case iparam::FORWARD_SCALE: return oparam::FORWARD_SCALE;
case iparam::NUMBER_OF_TRANSFORMS: return oparam::NUMBER_OF_TRANSFORMS;
case iparam::COMPLEX_STORAGE: return oparam::COMPLEX_STORAGE;
case iparam::REAL_STORAGE: return oparam::REAL_STORAGE;
case iparam::CONJUGATE_EVEN_STORAGE: return oparam::CONJUGATE_EVEN_STORAGE;
case iparam::FWD_DISTANCE: return oparam::FWD_DISTANCE;
case iparam::BWD_DISTANCE: return oparam::BWD_DISTANCE;
case iparam::WORKSPACE: return oparam::WORKSPACE;
case iparam::ORDERING: return oparam::ORDERING;
case iparam::TRANSPOSE: return oparam::TRANSPOSE;
case iparam::PACKED_FORMAT: return oparam::PACKED_FORMAT;
case iparam::WORKSPACE_PLACEMENT: return oparam::WORKSPACE; // Same as WORKSPACE
case iparam::WORKSPACE_EXTERNAL_BYTES: return oparam::WORKSPACE_BYTES;
Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/dft/source/compute_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class ComputeTests_real_real_out_of_place_REAL
} \
catch (std::exception & e) { \
std::string msg = e.what(); \
if (msg.find("FFT_UNIMPLEMENTED") != std::string::npos) { \
if ((msg.find("FFT_UNIMPLEMENTED") != std::string::npos) || \
(msg.find("Unimplemented") != std::string::npos)) { \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-Nick, was this addition motivated by a new exception that's not a oneapi::mkl::unimplemented exception with "Unimplemented" in its message? If yes, could you please share details?

std::cout << "Skipping test because: \"" << msg << "\"" << std::endl; \
GTEST_SKIP(); \
} \
Expand Down