- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let
float y
I have a buffer declared as CL_MEM_READ_ONLY:
buffery = clCreateBuffer(context, CL_MEM_READ_ONLY| CL_MEM_COPY_HOST_PTR, sizeof(float)*n,y,&err);
I have a kernel declared as follows:
__kernel void work(__global const float* x,__global float* y){
int i = get_global_id(0);
y=x+y;
}
and
clSetKernelArg(workkernel, 1, sizeof(cl_mem), &buffery);
The code executes with no problem, but it shouldn't be, because buffery is declared as read only, am I correct?
Ty
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update: the spec has not defined the behavior in this scenario.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page