The retrieval of information about OpenCL sub-buffers is very similar to that described in the previous recipe and involves the invocation of
clGetMemObjInfo. Let's take a look at it.
OSX Caveat—you will need a OpenCL 1.1, at least the implementation to see this build and run; since OSX 10.6 doesn't support that version, you'll have to get a OSX 10.7 to get this code to run.
Ch2/sub_buffer_query/subbuffer_query.c, you'll find an excerpt of the following code demonstrating how we would pass the sub-buffer memory object to our defined function
cl_buffer_region region; region.size = sizeof(UserData)*DATA_SIZE; region.origin = 0; cl_mem subUDObj = clCreateSubBuffer(UDObj, ...