cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sajis997
Adept I

buffer offset and opencl

Hello forum,

I found the following points discussed in the link : http://www.cc.gatech.edu/~vetter/keeneland/tutorial-2012-02-20/08-opencl.pdf

1. Buffer offsets are not allowed in OpenCL.

2. Must use pointer arithmetic for pointer traversal in OpenCL.

Could some one explain what they mean ? Specially the first point.

Thanks

Sajjadul

0 Likes
2 Replies
himanshu_gautam
Grandmaster

Hi

I really dont know in what context the above statements are defined.

Please refer opencl spec for any technical stuff.

0 Likes
realhet
Miniboss

Hi,

Imagine you have a kernel declared like: testkernel(global float *array)

And you have an OpenCL buffer allocated for that float array.

Then you can't call the kernel like testkernel(&buffer[15]).

On OpenCL you have to send a reference to the whole buffer (that's the only way right now), and specify the '15' offset manually with a constant parameter in the kernel's parameter list.

I guess OpenCL 2.0 will have an answer for this in the future.

0 Likes