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

Using work items to partition data

In the previous chapter, we introduced how work can be partitioned in a one-dimensional array across several work items (you should flip back now if you cannot remember), and also how each work item would obtain an index in which the kernel can use to conduct the computation in the kernel code vector_multiplication. In this recipe, we are going to build on that by exploring two-dimensional data partitioning in more detail.

By now, you should realize that one of the cornerstones of OpenCL is getting the data into the device/s for processing via kernels, and you've seen how data can be partitioned among different devices via kernels. In the former, you've seen how we used the distributed array pattern to partition ...

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