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

Creating OpenCL sub-buffer objects

Sub-buffers are incredibly useful data types and as you continue to explore OpenCL in this chapter, you'll notice that this data type can be used to partition the data and distribute them across your OpenCL devices on your platform.

Note

At the time of this writing, sub-buffer support is not enabled on OpenCL delivered in the OSX 10.6, because the official version is OpenCL 1.0. However, if you have OSX 10.7 then you'll be able to run this code without any problem.

Let's take a look at the method signature and examine it:

cl_mem clCreateSubBuffer(cl_mem buffer,
                         cl_mem_flags flags,
                         cl_buffer_create_type bufferType,
                         const void* buffer_create_info,
                         cl_int* errcode_ret)

The argument buffer refers to the buffer you created ...

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