O'Reilly logo

Multicore and GPU Programming by Gerassimos Barlas

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

Chapter 7

The Thrust template library

Abstract

Thrust is a template library that allows a high-level approach to GPU and multicore programming, that closely resembles the way the standard STL library is used, effectively reducing the learning curve associated with GPU computing.

Thrust-based programs operate on collections of data without explicit reference to their location, meaning that the same code can use the CPU or the GPU as an execution platform. In fact, Thrust permits a run-time choice of the “device back-end” that will be used for execution, with the available alternatives including CUDA, TBB, OpenMP or plain threads. This flexibility and the level of ease-of-use, makes Thrust a prime candidate for parallel program design.

In this ...

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