Thrust is a parallel algorithms library which resembles the C++ Standard
Template Library (STL). Thrust’s high-level interface greatly enhances
programmer productivity while enabling performance portability between
GPUs and multicore CPUs. Interoperability with established technologies
(such as CUDA, TBB, and OpenMP) facilitates integration with existing
software. Develop high-performance applications rapidly with Thrust!
Thrust is best explained through examples. The following source code
generates random numbers serially and then transfers them to a parallel
device where they are sorted.
This code sample computes the sum of 100 random numbers in parallel: