<?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:DPCPP Generate bswap in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351519#M1831</link>
    <description>&lt;P&gt;Thank you for reporting this problem to us. This is a known issue and will be fixed in the next update.&lt;/P&gt;&lt;P&gt;Can we close this thread for now?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 14 Jan 2022 15:38:28 GMT</pubDate>
    <dc:creator>Viet_H_Intel</dc:creator>
    <dc:date>2022-01-14T15:38:28Z</dc:date>
    <item>
      <title>DPCPP Generates bswap.i64</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1349088#M1813</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;When compiling the following byte swap (with x a 64 bit unsigned):&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;   ((x &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;0xff00000000000000ULL&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;56&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;0x00ff000000000000ULL&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;40&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;0x0000ff0000000000ULL&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;24&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;0x000000ff00000000ULL&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;0x0000000000ff0000ULL&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;24&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;0x000000000000ff00ULL&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;40&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;0x00000000000000ffULL&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;56&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;DPCPP (llvm-spirv) fails with:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;InvalidFunctionCall: Unexpected llvm intrinsic:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;llvm.bswap.i64&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;The version of DPCPP is&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;2022.0.0 (2022.0.0.20211123). It happens when compiling SYCL kernels for spir64 as well as when I use AOT.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The upstream version of the open source &lt;SPAN&gt;oneAPI&lt;/SPAN&gt;&amp;nbsp;compiles the code fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use&amp;nbsp;&lt;SPAN&gt;Intel(R) oneAPI&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;you can "defeat" the optimiser by replacing the `|` by `+` (which is still correct as the bits do not overlap) and it compiles (but is not optimal haha) .&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;Best,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;Michel&lt;/SPAN&gt;&lt;/SPAN&gt;&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>Thu, 06 Jan 2022 17:48:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1349088#M1813</guid>
      <dc:creator>Michoumichmich</dc:creator>
      <dc:date>2022-01-06T17:48:03Z</dc:date>
    </item>
    <item>
      <title>Re:DPCPP Generate bswap</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1349377#M1814</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;Could you please provide the sample reproducer code and steps to reproduce the issue at our end?&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;Hemanth.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Jan 2022 10:49:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1349377#M1814</guid>
      <dc:creator>HemanthCH_Intel</dc:creator>
      <dc:date>2022-01-07T10:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: DPCPP Generates bswap.i64</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1349954#M1817</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may compile the following:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;static inline uint64_t bswap(uint64_t x){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; return &lt;BR /&gt;   ((x &amp;amp; 0xff00000000000000ULL) &amp;gt;&amp;gt; 56)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; 0x00ff000000000000ULL) &amp;gt;&amp;gt; 40)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; 0x0000ff0000000000ULL) &amp;gt;&amp;gt; 24)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; 0x000000ff00000000ULL) &amp;gt;&amp;gt; 8 )&lt;LI-EMOJI id="lia_smiling-face-with-sunglasses" title=":smiling_face_with_sunglasses:"&gt;&lt;/LI-EMOJI&gt; &lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; 0x0000000000ff0000ULL) &amp;lt;&amp;lt; 24)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; 0x000000000000ff00ULL) &amp;lt;&amp;lt; 40)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; | ((x &amp;amp; 0x00000000000000ffULL) &amp;lt;&amp;lt; 56);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int main(){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; sycl::queue q{};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; auto ptr = sycl::malloc_device&amp;lt;uint64_t&amp;gt;(1, q);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; q.single_task([=](){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;     *ptr = bswap(*ptr);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }).wait();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;With the flags `dpcpp -fsycl -O3`. On Intel(R) DevCloud it crashes with the error I mentioned previously too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michel&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 10:43:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1349954#M1817</guid>
      <dc:creator>Michoumichmich</dc:creator>
      <dc:date>2022-01-10T10:43:40Z</dc:date>
    </item>
    <item>
      <title>Re:DPCPP Generate bswap</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351482#M1830</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are able to able to reproduce your issue at our end and&amp;nbsp;working on this 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;Hemanth.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Jan 2022 12:19:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351482#M1830</guid>
      <dc:creator>HemanthCH_Intel</dc:creator>
      <dc:date>2022-01-14T12:19:24Z</dc:date>
    </item>
    <item>
      <title>Re:DPCPP Generate bswap</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351519#M1831</link>
      <description>&lt;P&gt;Thank you for reporting this problem to us. This is a known issue and will be fixed in the next update.&lt;/P&gt;&lt;P&gt;Can we close this thread for now?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Jan 2022 15:38:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351519#M1831</guid>
      <dc:creator>Viet_H_Intel</dc:creator>
      <dc:date>2022-01-14T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re:DPCPP Generate bswap</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351530#M1832</link>
      <description>&lt;P&gt;Thanks for accepting this as a solution. This thread is now closed and won't be monitored by Intel. If you need anything else, please create a new thread.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Jan 2022 16:02:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351530#M1832</guid>
      <dc:creator>Viet_H_Intel</dc:creator>
      <dc:date>2022-01-14T16:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: DPCPP Generates bswap.i64</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351531#M1833</link>
      <description>&lt;P&gt;Okay, thanks for looking into this and have a nice day!&lt;/P&gt;
&lt;P&gt;Best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 16:04:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-Generates-bswap-i64/m-p/1351531#M1833</guid>
      <dc:creator>Michoumichmich</dc:creator>
      <dc:date>2022-01-14T16:04:08Z</dc:date>
    </item>
  </channel>
</rss>

