<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic _OPENMP macro not defined? in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1370312#M1976</link>
    <description>&lt;P&gt;I recently installed oneAPI DPC++ 2022.0.3 wiht Visual Studio 2022 and was trying to use OpenMP and its off-loading capability.&amp;nbsp; I have two issues:&lt;/P&gt;
&lt;P&gt;1. Why _OPENMP macro is not defined (even though OpenMP support is turned on)?&amp;nbsp; I thought OpenMP standard says _OPENMP macro should be defined if OpenMP is supported?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Yo@Taiwan&lt;/P&gt;</description>
    <pubDate>Sun, 20 Mar 2022 03:23:55 GMT</pubDate>
    <dc:creator>Yo_At_Taiwan</dc:creator>
    <dc:date>2022-03-20T03:23:55Z</dc:date>
    <item>
      <title>_OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1370312#M1976</link>
      <description>&lt;P&gt;I recently installed oneAPI DPC++ 2022.0.3 wiht Visual Studio 2022 and was trying to use OpenMP and its off-loading capability.&amp;nbsp; I have two issues:&lt;/P&gt;
&lt;P&gt;1. Why _OPENMP macro is not defined (even though OpenMP support is turned on)?&amp;nbsp; I thought OpenMP standard says _OPENMP macro should be defined if OpenMP is supported?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Yo@Taiwan&lt;/P&gt;</description>
      <pubDate>Sun, 20 Mar 2022 03:23:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1370312#M1976</guid>
      <dc:creator>Yo_At_Taiwan</dc:creator>
      <dc:date>2022-03-20T03:23:55Z</dc:date>
    </item>
    <item>
      <title>Re:_OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1370553#M1980</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting in Intel communities.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Mar 2022 11:54:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1370553#M1980</guid>
      <dc:creator>MadhuK_Intel</dc:creator>
      <dc:date>2022-03-21T11:54:51Z</dc:date>
    </item>
    <item>
      <title>Re:_OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1372377#M2009</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Mar 2022 10:27:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1372377#M2009</guid>
      <dc:creator>MadhuK_Intel</dc:creator>
      <dc:date>2022-03-28T10:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re:_OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1372502#M2011</link>
      <description>&lt;P&gt;The project file is attached.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 19:23:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1372502#M2011</guid>
      <dc:creator>Yo_At_Taiwan</dc:creator>
      <dc:date>2022-03-28T19:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: _OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1373113#M2014</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&amp;nbsp; Furthermore, if OpenMP offloading to Intel GPU option is turned on, the compilation fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yo@Taiwan&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2022 03:11:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1373113#M2014</guid>
      <dc:creator>Yo_At_Taiwan</dc:creator>
      <dc:date>2022-03-31T03:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: _OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1375451#M2034</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;T&lt;I&gt;he OpenMP option is enabled in the project properties, but the program would respond with "OpenMP not supported" because _OPENMP is not defined&lt;/I&gt;.&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OpenMPOutput.png" style="width: 610px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/28369i64FB6228268E01A7/image-dimensions/610x328?v=v2&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" width="610" height="328" role="button" title="OpenMPOutput.png" alt="OpenMPOutput.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please find the path for enabling the OpenMP, Project Properties--&amp;gt;DPC++--&amp;gt;Language--&amp;gt;OpenMP Support--&amp;gt;Select the "Generate Parallel Code (/Qiopenmp)" from the dropdown.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&lt;I&gt;OpenMP offloading to Intel GPU option is turned on, the compilation fails.&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;We are working on your issue internally, we will get back to you soon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Varsha&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 06:17:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1375451#M2034</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2022-04-08T06:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: _OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1380042#M2086</link>
      <description>&lt;P&gt;I'm seeing a similar issue on Linux. dpcpp fails to compile the following OpenMP code while icpx works.&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;#include &amp;lt;omp.h&amp;gt;
int main(void) {
#ifdef _OPENMP
  omp_get_max_threads();
  return 0;
#elif defined(__HIP_DEVICE_COMPILE__)
  return 0;
#else
  breaks_on_purpose
#endif
}&lt;/LI-CODE&gt;
&lt;P&gt;With icpx:&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;$ 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&lt;/LI-CODE&gt;
&lt;P&gt;With dpcpp:&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;$ 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.&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Apr 2022 11:01:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1380042#M2086</guid>
      <dc:creator>j-stephan</dc:creator>
      <dc:date>2022-04-27T11:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: _OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1424164#M2605</link>
      <description>&lt;P&gt;&lt;SPAN class="uiOutputText"&gt;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?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="uiOutputText"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class="cuf-url forceOutputURL" title="" href="https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-reference/compiler-options/offload-openmp-and-parallel-processing-options/fopenmp-targets-qopenmp-targets.html" target="_blank" rel="noopener noreferrer" data-value="https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-reference/compiler-options/offload-openmp-and-parallel-processing-options/fopenmp-targets-qopenmp-targets.html"&gt;https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-reference/compiler-options/offload-openmp-and-parallel-processing-options/fopenmp-targets-qopenmp-targets.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 21:40:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1424164#M2605</guid>
      <dc:creator>Ethan_F_Intel</dc:creator>
      <dc:date>2022-10-21T21:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: _OPENMP macro not defined?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1427119#M2624</link>
      <description>&lt;P&gt;&lt;SPAN class="TextRun SCXW247399121 BCX0" data-contrast="auto"&gt;&lt;SPAN class="NormalTextRun SCXW247399121 BCX0"&gt;Has your issue been resolved? If I don't hear from you within 5 business days, I will assume your support request is resolved. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 18:31:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/OPENMP-macro-not-defined/m-p/1427119#M2624</guid>
      <dc:creator>Ethan_F_Intel</dc:creator>
      <dc:date>2022-11-02T18:31:20Z</dc:date>
    </item>
  </channel>
</rss>

