Uploaded June 2014 | Updated September 2026, 2 weeks ago
CUDA comes with many standard libraries, providing a huge number of convenient algorithms and data structures for use with CUDA accelerated GPU's. Today we'll have a look at the Thrust library. It provides a collection of parallel algorithms and data structures, presented with the same syntax as C++'s STL.
It's super easy to use. It allows seamless inter-operation between Thrust device and host vectors as well as STL vectors! It's also very quick and easy to use device vectors in our CUDA kernels, but we might look at that in the future.
Thrust can greatly improve the readability of your code as well as allow to get on with programming application specific mechanisms, instead of worrying about device memory copies and implementing standard algorithms like sort and reduce.
CUDA comes with many standard libraries, providing a huge number of convenient algorithms and data structures for use with CUDA accelerated GPU's. Today we'll have a look at the Thrust library. It provides a collection of parallel algorithms and data structures, presented with the same syntax as C++'s STL.
It's super easy to use. It allows seamless inter-operation between Thrust device and host vectors as well as STL vectors! It's also very quick and easy to use device vectors in our CUDA kernels, but we might look at that in the future.
Thrust can greatly improve the readability of your code as well as allow to get on with programming application specific mechanisms, instead of worrying about device memory copies and implementing standard algorithms like sort and reduce.










