OpenCL Programming Guide for Mac OS X say (page 34):
In this example, the first read buffer is allocated with the CL_MEM_USE_HOST_PTR flag set. In contrast, the second read buffer is allocated with CL_MEM_COPY_HOST_PTR flag set. In both cases, you must also provide a pointer to your data. When the CL_MEM_USE_HOST_PTR flag is set, the OpenCL implementation has the option of caching the data on the OpenCL device, but it keeps the buffers on the two devices synchronized ; when that flag is not set, it always allocates the memory on the host device.
I have trouble with the last sentence of the quote. Is it true that “no flag = cl_mem on the host memory” ?!
If I create a buffer with :
memObj = clCreateBuffer(context, FLAG, sizeof(cl_float) * n, NULL, NULL);
memory is allocated on the device memory, right ?