<?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 Native binaries are not in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004370#M2927</link>
    <description>&lt;P&gt;Native binaries are not generally portable between generations of the graphics architecture. If you are targeting 3rd gen (Ivy Bridge), 4th gen (Haswell) and 5th gen (Broadwell) chips, you should build native binaries on those platforms. I asked our compiler team to enable building binaries for different architectures using a single machine, and they are working on this, but it will take some time. In general, I would advise not to distribute native binaries to the end users. It is better to either distribute source, possibly in encrypted fashion, build it into binary on the first invocation of the program, and then continue with that binary (if the user updates the driver, you are safer if you discard the hashed binary and rebuild your program) or use SPIR binary, where available.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2015 17:06:26 GMT</pubDate>
    <dc:creator>Robert_I_Intel</dc:creator>
    <dc:date>2015-04-01T17:06:26Z</dc:date>
    <item>
      <title>Create kernels from pre-compiled .ir</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004367#M2924</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a question regarding the creation of kernels from pre-compiled .ir files.&lt;/P&gt;

&lt;P&gt;I create a .ir using&amp;nbsp;&lt;SPAN style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;ioc32 –cmd=compile –input=kernel.cl&lt;/SPAN&gt;&lt;A href="http://kernel_name.cl/" style="font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal; color: rgb(17, 85, 204);" target="_blank"&gt;l&lt;/A&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;&amp;nbsp;–device=GPU –ir=&lt;/SPAN&gt;&lt;A href="http://kernel_name.ir/" style="font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal; color: rgb(17, 85, 204);" target="_blank"&gt;k&lt;/A&gt;ernel.or&lt;/P&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;In my code I:&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;a) Load the .ir from file&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;b) Create a clProgram &lt;SPAN style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;clCreateProgramWithBinary with my binary (&lt;/SPAN&gt;clBuildProgram(my cl_program 1, &amp;amp;my_cldevice, NULL, NULL, NULL))&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;c) Call clBuildProgram with the clProgram created from above.&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;b) and c) complete with no error&amp;nbsp;&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;However when I call&amp;nbsp;&lt;SPAN style="font-size: 12.8000001907349px;"&gt;clCreateKernel a&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(54, 49, 45); font-family: Enriqueta, georgia, serif; font-size: 15px; line-height: 24px; background-color: rgba(255, 255, 255, 0.952941);"&gt;CL_INVALID_KERNEL_NAME&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.8000001907349px;"&gt;error is returned.&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;&lt;SPAN style="font-size: 12.8000001907349px;"&gt;Should I expect the above to work? (If I use -cmd=build in my command line&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;clCreateKernel&amp;nbsp;&lt;/SPAN&gt;cimpletes with no error. But it seems redundant to call&amp;nbsp;&lt;SPAN style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;clBuildProgram on a pre-built executable ,ir&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;&lt;SPAN style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: normal;"&gt;I am using version 1.5.0.43 on a Broadwell device&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Apr 2015 13:18:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004367#M2924</guid>
      <dc:creator>Mike_B_4</dc:creator>
      <dc:date>2015-04-01T13:18:52Z</dc:date>
    </item>
    <item>
      <title>Hello Mike,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004368#M2925</link>
      <description>&lt;P&gt;Hello Mike,&lt;/P&gt;

&lt;P&gt;Yes, you need to do -cmd=build. Looks redundant, but that is the way it is specified in the standard. If you use -cmd=compile, that is the equivalent of calling clCompileProgram, which should be followed by clLinkProgram.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For more details, you can check my article on using binaries of different sorts:&amp;nbsp;https://software.intel.com/en-us/articles/using-spir-for-fun-and-profit-with-intel-opencl-code-builder&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:29:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004368#M2925</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-04-01T16:29:36Z</dc:date>
    </item>
    <item>
      <title>Thank-you for the</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004369#M2926</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thank-you for the clarification Robert.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have a related question. If I build a .ir binary using ioc32 -cmd-build will this work for multiple platforms or is a separate build need to be performed on aper platform basis&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>Wed, 01 Apr 2015 16:55:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004369#M2926</guid>
      <dc:creator>Mike_B_4</dc:creator>
      <dc:date>2015-04-01T16:55:02Z</dc:date>
    </item>
    <item>
      <title>Native binaries are not</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004370#M2927</link>
      <description>&lt;P&gt;Native binaries are not generally portable between generations of the graphics architecture. If you are targeting 3rd gen (Ivy Bridge), 4th gen (Haswell) and 5th gen (Broadwell) chips, you should build native binaries on those platforms. I asked our compiler team to enable building binaries for different architectures using a single machine, and they are working on this, but it will take some time. In general, I would advise not to distribute native binaries to the end users. It is better to either distribute source, possibly in encrypted fashion, build it into binary on the first invocation of the program, and then continue with that binary (if the user updates the driver, you are safer if you discard the hashed binary and rebuild your program) or use SPIR binary, where available.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 17:06:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Create-kernels-from-pre-compiled-ir/m-p/1004370#M2927</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-04-01T17:06:26Z</dc:date>
    </item>
  </channel>
</rss>

