-
Notifications
You must be signed in to change notification settings - Fork 732
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
-fsycl
breaks _OPENMP
preprocessor definition
#10711
Comments
AFAIK: It's expected due to the 2 pass compilation strategy used by DPCPP, you need to protect the OpenMP code to be not compiled during the SYCL pass |
So, this effectively means that I cannot have OpenMP and SYCL code in the same translation unit? Is this a current implementation limitation or is there a fundamental reason why this cannot work? Is there any plan to support this in the future? Thx! |
No, it works. You just need to play with pragma in the case when you rely on the presence of OpenMP macro. If you just use pragma, it will work out of the box.
You can even allocate memory in sycl and use it in OpenMP (https://github.com/argonne-lcf/HPC-Patterns/tree/main/sycl_omp_ze_interopt) |
Thx a lot @TApplencourt, I think I understood how this works! |
Describe the bug
Compiling a program which makes use of
_OPENMP
to check for the OpenMP version will result in a broken macro if-fsycl
is used as a compilation flag.To Reproduce
Without SYCL:
With SYCL:
See it here on godbolt.
The text was updated successfully, but these errors were encountered: