liveBook · Manning

Kernel boundary

As explained in Grokking GPU Programming

A kernel boundary is the transition between GPU kernel executions that, in the described ordinary same-stream launch sequence, provides a grid-wide synchronization point and makes prior writes visible.

When GPU work in one block depends on work in another, a block-level barrier cannot coordinate them. The kernel boundary—the point where one kernel returns and the next launch begins—is where all blocks are guaranteed to have finished; prior writes are visible in an ordinary same-stream launch sequence. section 11.4

Use the boundary to handle dependencies across blocks:

  • Split dependent work into separate kernel launches rather than trying to make blocks wait for one another inside a kernel. section 11.4
  • Do not confuse this with __syncthreads(), which synchronizes threads only within one block. section 11.4

Algorithms with cross-block dependencies

Multi-block scan, level-synchronous BFS, and wavefront dynamic programming rely on kernel boundaries to separate dependent stages. section 11.4

How Grokking GPU Programming covers it

How deep it goes
Distinguishes grid-wide kernel completion from block-local barriers and explains why dependent stages require separate launches.
Examples
Uses multi-block scan, level-synchronous breadth-first search, and wavefront dynamic programming as examples.
What you can do after
Apply the boundary by splitting work with cross-block dependencies into separate kernel launches.
How it connects
Connects kernel boundaries with __syncthreads(), shared memory, multi-block scan, breadth-first search, and wavefront dynamic programming.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking GPU Programming. The section links point to the parts of the book it draws on.