AnsweredAssumed Answered

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

Question asked by yhwan on Dec 7, 2015
Latest reply on Dec 8, 2015 by dipak

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!