Hello! please help to get a pointer to the memory of the GPU. Is this possible? What is cl_mem? And yet, there is reason to try to create an equivalent class?
Thanks in advance!
Originally posted by: mishka_p Hello! please help to get a pointer to the memory of the GPU. Is this possible? What is cl_mem? And yet, there is reason to try to create an equivalent class? Thanks in advance!
cl_mem is OpenCL object. You can use clEnqueueMapBuffer/Image to get a host ptr which can be used to write/read data.
You can also use clEnqueueWriteBuffer/Image to write data.
I'm sorry, I meant something else. Rephrase: if I pass into the kernel a pointer to the memory of the GPU is not as arguments to the kernel, but as an element of a array - the array of pointers.
You can't. As a cl_mem object is not really a pointer, it's a data container, it needs preprocessing to get onto the device. There is no way to describe an array or a struct such that the runtime would know how to do that preprocessing.
Thank you!