There have been a handful of threads that discuss the memory object allocation flags (CL_MEM_COPY_HOST_PTR, CL_MEM_ALLOC_HOST_PTR, and CL_MEM_USE_HOST_PTR), but I've run some experiments and they lead to different conclusions.
First, if a memory object is created with the CL_MEM_WRITE_ONLY flag, then the host pointer must be null. If the object is created with the CL_MEM_READ_ONLY or CL_MEM_READ_WRITE flags, then the host pointer must not be null.
If the host pointer is not null, then one of three allocation settings are possible: CL_MEM_USE_HOST_PTR, CL_MEM_COPY_HOST_PTR, and CL_MEM_COPY_HOST_PTR | CL_MEM_ALLOC_HOST_PTR. When I try to create a memory object with no flags or CL_MEM_ALLOC_HOST_PTR alone, I get a run-time error. From what I've seen, these aren't valid options.
If the host pointer is null, then you can create the memory object with no allocation flags.
This is how I think the flags work:
CL_MEM_USE_HOST_PTR - The memory object uses the pre-allocated memory identified by the host pointer
CL_MEM_COPY_HOST_PTR - OpenCL allocates memory for the memory object separate from that identified by the host pointer.
CL_MEM_COPY_HOST_PTR | CL_MEM_ALLOC_HOST_PTR - OpenCL allocates host-accessible memory for the memory object separate from that identified by the host pointer.
If anyone has code that contradicts this, please let me know. I'm running Ubuntu and sending kernels to an ATI 5850 graphics card.