0PricingLogin
CUDA Academy · Lesson

Synchronizing with __syncthreads

Barriers that keep threads in step.

Threads Run Out of Step

Threads in a block do not march in lockstep. One may finish writing while another is still loading, so you cannot assume the data is ready yet.

Meet the Barrier

A barrier is a line in the code where every thread must wait until all of them arrive. Only then does the block move on together.

All lessons in this course

  1. Declaring __shared__ Arrays
  2. Synchronizing with __syncthreads
  3. Avoiding Bank Conflicts
  4. Dynamic Shared Memory
← Back to CUDA Academy