O'Reilly logo

OpenCL Parallel Programming Development Cookbook by Raymond Tay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving information about OpenCL sub-buffer objects

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.

Tip

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.

Getting ready

In the 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 displayBufferDetails:

cl_buffer_region region; region.size = sizeof(UserData)*DATA_SIZE; region.origin = 0; cl_mem subUDObj = clCreateSubBuffer(UDObj, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required