<?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 Could you send more info on in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078975#M4615</link>
    <description>&lt;P&gt;Could you send more info on what you found was deprecated/blocked?&amp;nbsp; Which OpenCL release are you using?&amp;nbsp; On which operating system?&lt;/P&gt;

&lt;P&gt;For an example using read_imagef, the Intel SDK for OpenCL applications Codebuilder Visual Studio integration can generate a starting point based on images.&amp;nbsp; It can often be helpful to begin with a known good starting point.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 07 Aug 2016 19:17:21 GMT</pubDate>
    <dc:creator>Jeffrey_M_Intel1</dc:creator>
    <dc:date>2016-08-07T19:17:21Z</dc:date>
    <item>
      <title>problem with read_imagef</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078969#M4609</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;

&lt;P&gt;I am new with OpenCL&lt;/P&gt;

&lt;P&gt;Iam using it with jOCL in java platform&lt;/P&gt;

&lt;P&gt;My problem is that I want to read an image pixels using read_imagef, and all the results of it returns 0.0 (.x .y .z .w) knowing that the image is contains red area.&lt;/P&gt;

&lt;P&gt;here is my kernel&lt;/P&gt;

&lt;PRE class="brush:java;"&gt;const sampler_t smp =     CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; 
            
                           
__kernel void basic(__read_only image2d_t input,__global int  *result) 
{
    
   int gidX = get_global_id(0);
    int gidY = get_global_id(1);
	
int2 coord = (int2)(get_global_id(0), get_global_id(1));

int2 posIn = {gidX, gidY};
       
      float4 pixel = read_imagef(input, smp, posIn);
    

result [gidX]= as_int(pixel.x);
	}&lt;/PRE&gt;

&lt;P&gt;what do you think the problem is???&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 20:47:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078969#M4609</guid>
      <dc:creator>amina_z_</dc:creator>
      <dc:date>2016-08-01T20:47:42Z</dc:date>
    </item>
    <item>
      <title>read_imagef() returns floats</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078970#M4610</link>
      <description>read_imagef() returns floats that are normalized between 0 and 1. So depening on what as_int() does you are probably just casint a float between 0 and 1 to in which will result in a zero.</description>
      <pubDate>Tue, 02 Aug 2016 05:35:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078970#M4610</guid>
      <dc:creator>Joose_S_</dc:creator>
      <dc:date>2016-08-02T05:35:18Z</dc:date>
    </item>
    <item>
      <title>No, I used also float</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078971#M4611</link>
      <description>&lt;P&gt;No, I used also float variable and it always returns &amp;nbsp;0.0&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 21:21:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078971#M4611</guid>
      <dc:creator>amina_z_</dc:creator>
      <dc:date>2016-08-02T21:21:29Z</dc:date>
    </item>
    <item>
      <title>Can you show the buffer</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078972#M4612</link>
      <description>Can you show the buffer allocation on host code including the image format object? You should also try printing the values inside the kernel to see if they get to that point to begin with.</description>
      <pubDate>Wed, 03 Aug 2016 12:36:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078972#M4612</guid>
      <dc:creator>Joose_S_</dc:creator>
      <dc:date>2016-08-03T12:36:17Z</dc:date>
    </item>
    <item>
      <title>Here is my buffer allocation</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078973#M4613</link>
      <description>&lt;P&gt;Here is my buffer allocation&lt;/P&gt;

&lt;PRE class="brush:;"&gt;DataBufferInt dataBufferSrc =
                    (DataBufferInt)image.getRaster().getDataBuffer();
                int dataSrc[] = dataBufferSrc.getData();
                cl_image_format imageFormat = new cl_image_format();
                imageFormat.image_channel_order = CL_RGBA;
                imageFormat.image_channel_data_type =CL_UNORM_INT8;
                		//CL_UNSIGNED_INT8;
                inputImageMem = clCreateImage2D(
                    context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR,
                    new cl_image_format[]{imageFormat}, sizeX, sizeY,
                    sizeX * Sizeof.cl_uint, Pointer.to(dataSrc), null);
            cl_mem memObjects[] = new cl_mem[2];
            memObjects[0] = clCreateBuffer(context, 
                    CL_MEM_READ_WRITE,   Sizeof.cl_uint * sizeX, null, null);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I changed&amp;nbsp;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; line-height: 19.512px;"&gt;CL_UNORM_INT8 to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px; line-height: 19.512px;"&gt;CL_UNSIGNED_INT8 but there was no difference, I will try to print the result in the kernel&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2016 13:17:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078973#M4613</guid>
      <dc:creator>amina_z_</dc:creator>
      <dc:date>2016-08-03T13:17:00Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078974#M4614</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I tried to print te result in the OpenC Code &amp;nbsp;builder but the pplication is blocked&lt;/P&gt;

&lt;P&gt;When I build it is OK but when I want tosee the result by analysing it is deprecated&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Could you know the reason???&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 19:27:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078974#M4614</guid>
      <dc:creator>amina_z_</dc:creator>
      <dc:date>2016-08-04T19:27:11Z</dc:date>
    </item>
    <item>
      <title>Could you send more info on</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078975#M4615</link>
      <description>&lt;P&gt;Could you send more info on what you found was deprecated/blocked?&amp;nbsp; Which OpenCL release are you using?&amp;nbsp; On which operating system?&lt;/P&gt;

&lt;P&gt;For an example using read_imagef, the Intel SDK for OpenCL applications Codebuilder Visual Studio integration can generate a starting point based on images.&amp;nbsp; It can often be helpful to begin with a known good starting point.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2016 19:17:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/problem-with-read-imagef/m-p/1078975#M4615</guid>
      <dc:creator>Jeffrey_M_Intel1</dc:creator>
      <dc:date>2016-08-07T19:17:21Z</dc:date>
    </item>
  </channel>
</rss>

