oneMKL
oneMKL copied to clipboard
Update SYCL support discovery to check for `-fsycl` flag.
Description
oneMKL's CMake currently checks CXX_COMPILER_NAME
and uses that to determine whether SYCL is supported. This prevents SYCL support from being detected if the user compiles with their own build of intel/llvm
(see issue #449).
This is a first stab at modifying MKLConfig.cmake
to check for -fsycl
support directly instead of inferring from the compiler name. It is based on how oneDPL checks for SYCL support, which works for both release builds of IntelLLVM and custom builds of intel/llvm
.
I have also modified the CMake to avoid setting CLANG_COMPILER
if SYCL_COMPILER
is set, as this is the behavior when using IntelLLVM. I assume open-source DPC++ builds should behave similarly.
Fixes #449
Checklist
All Submissions
- [ ] Do all unit tests pass locally? Attach a log.
- [ ] Have you formatted the code using clang-format?
New interfaces
- [ ] Have you provided motivation for adding a new feature as part of RFC and it was accepted? # (RFC)
- [ ] What version of oneAPI spec the interface is targeted?
- [ ] Complete New features checklist
New features
- [ ] Have you provided motivation for adding a new feature?
- [ ] Have you added relevant tests?
Bug fixes
- [ ] Have you added relevant regression tests?
- [ ] Have you included information on how to reproduce the issue (either in a GitHub issue or in this PR)?