Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

Processing host's array of buffers mapped to cl_mem via CL_MEM_USE_HOST_PTR

Hi everyone,

I'm trying to process an array of buffers that are allocated by a host (running on Carrizo machine with OpenCL 2.0). Although clSVMAlloc() is supported, I need to use the memory allocated by the host, thus clCreateBuffer with CL_MEM_USE_HOST_PTR is currently my only option. (When is fine-grained SVM system going to be supported anyways?)

I've seen many posts that say passing an array of cl_mem or double pointer of SVM to the kernel is not allowed. However, passing each element of cl_mem as a separate argument parameter is not possible either since number of buffers I need to pass are in thousands (e.g., 4096, 8192). Merging them into one long buffer is not possible either since that will require copying, which I'm trying to avoid. I also thought about passing a structure (allocated with SVM) that contains array of cl_mem objects but this doesn't seem to be possible either. Is there any way I can achieve this goal? Any help will be appreciated!



1 Reply

Hi Younghwan,

As you know,  image objects can be used as multi-dimensional data container in OpenCL. I don't know whether it is applicable in your case or not. However, have you considered it? For example image object type: CL_MEM_OBJECT_IMAGE1D_ARRAY