<?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 Re: Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0 in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426732#M2620</link>
    <description>&lt;P&gt;Thanks very much this resolves the issue.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Nov 2022 10:55:42 GMT</pubDate>
    <dc:creator>Ian_Chivers</dc:creator>
    <dc:date>2022-11-01T10:55:42Z</dc:date>
    <item>
      <title>Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426214#M2616</link>
      <description>&lt;P&gt;I have a couple of C++ 11 &amp;lt;array&amp;gt; examples that compile and run successfully with the Intel classic C++ compiler (2021.7.0) on Windows, and compile and terminate without generating any output using DPC++&amp;nbsp; 2022.2.0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has anyone else had problems moving their C++ code to use the new DPC++ compiler with the &amp;lt;array&amp;gt; class?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't attach all of the source files, I get the following error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The attachment's ch3802.cpp content type (text/plain) does not match its file extension and has been removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Oct 2022 16:30:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426214#M2616</guid>
      <dc:creator>Ian_Chivers</dc:creator>
      <dc:date>2022-10-30T16:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426217#M2617</link>
      <description>&lt;P&gt;I tried the print_time.cpp with no problems, and re-reading post I realize I need the array use?&lt;/P&gt;</description>
      <pubDate>Sun, 30 Oct 2022 16:55:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426217#M2617</guid>
      <dc:creator>MWind2</dc:creator>
      <dc:date>2022-10-30T16:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426368#M2618</link>
      <description>&lt;P&gt;Apologies for the incomplete post. It looks like a stack problem on Windows. This is the classic compile command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;icl /EHsc /nologo /F0xffffffff /O2 /Qstd=c++20 ch3802.cxx -o ch3802_intel_classic.exe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and this generates an executable that runs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C:\document\cpp\examples&amp;gt;ch3802_intel_classic.exe&lt;BR /&gt;Program starts : 0.000002&lt;/P&gt;
&lt;P&gt;C++ 11 &amp;lt;array&amp;gt;&lt;/P&gt;
&lt;P&gt;134217728&lt;BR /&gt;1073741824 bytes&lt;BR /&gt;Random numbers : 0.781101&lt;BR /&gt;STL sort - &amp;lt;array&amp;gt; : 13.513962&lt;BR /&gt;Total time : 14.298434&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the dp c++ compiler command line, with messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C:\document\cpp\examples&amp;gt;icx /EHsc /nologo /F 0xffffffff /O2 /Qstd=c++20 ch3802.cxx -o ch3802_intel_new.exe&lt;BR /&gt;icx: warning: argument unused during compilation: '-F 0xffffffff' [-Wunused-command-line-argument]&lt;/P&gt;
&lt;P&gt;C:\document\cpp\examples&amp;gt;ch3802_intel_new.exe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No output or error message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the required files. I can't attach them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;timer.cpp&lt;/P&gt;
&lt;P&gt;#######&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;chrono&amp;gt;&lt;/P&gt;
&lt;P&gt;using namespace std;&lt;/P&gt;
&lt;P&gt;class timer&lt;BR /&gt;{&lt;BR /&gt;public:&lt;BR /&gt;timer() : start_timing(hi_res_clock::now()) {}&lt;BR /&gt;void reset()&lt;BR /&gt;{&lt;BR /&gt;start_timing = hi_res_clock::now();&lt;BR /&gt;}&lt;BR /&gt;double elapsed() const&lt;BR /&gt;{&lt;BR /&gt;return(std::chrono::duration_cast&amp;lt;second_&amp;gt;&lt;BR /&gt;(hi_res_clock::now() - start_timing).count());&lt;BR /&gt;}&lt;BR /&gt;private:&lt;BR /&gt;typedef std::chrono::high_resolution_clock hi_res_clock;&lt;BR /&gt;typedef std::chrono::duration&amp;lt;double, std::ratio&amp;lt;1&amp;gt; &amp;gt;&lt;BR /&gt;second_;&lt;BR /&gt;std::chrono::time_point&amp;lt;hi_res_clock&amp;gt; start_timing;&lt;BR /&gt;};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Main driving program&lt;/P&gt;
&lt;P&gt;#################&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#include &amp;lt;iostream&amp;gt;&lt;BR /&gt;#include &amp;lt;algorithm&amp;gt;&lt;BR /&gt;#include &amp;lt;array&amp;gt;&lt;BR /&gt;#include &amp;lt;random&amp;gt;&lt;BR /&gt;#include &amp;lt;string&amp;gt;&lt;BR /&gt;#include &amp;lt;chrono&amp;gt;&lt;/P&gt;
&lt;P&gt;using namespace std;&lt;/P&gt;
&lt;P&gt;#include "timer.cxx"&lt;BR /&gt;#include "print_time.cxx"&lt;/P&gt;
&lt;P&gt;// #include "swap.cxx"&lt;BR /&gt;// #include "quicksort.cxx"&lt;BR /&gt;// #include "print_10.cxx"&lt;/P&gt;
&lt;P&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();&lt;BR /&gt;default_random_engine engine_01(seed);&lt;BR /&gt;uniform_real_distribution&amp;lt;double&amp;gt; distribution_01(0.0, 1.0);&lt;/P&gt;
&lt;P&gt;string heading;&lt;BR /&gt;double t;&lt;BR /&gt;timer timer_01;&lt;BR /&gt;timer timer_02;&lt;/P&gt;
&lt;P&gt;heading = "Program starts";&lt;BR /&gt;t = timer_01.elapsed();&lt;BR /&gt;print_time(heading, t);&lt;BR /&gt;timer_01.reset();&lt;/P&gt;
&lt;P&gt;// Size&lt;/P&gt;
&lt;P&gt;const int mega_byte = 1024 * 1024;&lt;BR /&gt;const int array_size = 128 * mega_byte;&lt;/P&gt;
&lt;P&gt;int i;&lt;/P&gt;
&lt;P&gt;array&amp;lt;double, array_size&amp;gt; x;&lt;/P&gt;
&lt;P&gt;cout &amp;lt;&amp;lt; "\n C++ 11 &amp;lt;array&amp;gt; \n" &amp;lt;&amp;lt; endl;&lt;/P&gt;
&lt;P&gt;cout.width(16);&lt;BR /&gt;cout &amp;lt;&amp;lt; array_size &amp;lt;&amp;lt; endl;&lt;BR /&gt;cout.width(16);&lt;BR /&gt;cout &amp;lt;&amp;lt; (array_size * 8);&lt;BR /&gt;cout &amp;lt;&amp;lt; " bytes " &amp;lt;&amp;lt; endl;&lt;/P&gt;
&lt;P&gt;for (i = 0; i &amp;lt; array_size; i++)&lt;BR /&gt;x[i] = distribution_01(engine_01);&lt;/P&gt;
&lt;P&gt;heading = "Random numbers";&lt;/P&gt;
&lt;P&gt;t = timer_01.elapsed();&lt;BR /&gt;print_time(heading, t);&lt;BR /&gt;timer_01.reset();&lt;/P&gt;
&lt;P&gt;sort(x.begin(), x.end());&lt;/P&gt;
&lt;P&gt;heading = "STL sort - &amp;lt;array&amp;gt; ";&lt;/P&gt;
&lt;P&gt;t = timer_01.elapsed();&lt;BR /&gt;print_time(heading, t);&lt;BR /&gt;timer_01.reset();&lt;/P&gt;
&lt;P&gt;heading = "Total time";&lt;BR /&gt;t = timer_02.elapsed();&lt;BR /&gt;print_time(heading, t);&lt;/P&gt;
&lt;P&gt;return(0);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;############################&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The print_time source file is in the original post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am in the process of trying to find any compiler switches&lt;/P&gt;
&lt;P&gt;that will set the stack size under windows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 09:10:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426368#M2618</guid>
      <dc:creator>Ian_Chivers</dc:creator>
      <dc:date>2022-10-31T09:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426661#M2619</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting in the Intel forums.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We were able to reproduce the issue from our end. The issue is with the hexadecimal value being used with the /F option. The use of the hexadecimal value is not being parsed. You can try passing the equivalent integer value which would work fine.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;icx&amp;nbsp;/nologo /O2&amp;nbsp;main.cpp -o main_icx.exe &lt;STRONG&gt;/F4294967295&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SantoshY_Intel_0-1667279342581.png" style="width: 500px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/34731iABEA5478AACE49A4/image-dimensions/500x185?v=v2&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" width="500" height="185" role="button" title="SantoshY_Intel_0-1667279342581.png" alt="SantoshY_Intel_0-1667279342581.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;workaround to pass hexadecimal values:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;We can use the option: /link -stack:0xffffffff&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;icx&amp;nbsp;/nologo /O2&amp;nbsp;main.cpp -o main_icx.exe &lt;STRONG&gt;/link -stack:0xffffffff&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SantoshY_Intel_1-1667279395721.png" style="width: 506px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/34732i26D9CAEFE7E8C145/image-dimensions/506x148?v=v2&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" width="506" height="148" role="button" title="SantoshY_Intel_1-1667279395721.png" alt="SantoshY_Intel_1-1667279395721.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this resolves your issue, make sure to accept this as a solution. This would help others with similar issues. Thank you!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Santosh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 05:10:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426661#M2619</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2022-11-01T05:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426732#M2620</link>
      <description>&lt;P&gt;Thanks very much this resolves the issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 10:55:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426732#M2620</guid>
      <dc:creator>Ian_Chivers</dc:creator>
      <dc:date>2022-11-01T10:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426747#M2621</link>
      <description>&lt;P&gt;Apologies for 'claiming' the solution. I can't find a way to undo that.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 13:31:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426747#M2621</guid>
      <dc:creator>Ian_Chivers</dc:creator>
      <dc:date>2022-11-01T13:31:51Z</dc:date>
    </item>
    <item>
      <title>Re:Example compiles and runs with C++ 2021.7.0 and aborts with DPC++  2022.2.0</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426977#M2622</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Nov 2022 05:21:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Example-compiles-and-runs-with-C-2021-7-0-and-aborts-with-DPC/m-p/1426977#M2622</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2022-11-02T05:21:44Z</dc:date>
    </item>
  </channel>
</rss>

