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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

s-Nick
Copy link
Contributor

@s-Nick s-Nick commented Sep 27, 2024

Description

Update how dft mklgpu backend includes header files from MKL and how cmake adds them to compilation.
This is done to avoid future name conflicts between this library and backend library. Forcing the compiler to look for some headers following the "" and <> inclusions rules accordingly with C++ Core Guideline SF.12

Checklist

All Submissions

  • Do all unit tests pass locally? Attach a log.
    arc_mklgpu_dft_log.txt
    N.B. Tests ran with current oneAPI release (2024.2) I cannot run tests with next one.

  • Have you formatted the code using clang-format?

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
@s-Nick s-Nick requested a review from Rbiessy September 27, 2024 08:31
@@ -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}
)
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.

Copy link
Contributor

@Rbiessy Rbiessy left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this.
I'll approve once we have been able to test this with nightly builds.

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

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

Choose a reason for hiding this comment

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

This deserves a comment to explain the header conflict and why the iquote is needed.
That looks better than I expected, this is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants