CL_OUT_OF_HOST_MEMORY almost in every function which makes correct handling of out of mem contidions

I don’t really understand what can fail in (for example) a function such as clEnqueueWriteBuffer ? Suppose you want to write an application which correctly handles out of memory conditions, in this case when you use opencl you have to check for out of memory after every function call.
For example clEnqueueWriteBuffer returns following error codes (according to specs) CL_INVALID_COMMAND_QUEUE,CL_INVALID_CONTEXT,CL_INVALID_MEM_O
BJECT,CL_INVALID_VALUE,CL_INVALID_EVENT_WAIT_LIST, CL_MEM_OBJECT_ALLOCATION_FAILURE, CL_OUT_OF_HOST_MEMORY.
First 5 error codes are basically indicators for programmer errors, and will never appear in a final product. Last 2 error codes makes no sense to me. I understand that functions, which create user objects, such as clCreateSampler may fail because of out of memory, and thus return CL_OUT_OF_HOST_MEMORY, but why functions which operater on successfully created objects can fail ???
As an example - cuMemCpyHToD in CUDA can’t fail because of out of memory, so does UpdateSubresource function in both DX10 and DX11 apis, so why is clEnqueueWriteBuffer that different ?

I share your ideas about the topic. However in my case is not just a matter of logical coherence. I easily get stuck with the CL_OUT_OF_HOST_MEMORY error when using C++ bindings. This happens, in particular circumstances, even simply creating a context and I really can’t figure out why. I suspects some bugs in the implementation of the OpenCL calls in the driver (currently using version 260.24 for Linux 64 bit). I would appreciate some help in solving this bug. If some developer out there is listening, I can look better into that and provide further information.
Cheers

I share your ideas about the topic. However in my case is not just a matter of logical coherence. I easily get stuck with the CL_OUT_OF_HOST_MEMORY error when using C++ bindings. This happens, in particular circumstances, even simply creating a context and I really can’t figure out why. I suspects some bugs in the implementation of the OpenCL calls in the driver (currently using version 260.24 for Linux 64 bit). I would appreciate some help in solving this bug. If some developer out there is listening, I can look better into that and provide further information.
Cheers