how to create and init gpu memory buff to be all 0s

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!

Just write a simple kernel that sets the zeros.

You can also use clEnqueueFillBuffer to fill the buffer with a pattern which in your case will be 0s.

AFAICT, this is OpenCL 1.2 only, right? I’m praying for the day NVIDIA will release an SDK with OpenCL 1.2 support.