Pointer of pointers in device memory in OpenCL how to?

Just wondering,

How do I go about creating a cl_mem object which appears as an array of pointers to the kernel?

I understand that a “cl_mem” argument appears as a “pointer” argument in the kernel…

What if this cl_mem object contains an array of cl_mem objects??? Will it appear as array of pointers to the kernel?

How do I go about this?

I haven’t looked at this specifically, but I could have sworn that while reading the OpenCL spec, that you’re not allowed to use pointers on the device,

and instead you must use offsets/indices from pointer kernel parameters…



I posted the same in OpenCL forums as well. And, there was a response saying it is not possible…

So, the only way to change a “cl_mem” object to device-pointer is to make it as a kernel argument, Is that right?

So… THat means… There is a way. I wish they expose that to programmers.