0PricingLogin
CUDA Academy · Lesson

The Occupancy Calculator API

cudaOccupancyMaxPotentialBlockSize.

Stop Guessing Block Size

Instead of hand-tuning, CUDA offers an occupancy API that computes a good block size for your kernel automatically.

The Star Function

One call does the heavy lifting: cudaOccupancyMaxPotentialBlockSize suggests a block size that maximizes occupancy.

cudaOccupancyMaxPotentialBlockSize(&grid, &block, myKernel);

All lessons in this course

  1. What Occupancy Really Means
  2. Registers and Shared Memory Limits
  3. The Occupancy Calculator API
  4. Occupancy Is Not the Whole Story
← Back to CUDA Academy