- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recently installed oneAPI DPC++ 2022.0.3 wiht Visual Studio 2022 and was trying to use OpenMP and its off-loading capability. I have two issues:
1. Why _OPENMP macro is not defined (even though OpenMP support is turned on)? I thought OpenMP standard says _OPENMP macro should be defined if OpenMP is supported?
2. When I "Enable OpenMP Offloading" with "Generate device binary for Intel(R) GPUs...", I got compilation error with message: "Error: Device name missing." (In Visual studio 2022 output window) ... Any idea how to resolve this issue?
Thanks,
Yo@Taiwan
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel communities.
Could you please provide the sample reproducer code and steps to reproduce your issue at our end? If possible please attach the project file by zipping it.
Thanks and regards,
Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The project file is attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We haven't heard back from you. Could you please let us know if your issue is resolved, if not could you please respond to the above-asked questions to investigate your issue further?
Best Regards,
Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
The visual studio project has been uploaded. The OpenMP option is enabled in the project properties, but the program would respond with "OpenMP not supported" because _OPENMP is not defined. Furthermore, if OpenMP offloading to Intel GPU option is turned on, the compilation fails.
Yo@Taiwan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>The OpenMP option is enabled in the project properties, but the program would respond with "OpenMP not supported" because _OPENMP is not defined.
From the sample reproducer which was provided by you, we found that the OpenMP option is not enabled. We have tried enabling the OpenMP option and it displays the correct output. Please find the below screenshot:
Please find the path for enabling the OpenMP, Project Properties-->DPC++-->Language-->OpenMP Support-->Select the "Generate Parallel Code (/Qiopenmp)" from the dropdown.
>>OpenMP offloading to Intel GPU option is turned on, the compilation fails.
We are working on your issue internally, we will get back to you soon.
Thanks & Regards,
Varsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm seeing a similar issue on Linux. dpcpp fails to compile the following OpenMP code while icpx works.
#include <omp.h>
int main(void) {
#ifdef _OPENMP
omp_get_max_threads();
return 0;
#elif defined(__HIP_DEVICE_COMPILE__)
return 0;
#else
breaks_on_purpose
#endif
}
With icpx:
$ icpx --version
Intel(R) oneAPI DPC++/C++ Compiler 2022.0.0 (2022.0.0.20211123)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm
$ icpx -fiopenmp -fopenmp-targets=spir64 OpenMPTryFlag.cpp
# Successfully generates a.out
With dpcpp:
$ dpcpp --version
Intel(R) oneAPI DPC++/C++ Compiler 2022.0.0 (2022.0.0.20211123)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm
$ dpcpp -fiopenmp -fopenmp-targets=spir64 OpenMPTryFlag.cpp
OpenMPTryFlag.cpp:10:3: error: use of undeclared identifier 'breaks_on_purpose'
breaks_on_purpose
^
1 error generated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to reproduce the issue both with VS and with the command line. Seems there is not currently support for the keyword "spir64_gen" with icx or icpx. When I used "spir64" it worked fine for me though. Is this an okay workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Has your issue been resolved? If I don't hear from you within 5 business days, I will assume your support request is resolved.
![](/skins/images/872293744008A34B36F8ABF94A46CC66/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page