I want to implement a program in which CPU(as the host) and GPU can work together. Because CPU and GPU need to communicate with each other by a flag structure, my question is: if I allocate a buffer (buf, for example) which stores the flag structure, naturally, it can be accessed and modified by GPU directly at any time, then I use clEnqueueMapBuffer to map buf to a pointer in CPU memory space (ptr, for example) , then can CPU know any changes made by GPU to buf? Vice verse, if CPU will also make changes to ptr frequently, can these changes be seen by GPU instantly?