<?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>OpenCL* for CPUのトピックHello,</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105293#M5201</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;In case binary is compiled as 64-bit , then size_t type is 8 bytes long.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Therefore implicit cast to unsigned int would cause overflow in some cases.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Additionally basing on the error message, compiler doesn't know how to handle input parameters of size_t.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/mad24.html" target="_blank"&gt;https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/mad24.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;mad24 doesn't accept size_t as gentype.&lt;/P&gt;

&lt;P&gt;By doing explicit cast compiler knows what is the gentype and can find proper function to handle mad24 operation.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2017 20:18:51 GMT</pubDate>
    <dc:creator>Michal_M_Intel</dc:creator>
    <dc:date>2017-02-27T20:18:51Z</dc:date>
    <item>
      <title>OpenCL compiler doesn't implicitly convert size_t to unsigned</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105292#M5200</link>
      <description>&lt;P&gt;At least on mad24(get_global_id(1), get_global_size(0), get_global_id(1)) compiler gives this so I have to explicitly conver all of the size_t to unsigned.&amp;nbsp; At least on AMD GPUs the code compiles fine without explicit casting.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    line 347: error: more
          than one instance of overloaded function "mad24" matches the
          argument list:
            function "mad24(int, int, int) C++"
            function "mad24(int2, int2, int2) C++"
            function "mad24(int3, int3, int3) C++"
            function "mad24(int4, int4, int4) C++"
            function "mad24(int8, int8, int8) C++"
            function "mad24(int16, int16, int16) C++"
            function "mad24(uint, uint, uint) C++"
            function "mad24(uint2, uint2, uint2) C++"
            function "mad24(uint3, uint3, uint3) C++"
            function "mad24(uint4, uint4, uint4) C++"
            function "mad24(uint8, uint8, uint8) C++"
            function "mad24(uint16, uint16, uint16) C++"
            argument types are: (size_t, size_t, size_t)
    out[mad24(get_global_id(1), get_global_size(0), get_global_id(1))] = value;
        ^
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 12:12:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105292#M5200</guid>
      <dc:creator>Joose_S_</dc:creator>
      <dc:date>2017-02-27T12:12:09Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105293#M5201</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;In case binary is compiled as 64-bit , then size_t type is 8 bytes long.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Therefore implicit cast to unsigned int would cause overflow in some cases.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Additionally basing on the error message, compiler doesn't know how to handle input parameters of size_t.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/mad24.html" target="_blank"&gt;https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/mad24.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;mad24 doesn't accept size_t as gentype.&lt;/P&gt;

&lt;P&gt;By doing explicit cast compiler knows what is the gentype and can find proper function to handle mad24 operation.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 20:18:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105293#M5201</guid>
      <dc:creator>Michal_M_Intel</dc:creator>
      <dc:date>2017-02-27T20:18:51Z</dc:date>
    </item>
    <item>
      <title>Yes but mul24 expects the</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105294#M5202</link>
      <description>&lt;P&gt;Yes but mad24 expects the values to be 24 bits anyways so it doesn't matter wether the value is 64 bit unsigned or 32 bit unsigned&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 20:52:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105294#M5202</guid>
      <dc:creator>Joose_S_</dc:creator>
      <dc:date>2017-02-27T20:52:00Z</dc:date>
    </item>
    <item>
      <title>I suspect on the devices</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105295#M5203</link>
      <description>&lt;P&gt;I suspect on the devices where your kernel works size_t is a 32-bit type.&amp;nbsp; I see errors consistently across other OpenCL implementations when mad24() is used with 64-bit types.&amp;nbsp; Could you try the following kernel as an experiment?&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;__kernel void foo( __global ulong* dst )
{
    uint  ui32 = (uint)get_global_id(0);
    ulong ui64 = get_global_id(0);
    dst[0] = mad24( ui32, ui32, ui32 );    // ok
    dst[1] = mad24( ui64, ui64, ui64 );    // error
}
&lt;/PRE&gt;

&lt;P&gt;Because mad24() is defined only for 32-bit types, and there is no implicit conversion between 64-bit types and 32-bit types in C99 (see section 6.5 in the C99 spec) all OpenCL compilers should report an error for this kernel.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 17:36:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105295#M5203</guid>
      <dc:creator>Ben_A_Intel</dc:creator>
      <dc:date>2017-03-03T17:36:47Z</dc:date>
    </item>
    <item>
      <title>You are actually correct.</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105296#M5204</link>
      <description>&lt;P&gt;You are actually correct. When I compile a 64-bit build on AMD it also fails. Sorry about the trouble.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 07:29:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/OpenCL-compiler-doesn-t-implicitly-convert-size-t-to-unsigned/m-p/1105296#M5204</guid>
      <dc:creator>Joose_S_</dc:creator>
      <dc:date>2017-03-06T07:29:32Z</dc:date>
    </item>
  </channel>
</rss>

