I have APU A6-4455M and try to employ "zero copy" to optimize the memory transfer. However, after I read the programming guide and read the code of the BufferBandwidth, I found actually you need a copy anyway to tranfer data from CPU to GPU by following sequences:
- hostptr = clEnqueueMapBuff(cl_mem_obj)
- memcpy(hostptr, ptr_with_initialized_data_on_host, size_of_data)
- clEnqueueUnMapMemobj(cl_mem_obj, hostptr)
If the understanding of zero copy above were correct, the question is, why it is called "zero copy" if it need a copy anyway from CPU to GPU or vice verse? Zero copy, IMHO, should have no copy at all since now the CPU and GPU are at the same die without the PCIe connection for APU.
Any explanation is appreciated!