<?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 ScottJ, in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145496#M5983</link>
    <description>&lt;P&gt;Hi ScottJ,&lt;/P&gt;&lt;P&gt;Thanks again for the feedback. This feedback encourages me to file clarifications for multiple issues with the product.&lt;/P&gt;&lt;P&gt;Difficult to tell where there is immediate divergence between your configuration and mine...&lt;/P&gt;&lt;P&gt;A few comments:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I think there's a sighting here for an error code issue... per OCL docs it should be CL_IMAGE_FORMAT_NOT_SUPPORTED... CL_IMAGE_FORMAT_NOT_SPECIFIED looks like a typo in the support tool backend. I will file this to the dev team.&lt;/LI&gt;&lt;LI&gt;On image formats related to that error... it's important to match the OCL manual for the &lt;A href="https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/cl_image_format.html"&gt;cl_image_format description &lt;/A&gt;data structure.&amp;nbsp;"These formats can only be used if channel data type = "&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;What is simple_out? I only use the same variable names in the Assign Variable pane as I use in the Code Builder Configuration Assign Input pane... I've attached a screen shot of a successful configuration with dst_image reduced to a 4x4.&lt;/LI&gt;&lt;LI&gt;Also notice the channel order is different than mine.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I was successful running only 4x4 workitems and size for the dst_image memory object. Of course that didn't validate against the much larger original image....&lt;/P&gt;&lt;P&gt;Can you post a screen shot of the error to this thread if you still can't get it to operate? Can you archive the codebuilder project directory and post it here?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2019 19:26:38 GMT</pubDate>
    <dc:creator>Michael_C_Intel1</dc:creator>
    <dc:date>2019-05-21T19:26:38Z</dc:date>
    <item>
      <title>Very basic beginner question using CodeBuilder and a sample shader</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145493#M5980</link>
      <description>&lt;P&gt;I am trying a sample shader that intends to simply copy the pixels form a input texture to an output texture.&amp;nbsp; My goal is to see it run in Intel CodeBuilder without host code.&amp;nbsp; I have setup a session to run this small kernel.&amp;nbsp; (The kernel is from the textbook "OpenCL In Action").&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;

__kernel void simple_image(read_only image2d_t src_image, write_only image2d_t dst_image)
{
  int2 coord = (int2) (get_global_id(0), get_global_id(1));
  uint4 pixel = read_imageui(src_image, sampler, coord);

  write_imageui(dst_image, coord, pixel);
}&lt;/PRE&gt;

&lt;P&gt;I've created two image variables.&amp;nbsp; The input image is 642x482 RGBA.&amp;nbsp; So I made the output image have the same properties as the input image except it is labeled as an output image.&amp;nbsp; I assigned the image variables to the input and outputs in the "Code Builder Analysis Input" window.&amp;nbsp; I selected a global size of X:642 Y:482 Z:0.&amp;nbsp; The local size is (1, 1, 0).&lt;/P&gt;
&lt;P&gt;When I run the kernel in CodeBuilder it builds fine and runs but the output image is always black.&amp;nbsp; The simple kernel code should copy the image.&amp;nbsp; I've tried setting "pixel" to a nonzero constant value but still the output image shows up black in the output report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 21:23:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145493#M5980</guid>
      <dc:creator>johnson__scott1</dc:creator>
      <dc:date>2019-05-13T21:23:41Z</dc:date>
    </item>
    <item>
      <title>Hi ScottJ,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145494#M5981</link>
      <description>&lt;P&gt;Hi ScottJ,&lt;/P&gt;&lt;P&gt;Thanks for the interest... the feedback is useful ... I did get walking through the process just now... but I had trouble hardcoding a pixel value as well... But for me it was because I didn't set my channel data type correctly.&lt;/P&gt;&lt;P&gt;For some pointers to debug...&lt;/P&gt;&lt;P&gt;A formatted printf(...) can be dropped in the kernel... it may be fruitful to add some code like this to check the data the kernel sees emitted by say work-item 0,0...&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;  if(get_global_id(0) == 0 &amp;amp;&amp;amp; get_global_id(1) == 0)
      printf("%u %u %u %u\n", pixel[0], pixel[1], pixel[2], pixel[3]);&lt;/PRE&gt;

&lt;P&gt;If my input variable&amp;nbsp;usez CL_UNSIGNED_INT8 as the channel data type... when I dump the uint4 pixel I see for a toy image @ 0,0&amp;nbsp;I get:&amp;nbsp;237 27 36 255...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I leave the image object as CL_UNORM_INT8 channel type I see&amp;nbsp;1064168942 1037621465 1041272977 1065353216 for the same pixel in a successfully validated kernel write... Per spec... using read_imageui is undefined if the the channel data type isn't friendly:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/read_imagei2d.html"&gt;Reference&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;P&gt;read_imageui&amp;nbsp;can only be used with image objects created with&amp;nbsp;image_channel_data_type&amp;nbsp;set to one of the following values:&amp;nbsp;CL_UNSIGNED_INT8,&amp;nbsp;CL_UNSIGNED_INT16, andCL_UNSIGNED_INT32. If the&amp;nbsp;image_channel_data_type&amp;nbsp;is not one of the above values, the values returned by&amp;nbsp;read_imageui&amp;nbsp;are undefined.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may have affected your attempts at hard coding... With a real host side program... this would be defined in host code. Similar spec limitations are documented for the unsigned write version of the function as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Code Builder Variable pane can help edit variable types in the Codebuilder environment.&lt;/P&gt;
&lt;P&gt;On ISS2019u3 w/ MSVS2017 on Intel®­ Core™ i5-6300U I was able to assign a 600x446&amp;nbsp;mspaint toy jpg to src_image and have the session validate successfully. I'll attach screen shots to give a general reference... I'm hoping some old fashioned printf(...) and checking the buffer types can help.&lt;/P&gt;
&lt;P&gt;Let me know if you're still stuck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-MichaelC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 00:22:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145494#M5981</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-05-14T00:22:25Z</dc:date>
    </item>
    <item>
      <title>How were you able to use CL</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145495#M5982</link>
      <description>&lt;P&gt;How were you able to use&amp;nbsp;CL_UNSIGNED_INT8 as the channel data type?&amp;nbsp; I get the error "Failed to create an image for this argument (dst_image): -10 (CL_IMAGE_FORMAT_NOT_SPECIFIED).&lt;/P&gt;&lt;P&gt;simple_out&lt;/P&gt;&lt;P&gt;Data Type : image2d_t&lt;/P&gt;&lt;P&gt;Width : 4&lt;/P&gt;&lt;P&gt;Height : 4&lt;/P&gt;&lt;P&gt;Depth : 1&lt;/P&gt;&lt;P&gt;Array Size : 1&lt;/P&gt;&lt;P&gt;Row Pitch : 0&lt;/P&gt;&lt;P&gt;Slice Pitch : 0&lt;/P&gt;&lt;P&gt;Source Format : RGB - RGBA&lt;/P&gt;&lt;P&gt;Channel Data Type : CL_UNSIGNED_INT8&lt;/P&gt;&lt;P&gt;Channel Order : CL_BGRA&lt;/P&gt;&lt;P&gt;IO Mode : Output&lt;/P&gt;&lt;P&gt;Memory Flags : CL_MEM_USE_HOST_PTR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 15:12:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145495#M5982</guid>
      <dc:creator>johnson__scott1</dc:creator>
      <dc:date>2019-05-14T15:12:51Z</dc:date>
    </item>
    <item>
      <title>Hi ScottJ,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145496#M5983</link>
      <description>&lt;P&gt;Hi ScottJ,&lt;/P&gt;&lt;P&gt;Thanks again for the feedback. This feedback encourages me to file clarifications for multiple issues with the product.&lt;/P&gt;&lt;P&gt;Difficult to tell where there is immediate divergence between your configuration and mine...&lt;/P&gt;&lt;P&gt;A few comments:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I think there's a sighting here for an error code issue... per OCL docs it should be CL_IMAGE_FORMAT_NOT_SUPPORTED... CL_IMAGE_FORMAT_NOT_SPECIFIED looks like a typo in the support tool backend. I will file this to the dev team.&lt;/LI&gt;&lt;LI&gt;On image formats related to that error... it's important to match the OCL manual for the &lt;A href="https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/cl_image_format.html"&gt;cl_image_format description &lt;/A&gt;data structure.&amp;nbsp;"These formats can only be used if channel data type = "&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;What is simple_out? I only use the same variable names in the Assign Variable pane as I use in the Code Builder Configuration Assign Input pane... I've attached a screen shot of a successful configuration with dst_image reduced to a 4x4.&lt;/LI&gt;&lt;LI&gt;Also notice the channel order is different than mine.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I was successful running only 4x4 workitems and size for the dst_image memory object. Of course that didn't validate against the much larger original image....&lt;/P&gt;&lt;P&gt;Can you post a screen shot of the error to this thread if you still can't get it to operate? Can you archive the codebuilder project directory and post it here?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 19:26:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145496#M5983</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-05-21T19:26:38Z</dc:date>
    </item>
    <item>
      <title>For reference for Intel</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145497#M5984</link>
      <description>&lt;P&gt;For reference for Intel employee viewers. I've filed OPENCLSDK-4908,4909,and 4910 related to this posting... thanks.&lt;/P&gt;&lt;P&gt;-MichaelC&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 22:55:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Very-basic-beginner-question-using-CodeBuilder-and-a-sample/m-p/1145497#M5984</guid>
      <dc:creator>Michael_C_Intel1</dc:creator>
      <dc:date>2019-05-21T22:55:32Z</dc:date>
    </item>
  </channel>
</rss>

