Hi all, to create a GPU buffer and init it to be all 0s, what I am doing right now is:
clCreateBuffer
then
clEnqueueWriteBuffer()
copy an array of 0s to the buff
I am wondering if there is anyway to create a GPU buffer and init it to be all 0s without calling clEnqueueWriteBuffer() ?
Thanks!
Solved! Go to Solution.
Check clEnqueueFillBuffer() API. It can fill up patterns within an OpenCL buffer object.
I think this API is available from OpenCL 1.1 and above.
If you are using OpenCL 1.0, you may not have this function.
Good luck!
View solution in original post