<?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: Question about a warning “warning: reduction.hpp:2814:0:” in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Question-about-a-warning-warning-reduction-hpp-2814-0/m-p/1617106#M3975</link>
    <description>&lt;P&gt;Please provide a runnable reproducer and the exact commands used to demonstrate you issue.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jul 2024 18:25:02 GMT</pubDate>
    <dc:creator>Alex_Y_Intel</dc:creator>
    <dc:date>2024-07-22T18:25:02Z</dc:date>
    <item>
      <title>Question about a warning “warning: reduction.hpp:2814:0:”</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Question-about-a-warning-warning-reduction-hpp-2814-0/m-p/1616710#M3965</link>
      <description>&lt;P&gt;Hi, I'm new to Intel DPC++ programming,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently I just received the warning:&lt;/P&gt;&lt;P&gt;warning: reduction.hpp:2814:0: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering&lt;/P&gt;&lt;P&gt;I'm just wondering the cause of this warning? Is this due to the parallel_for with reduction object in my code?&lt;/P&gt;&lt;P&gt;I'm using the Intel DPC++ compiler 2024.2. There are multiple parallel reductions in my code,&lt;/P&gt;&lt;P&gt;one of them as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;sycl::buffer buf_Nd_coords(Nd_coords_cref);&lt;/DIV&gt;&lt;DIV&gt;sycl::buffer buf_tet4_enTags_Vi(Vents_cref[i].Get_ALLtet4_enTags_cref());&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;sycl::buffer&amp;lt;float&amp;gt; buf_xlen_sumVi(&amp;amp;xlen_sumVi, 1);&lt;/DIV&gt;&lt;DIV&gt;sycl::buffer&amp;lt;float&amp;gt; buf_ylen_sumVi(&amp;amp;ylen_sumVi, 1);&lt;/DIV&gt;&lt;DIV&gt;sycl::buffer&amp;lt;float&amp;gt; buf_zlen_sumVi(&amp;amp;zlen_sumVi, 1);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Q.submit([&amp;amp;](sycl::handler&amp;amp; cgh) { //command group lambda&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::range&amp;lt;1&amp;gt; tot_workers(num_of_wkgrps * wkgrp_sz);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::range&amp;lt;1&amp;gt; workers_in_grp(wkgrp_sz);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::nd_range&amp;lt;1&amp;gt; nd_rg(tot_workers, workers_in_grp);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::accessor acc_Nd_coords(buf_Nd_coords, cgh, sycl::read_only);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::accessor acc_tet4_enTags_Vi(buf_tet4_enTags_Vi, cgh,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::read_only);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;auto Ruc_xlen_sumVi = sycl::reduction(buf_xlen_sumVi, cgh,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::plus&amp;lt;&amp;gt;());&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;auto Ruc_ylen_sumVi = sycl::reduction(buf_ylen_sumVi, cgh,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::plus&amp;lt;&amp;gt;());&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;auto Ruc_zlen_sumVi = sycl::reduction(buf_zlen_sumVi, cgh,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::plus&amp;lt;&amp;gt;());&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;cgh.parallel_for(nd_rg, Ruc_xlen_sumVi, Ruc_ylen_sumVi,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Ruc_zlen_sumVi,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[=](sycl::nd_item&amp;lt;1&amp;gt; it,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;auto&amp;amp; reducer_xlen_sumVi,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;auto&amp;amp; reducer_ylen_sumVi,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;auto&amp;amp; reducer_zlen_sumVi) { //kernel lambda&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//Distribute total work to current work group&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;uint_t wkgrp_st, wkgrp_end;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PC::dpcpp_common::Distribute_range_to_wkgrps(wkgrp_st,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;wkgrp_end, it.get_group_linear_id(), num_of_wkgrps,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;num_tet4_Vi);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//partial sum for an individual worker thread&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;float partial_xlen_sum_thd = 0.f;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;float partial_ylen_sum_thd = 0.f;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;float partial_zlen_sum_thd = 0.f;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for (uint_t idx = wkgrp_st + it.get_local_linear_id();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;idx &amp;lt; wkgrp_end; idx +=it.get_local_range(0)) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const tet4_enTags&amp;amp; tet4_elm = acc_tet4_enTags_Vi[idx];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tet4_cont tet4c(tet4_elm, 0, 0);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tet4_Ndcoords XI;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tet4c.Fetch_Nd_coords(acc_Nd_coords, XI);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sycl::float3 contBx_sz_tet4_i;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;tet4c.Get_contBox_sz(contBx_sz_tet4_i, XI);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//accumulate partial sum of current thread&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;partial_xlen_sum_thd += contBx_sz_tet4_i[0];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;partial_ylen_sum_thd += contBx_sz_tet4_i[1];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;partial_zlen_sum_thd += contBx_sz_tet4_i[2];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;reducer_xlen_sumVi.combine(partial_xlen_sum_thd);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;reducer_ylen_sumVi.combine(partial_ylen_sum_thd);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;reducer_zlen_sumVi.combine(partial_zlen_sum_thd);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} //end of kernel lambda&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;); //end of handler::parallel_for&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} //end of cgh lambda&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;); //end of queue::submit&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Q.wait_and_throw();&amp;nbsp;&lt;/DIV&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>Sun, 21 Jul 2024 07:48:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Question-about-a-warning-warning-reduction-hpp-2814-0/m-p/1616710#M3965</guid>
      <dc:creator>PC-1</dc:creator>
      <dc:date>2024-07-21T07:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Question about a warning “warning: reduction.hpp:2814:0:”</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Question-about-a-warning-warning-reduction-hpp-2814-0/m-p/1617106#M3975</link>
      <description>&lt;P&gt;Please provide a runnable reproducer and the exact commands used to demonstrate you issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 18:25:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Question-about-a-warning-warning-reduction-hpp-2814-0/m-p/1617106#M3975</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2024-07-22T18:25:02Z</dc:date>
    </item>
  </channel>
</rss>

