0PricingLogin
CUDA Academy · Lesson

Thrust Reduce, Scan, and Sort

High-level primitives with one call.

Hard Algorithms, One Line

Reductions, scans, and sorts are tricky to write fast by hand. Thrust gives you tuned versions through a single function call. 🎁

Reduce Collapses to One Value

thrust::reduce combines every element into a single result, like summing an array, all in parallel under the hood.

int total = thrust::reduce(d.begin(), d.end());

All lessons in this course

  1. cuBLAS GEMM Done Right
  2. Thrust Vectors and Transforms
  3. Thrust Reduce, Scan, and Sort
  4. cuDNN for Deep Learning
← Back to CUDA Academy