<?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: Re:DPC++ implementation on CPU is faster than C++ implementation on CPU in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1374282#M2025</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intel oneAPI version 2022&lt;/P&gt;
&lt;P&gt;IDE: Microsoft Visual Studio 2019.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the complete project solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2022 02:03:05 GMT</pubDate>
    <dc:creator>student4</dc:creator>
    <dc:date>2022-04-05T02:03:05Z</dc:date>
    <item>
      <title>DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1373957#M2020</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Shown below is the code snippet of my program implemented using openmp parallel_for and using SYCL libraries(offload platform: CPU)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Case 1: Parallelization using openmp (standard cpp codes)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;#pragma omp parallel for&lt;BR /&gt;for (int i = 0; i &amp;lt; loopCount; i++)&lt;BR /&gt;{&lt;BR /&gt;for (int m = 0; m &amp;lt; Len; m++)&lt;BR /&gt;{&lt;BR /&gt;OutputParallel[i] += testData[i + m] * Coeff[m];&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;case 2: Using DPC++ libraries; targets CPU&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;// buffer declaration&lt;BR /&gt;sycl::buffer testBuffx64(testData);&lt;BR /&gt;sycl::bufferBuffx64(Coeff);&lt;BR /&gt;sycl::buffer convBuffx64(Outputx64Oneapi);&lt;BR /&gt;t4 = std::chrono::high_resolution_clock::now();&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;cl::sycl::queue Q(sycl::cpu_selector{}); // device for computation offload&lt;/P&gt;
&lt;P&gt;Q.submit([&amp;amp;](sycl::handler&amp;amp; h) &lt;BR /&gt;{&lt;BR /&gt;// accessor declaration&lt;BR /&gt;sycl::accessor testAccess(testBuffx64, h, sycl::read_only);&lt;BR /&gt;sycl::accessor Access(Buffx64, h, sycl::read_only);&lt;BR /&gt;sycl::accessor cAccess(convBuffx64, h, sycl::read_write);&lt;BR /&gt;h.parallel_for(sycl::range{ loopCount }, [=](sycl::id&amp;lt;1&amp;gt; idx) {&lt;BR /&gt;for (int m = 0; m &amp;lt; filterLen; m++)&lt;BR /&gt;{&lt;BR /&gt;cAccess[idx] += testAccess[idx + m] * Access[m];&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;Q.wait_and_throw();&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;catch (sycl::exception const&amp;amp; e)&lt;BR /&gt;{&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "Caught a SYCL host exception for x64:\n" &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; "\n";&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The throughput of case 2 is higher than case 1 although both are implemented on CPU.&lt;BR /&gt;Is there a reason why the DPC++ implementation is faster?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 04:06:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1373957#M2020</guid>
      <dc:creator>student4</dc:creator>
      <dc:date>2022-04-04T04:06:56Z</dc:date>
    </item>
    <item>
      <title>Re:DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1374061#M2023</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for posting in Intel Communities.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please provide us with the Environment details and Intel OneAPI version you are using?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;I&gt;the DPC++ implementation is faster?&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Could you please let us know how are you calculating the time? Are you using any specific tool to calculate the time?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you please provide us the results(difference in time) you are getting while running the two cases(openmp code and dpcpp code)?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;And also, could you please provide us with the complete sample reproducer code and the compiler you are using to run the openmp code(case 1)?&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;Varsha&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Apr 2022 12:08:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1374061#M2023</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2022-04-04T12:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Re:DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1374282#M2025</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intel oneAPI version 2022&lt;/P&gt;
&lt;P&gt;IDE: Microsoft Visual Studio 2019.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the complete project solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 02:03:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1374282#M2025</guid>
      <dc:creator>student4</dc:creator>
      <dc:date>2022-04-05T02:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Re:DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1376111#M2039</link>
      <description>&lt;P&gt;Please let me know if you need any other information&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 10:07:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1376111#M2039</guid>
      <dc:creator>student4</dc:creator>
      <dc:date>2022-04-11T10:07:18Z</dc:date>
    </item>
    <item>
      <title>Re:DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1376849#M2045</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&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;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Varsha&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Apr 2022 12:27:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1376849#M2045</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2022-04-13T12:27:09Z</dc:date>
    </item>
    <item>
      <title>Re:DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1378019#M2050</link>
      <description>&lt;P&gt;What's the command line option you used when building the C++/DPC++ code? could you show the "icx or dpcpp --version"?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Apr 2022 04:07:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1378019#M2050</guid>
      <dc:creator>Jie_L_Intel</dc:creator>
      <dc:date>2022-04-19T04:07:50Z</dc:date>
    </item>
    <item>
      <title>Re:DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1379740#M2074</link>
      <description>&lt;P&gt;i do not see DPC++ is faster.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;C:\osc05423107&amp;gt;dpcpp -g /EHsc -fiopenmp -fsycl-targets=spir64_x86_64 Filter.cpp&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;C:\osc05423107&amp;gt;Filter.exe&lt;/P&gt;&lt;P&gt;implementation is correct&lt;/P&gt;&lt;P&gt;Throughput for serial implementation:0.0172098&lt;/P&gt;&lt;P&gt;Throughput for parallel implementation:0.0333564&lt;/P&gt;&lt;P&gt;Throughput for oneAPI x64 implementation:1.9899&lt;/P&gt;&lt;P&gt;Throughput for oneAPI FPGA implementation:inf&lt;/P&gt;&lt;P&gt;success&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Apr 2022 07:46:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1379740#M2074</guid>
      <dc:creator>Jie_L_Intel</dc:creator>
      <dc:date>2022-04-26T07:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: DPC++ implementation on CPU is faster than C++ implementation on CPU</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1381378#M2100</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'&lt;SPAN&gt;Throughput for oneAPI x64 implementation:&lt;/SPAN&gt;' is the DPC++ implementation which refers to the device code offloaded to x64 platform.&lt;/P&gt;
&lt;P&gt;Even in your case you can see that DPC++ implementation is faster than C++ implementation with openmp parallelization(&lt;SPAN&gt;Throughput for parallel implementation&lt;/SPAN&gt;).&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 05:36:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPC-implementation-on-CPU-is-faster-than-C-implementation-on-CPU/m-p/1381378#M2100</guid>
      <dc:creator>student4</dc:creator>
      <dc:date>2022-05-03T05:36:39Z</dc:date>
    </item>
  </channel>
</rss>

