OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Map/Unmap operations with Zero copy buffer.

verma__abhi1
Beginner
422 Views

When we create physical zero copy buffers using USE_HOST_PTR, do we really need to perform map/unmap operations everytime we make changes to the buffer from the CPU side. Since, both GPU and CPU access the same memory, will not the changes propagate themselves automatically?

0 Kudos
1 Reply
Evgeniy_T_Intel
Employee
422 Views

Assuming by CPU you meant host, then map/unmap is needed still because it is UB by the spec (implementation may cache the data). So automatic propagation is not guaranteed by spec and is implementation defined.

Also good reading on host pointer topic: https://community.khronos.org/t/clarify-cl-mem-use-host-ptr/2333

Reply