Hi,
i'm porting an existing OpenCL-using application to ARM/Mali. It already runs, but performance could be better due to unneeded buffer copies.
The ideal OpenCL workflow seems to be:
Init: create a cl_mem object with CL_MEM_ALLOC_HOST_PTR .
Loop:
1. get a void* via clEnqueueMapBuffer
2. Use the void* to fill in data
3. UnMap
4. use the cl_mem object as parameter for a kernel.
but i have a problem in step 1: do i always get the same void* or can this pointer move over time? I basically need this:
Init 1: create a cl_mem object with CL_MEM_ALLOC_HOST_PTR .
Init 2: get a void* via clEnqueueMapBuffer
Init 3: pass the void* into a device driver (very expensive operation)
1. wait for the device driver to fill the buffer
2. UnMap
3. use the cl_mem object as parameter for a kernel.
4. clEnqueueMapBuffer, but ignore the new void* because Init 3 is very slow.
Can i really ignore the pointer returned in step 4 and use the first pointer returned in init 3 forever? Is this guaranteed for all Mali-OpenCL implementations?
Thanks