<?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 hi @Alexey Bader in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141363#M5898</link>
    <description>&lt;P&gt;hi @Alexey Bader&lt;/P&gt;

&lt;P&gt;Thanks for the reply/&lt;/P&gt;

&lt;P&gt;I did see the specification for the conversion rules. I was just wondering why Intel would implement it like that. Is it documented somewhere?&lt;/P&gt;

&lt;P&gt;Based on the premise that OpenCL should conform to functional correctness across different platforms, Isn't this behaviour a bug?&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;uttam&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2017 15:01:22 GMT</pubDate>
    <dc:creator>uttam_k_</dc:creator>
    <dc:date>2017-07-06T15:01:22Z</dc:date>
    <item>
      <title>Opencl implementation of convert_char()</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141361#M5896</link>
      <description>&lt;P&gt;I am using Intel core i7 6820HQ CPU and integrated graphics 530 to run an opencl application.&lt;/P&gt;

&lt;P&gt;When I perform convert_char() on overflowed results, I get different results in CPU and GPU.&lt;/P&gt;

&lt;P&gt;E.g convert_char(271.125) on CPU overflows and rounds up whereas in GPU it clamps to 255. ofcourse by doing convert_char_sat() i got the right results on both platforms.&lt;/P&gt;

&lt;P&gt;But can someone explain why it works differently on different platforms?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 09:53:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141361#M5896</guid>
      <dc:creator>uttam_k_</dc:creator>
      <dc:date>2017-07-06T09:53:37Z</dc:date>
    </item>
    <item>
      <title>Because the implementations</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141362#M5897</link>
      <description>&lt;P&gt;Because the implementations for CPU and GPU are different and OpenCL specification doesn't specify the &lt;SPAN style="font-size: 13.008px;"&gt;behavior. Here is the quote from the spec:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN class="fontstyle0"&gt;6.2.3.3 Out-of-Range Behavior and Saturated Conversions&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN class="fontstyle2"&gt;When the conversion operand is either greater than the greatest representable destination value or&lt;BR /&gt;
	less than the least representable destination value, it is said to be out-of-range. The result of outof-range conversion is determined by the conversion rules specified by the C99 specification in&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN class="fontstyle3"&gt;section 6.3&lt;/SPAN&gt;&lt;SPAN class="fontstyle2"&gt;. &lt;STRONG&gt;When converting from a floating-point type to integer type, the behavior is&lt;BR /&gt;
	implementation-defined.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 13:44:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141362#M5897</guid>
      <dc:creator>Alexey_B_Intel1</dc:creator>
      <dc:date>2017-07-06T13:44:10Z</dc:date>
    </item>
    <item>
      <title>hi @Alexey Bader</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141363#M5898</link>
      <description>&lt;P&gt;hi @Alexey Bader&lt;/P&gt;

&lt;P&gt;Thanks for the reply/&lt;/P&gt;

&lt;P&gt;I did see the specification for the conversion rules. I was just wondering why Intel would implement it like that. Is it documented somewhere?&lt;/P&gt;

&lt;P&gt;Based on the premise that OpenCL should conform to functional correctness across different platforms, Isn't this behaviour a bug?&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;uttam&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 15:01:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141363#M5898</guid>
      <dc:creator>uttam_k_</dc:creator>
      <dc:date>2017-07-06T15:01:22Z</dc:date>
    </item>
    <item>
      <title>Hi uttam,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141364#M5899</link>
      <description>&lt;P&gt;Hi uttam,&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;&lt;SPAN style="font-size: 1em;"&gt;To get bitwise matching results from different OpenCL devices I would avoid using features that are mentioned by OpenCL specification as "implementation defined" or "undefined behaviour". Typically "implementation defined" operations implemented differently by different HW i.e. implementation on CPU and GPU devices of the same "implementation defined" feature might be different.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;If your algorithm cares about results of conversion from float to int with overflow, you shouldn't use convert_char built-in function.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Thanks,&lt;BR /&gt;
	Alexey&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:58:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Opencl-implementation-of-convert-char/m-p/1141364#M5899</guid>
      <dc:creator>Alexey_B_Intel1</dc:creator>
      <dc:date>2017-07-06T18:58:59Z</dc:date>
    </item>
  </channel>
</rss>

