In some cases it very useful to access the host memory from the gpu.
For example you need to read a large array only once and compare
the values with the array in the GPU memory and you don’t want
a copy of that data in GPU because of memory limitations.
This ist the case in which I plan to use “Zero-Copy”.
My use case is an iterative algorithm and I have to check whether there is
a change of the result or if the result is stable.
Is there something like “Zero-Copy” in OpenCL and how to use it?
Transfers between CPUs and GPUs are improved for buffers declared with either the CL_MEM_USE_HOST_PTR or the CL_MEM_ALLOC_HOST_PTR flag.
For APUs, zero copy buffers created as CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_ONLY offer improved GPU read performance.