<?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 CL_MEM_READ_ONLY problem in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/CL-MEM-READ-ONLY-problem/m-p/957963#M2141</link>
    <description>&lt;P&gt;Let&lt;/P&gt;
&lt;P&gt;float y&lt;N&gt;={1,2,...,n}&lt;/N&gt;&lt;/P&gt;
&lt;P&gt;I have a buffer declared as CL_MEM_READ_ONLY:&lt;/P&gt;
&lt;P&gt;buffery = clCreateBuffer(context, CL_MEM_READ_ONLY| CL_MEM_COPY_HOST_PTR, sizeof(float)*n,y,&amp;amp;err);&lt;/P&gt;
&lt;P&gt;I have a kernel declared as follows:&lt;/P&gt;
&lt;P&gt;__kernel void work(__global const float* x,__global float* y){&lt;/P&gt;
&lt;P&gt;int i = get_global_id(0);&lt;BR /&gt;y&lt;I&gt;=x&lt;I&gt;+y&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;clSetKernelArg(workkernel, 1, sizeof(cl_mem), &amp;amp;buffery);&lt;/P&gt;
&lt;P&gt;The code executes with no problem, but it shouldn't be, because buffery is declared as read only, am I correct?&lt;/P&gt;
&lt;P&gt;Ty&lt;/P&gt;</description>
    <pubDate>Mon, 26 Nov 2012 16:49:52 GMT</pubDate>
    <dc:creator>TY</dc:creator>
    <dc:date>2012-11-26T16:49:52Z</dc:date>
    <item>
      <title>CL_MEM_READ_ONLY problem</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/CL-MEM-READ-ONLY-problem/m-p/957963#M2141</link>
      <description>&lt;P&gt;Let&lt;/P&gt;
&lt;P&gt;float y&lt;N&gt;={1,2,...,n}&lt;/N&gt;&lt;/P&gt;
&lt;P&gt;I have a buffer declared as CL_MEM_READ_ONLY:&lt;/P&gt;
&lt;P&gt;buffery = clCreateBuffer(context, CL_MEM_READ_ONLY| CL_MEM_COPY_HOST_PTR, sizeof(float)*n,y,&amp;amp;err);&lt;/P&gt;
&lt;P&gt;I have a kernel declared as follows:&lt;/P&gt;
&lt;P&gt;__kernel void work(__global const float* x,__global float* y){&lt;/P&gt;
&lt;P&gt;int i = get_global_id(0);&lt;BR /&gt;y&lt;I&gt;=x&lt;I&gt;+y&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;clSetKernelArg(workkernel, 1, sizeof(cl_mem), &amp;amp;buffery);&lt;/P&gt;
&lt;P&gt;The code executes with no problem, but it shouldn't be, because buffery is declared as read only, am I correct?&lt;/P&gt;
&lt;P&gt;Ty&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 16:49:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/CL-MEM-READ-ONLY-problem/m-p/957963#M2141</guid>
      <dc:creator>TY</dc:creator>
      <dc:date>2012-11-26T16:49:52Z</dc:date>
    </item>
    <item>
      <title>Update: the spec has not</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/CL-MEM-READ-ONLY-problem/m-p/957964#M2142</link>
      <description>Update: the spec has not defined the behavior in this scenario.</description>
      <pubDate>Mon, 26 Nov 2012 17:25:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/CL-MEM-READ-ONLY-problem/m-p/957964#M2142</guid>
      <dc:creator>TY</dc:creator>
      <dc:date>2012-11-26T17:25:19Z</dc:date>
    </item>
  </channel>
</rss>

