-
Notifications
You must be signed in to change notification settings - Fork 163
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
Update SYCL support discovery to check for -fsycl
flag.
#450
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -208,12 +208,28 @@ if(CMAKE_Fortran_COMPILER) | |||||||||||||
endif() | ||||||||||||||
|
||||||||||||||
# Determine Compiler Family | ||||||||||||||
if(CXX_COMPILER_NAME STREQUAL "dpcpp" OR CXX_COMPILER_NAME STREQUAL "dpcpp.exe" | ||||||||||||||
OR CXX_COMPILER_NAME STREQUAL "icpx" OR CXX_COMPILER_NAME STREQUAL "icx.exe") | ||||||||||||||
set(SYCL_COMPILER ON) | ||||||||||||||
|
||||||||||||||
include(CMakePackageConfigHelpers) | ||||||||||||||
include(CheckCXXCompilerFlag) | ||||||||||||||
include(CheckIncludeFileCXX) | ||||||||||||||
include(GNUInstallDirs) | ||||||||||||||
Comment on lines
+212
to
+215
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think we can delete the first line |
||||||||||||||
|
||||||||||||||
# Check SYCL support by the compiler | ||||||||||||||
check_cxx_compiler_flag("-fsycl" _fsycl_option) | ||||||||||||||
if (_fsycl_option) | ||||||||||||||
CHECK_INCLUDE_FILE_CXX("sycl/sycl.hpp" _sycl_header "-fsycl") | ||||||||||||||
if (NOT _sycl_header) | ||||||||||||||
CHECK_INCLUDE_FILE_CXX("CL/sycl.hpp" _sycl_header_old "-fsycl") | ||||||||||||||
Comment on lines
+218
to
+222
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In addition, please consider removing the space after
|
||||||||||||||
endif() | ||||||||||||||
if (_sycl_header OR _sycl_header_old) | ||||||||||||||
set(SYCL_COMPILER ON) | ||||||||||||||
endif() | ||||||||||||||
endif() | ||||||||||||||
if(C_COMPILER_NAME MATCHES "^clang" OR CXX_COMPILER_NAME MATCHES "^clang") | ||||||||||||||
set(CLANG_COMPILER ON) | ||||||||||||||
|
||||||||||||||
if(NOT DEFINED SYCL_COMPILER OR SYCL_COMPILER MATCHES OFF) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach could not work correctly for case when MKLConfig is used for building non-SYCL app with clang compiler that supports SYCL, but I believe this fix is enough for oneMKL project build. We can update this part later with more general fix from Intel oneMKL There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you mean
Suggested change
|
||||||||||||||
if(C_COMPILER_NAME MATCHES "^clang" OR CXX_COMPILER_NAME MATCHES "^clang") | ||||||||||||||
set(CLANG_COMPILER ON) | ||||||||||||||
endif() | ||||||||||||||
endif() | ||||||||||||||
if(CMAKE_C_COMPILER_ID STREQUAL "PGI" OR CMAKE_CXX_COMPILER_ID STREQUAL "PGI" OR CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" | ||||||||||||||
OR CMAKE_C_COMPILER_ID STREQUAL "NVHPC" OR CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC" | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put this block in a condition please?
Although only CXX is used in oneMKL interfaces, oneMKL also needs to support C and Fortran. There is a possibility that users would use
MKLConfig.cmake
here with oneMKL.