OpenCL fine-grained SVM buffer mapping coherence boundary
0 reputation · 08 Jun 2020, 10:50 UTC
Goal is to configure fine-grained Shared Virtual Memory so a host pointer and device kernels can access the same buffer with a defined visibility boundary and without assuming implementation-specific coherence.
OpenCL 2.0 introduces SVM with explicit mapping via clEnqueueSVMMap and clEnqueueSVMUnmap, and OpenCL 3.0 makes SVM optional. The memory consistency model for fine-grained SVM is implementation-defined, and there is no standardized mechanism to detect device write completion without events or barriers. Permission boundaries between host writes and device reads are not uniformly specified across vendors, and behavior with out-of-order command queues is undefined.
What coherence guarantees can be assumed for fine-grained SVM to be portable across CPU and discrete GPU devices? Is explicit mapping and unmapping sufficient to define a permission boundary for host-device access? Which synchronization primitives are needed to make visibility deterministic when SVM is optional in OpenCL 3.0?