Why eyeballing kernels is a trap
A CUDA kernel can be perfectly correct and still hit ~3% of peak FLOPS. Without a profiler you'll guess wrong about why. The three usual suspects:
- Memory-bound vs compute-bound. Most kernels are memory-bound; the GPU is idle waiting for VRAM.
- Low occupancy. Not enough warps resident on each SM to hide memory latency.
- Warp divergence. Branches splitting warps, halving (or worse) effective throughput.
The NVIDIA toolchain gives you three windows into this: nvcc --ptxas-options=-v at compile time, nvprof/nsys for high-level timing, and Nsight Compute for per-kernel deep dives. Learn the first and third; the second is mostly bookkeeping.
