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

Storing vectors to an array

In the previous chapters, you caught glimpses of how we use vectors in various ways from a tool to transport data in an efficient manner to the device and from the device. We have also learned that OpenCL provides a substantial amount of functions that actually work on vectors. In this section, we will explore how we can store vectors to an array (when we use arrays in this context with a vector, we mean an array that contains scalar values).

The vstore<N> functions, where <N> is 2, 3, 4, 8, and 16, are the primary functions you will use to actually signal the OpenCL that you wish to store the elements in your vector that has to be transported in a parallel fashion to a destination; this is often a scalar array or another ...

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