ELI Ladder

What is CUDA, and what is it used for?

CUDA is NVIDIA's software platform that lets ordinary programs run thousands of small calculations at once on an NVIDIA GPU.

CPUhost programlaunchkernelGPU: grid of blocksblock 0block 1block 2each small square is a thread running the same kernelthread i: c[i] = a[i] + b[i]

Rung 1 Explain like I'm 6

A GPU is like a hall full of thousands of kids, each ready to do one easy sum. But the kids need instructions. If you just shout "do maths!", nothing useful happens.

CUDA is the teacher's way of giving instructions. It lets you write one small job card, like "add your two numbers and write down the answer", and hand a copy to every kid at once. Each kid gets different numbers, but the same card.

Without CUDA, the hall of kids could only draw pictures for games. With CUDA, you can ask them to help with science, and with teaching computers to talk.

Rung 2 High-school level

CUDA is a programming platform from NVIDIA, introduced in 2006 [1]. It lets programmers use an NVIDIA GPU for general calculations, not just graphics. The name originally stood for Compute Unified Device Architecture, though NVIDIA now just says CUDA.

Before CUDA, using a graphics card for maths meant disguising your numbers as pixels and textures. CUDA instead lets you write code in a version of C++ (and now Python) that runs directly on the GPU.

The pieces are:

  • Host and device. The CPU (host) runs the main program and sends work to the GPU (device).
  • Kernels. A kernel is a small function that thousands of GPU threads run at the same time, each on its own piece of data.
  • Libraries. Ready-made fast code for common tasks, like matrix maths and neural-network layers.

What is CUDA used for? Training and running AI models, scientific simulation, video processing, and anything with lots of independent arithmetic. In AI, most people never write CUDA directly: frameworks like PyTorch call CUDA libraries for them. Writing model.to("cuda") in PyTorch moves a model onto an NVIDIA GPU.

Rung 3 Undergraduate level

A CUDA program launches a grid of blocks, and each block holds many threads. Every thread runs the same kernel and uses its index to pick its data. Here is the classic first kernel, adding two arrays:

__global__ void add(const float* a, const float* b, float* c, int n) {
    int i = blockIdx.x * blockDim.x + threadIdx.x;  // my global index
    if (i < n) c[i] = a[i] + b[i];
}
// launch: enough blocks of 256 threads to cover n elements
add<<<(n + 255) / 256, 256>>>(a, b, c, n);

For n = 1,000,000 that launches 3,907 blocks of 256 threads. The hardware schedules them across its streaming multiprocessors, running threads in warps of 32.

CUDA exposes a memory hierarchy you manage yourself: slow but large global memory (HBM), fast shared memory that threads in one block can share, and registers private to each thread. Fast kernels load a tile of data into shared memory once and reuse it many times.

On top of the language sits a large library stack: cuBLAS (linear algebra), cuDNN (neural-network layers), NCCL (multi-GPU communication) and more. Since CUDA 9 (2017), code can also drive tensor cores through a warp-level matrix API [6]. That stack, not just the compiler, is why AI frameworks target CUDA first.

Check yourself: In the kernel above, why is there an "if (i < n)" check?

The grid is rounded up to whole blocks, so some threads get an index past the end of the array and must do nothing.

Rung 4 Graduate level

CUDA's strength is that it is a mature, closed stack tied to one vendor's hardware. That is also its main trade-off.

CUDA vs ROCm. AMD's ROCm is the closest rival. Its HIP language mirrors the CUDA API closely, so code can often be translated mechanically. ROCm 7.0 (September 2025) added support for the Instinct MI355X and MI350X and for FP4, FP6 and FP8 data types [4]. The gap is mostly in libraries, tuning and tooling maturity rather than in the language.

CUDA vs OpenCL. OpenCL is an open, vendor-neutral standard for the same idea. It runs on more hardware, but in AI it never matched CUDA's library ecosystem.

CUDA vs Triton. Triton is a Python-based language and compiler where you write operations on tiles of data instead of single threads. Its 2019 paper showed matrix-multiply and convolution kernels matching hand-tuned vendor libraries like cuBLAS and cuDNN [5]. Triton still compiles down to the GPU, so it sits above CUDA rather than replacing it.

CUDA vs MPS. On Macs, PyTorch uses Apple's Metal Performance Shaders ("mps") backend, because Apple GPUs do not run CUDA.

Design choices that matter in practice: CUDA compiles to PTX, a virtual instruction set, which the driver translates for each GPU generation. Each GPU has a compute capability number (for example 8.x for Ampere, 9.0 for Hopper, 10.x and 12.x for Blackwell) that gates which features a kernel may use [2][3].

Rung 5 PhD level

CUDA's original abstraction is SIMT: you write scalar code for one thread and the hardware runs it across thousands. That model fit GPUs of 2006 well [1]. It fits modern AI GPUs less well, because most of the work now happens in tensor cores that multiply whole matrix tiles, often asynchronously, with data staged by dedicated copy engines. Expressing that in per-thread code forces programmers to coordinate warps, shared-memory layouts and pipelines by hand.

The research response has been to raise the unit of programming from the thread to the tile. Triton (2019) showed a compiler could take tile-level programs and produce competitive code by handling memory coalescing, shared-memory allocation and synchronisation automatically [5]. NVIDIA's own CUDA Tile (2025) follows the same idea inside CUDA [2].

Open problems:

  • Performance portability. Can one kernel run well on NVIDIA, AMD and other accelerators? Source-level portability (HIP, Triton backends) is easier than keeping peak speed.
  • Autotuning. Tile sizes, pipeline depth and compiler flags interact in ways that are hard to model, so search is still common.
  • Determinism and correctness. Parallel floating-point reductions can give different answers run to run; data races remain easy to write and hard to find.
  • Lock-in. Much of the AI software stack assumes CUDA. How fast alternative stacks can close the library gap is an economic question as much as a technical one.

Rung 6 State of the art: what experts work on now

Last checked 18 November 2026.

The big change in 2025-2026 is that CUDA itself moved toward tile programming.

CUDA 13.1 (4 December 2025) introduced CUDA Tile: a model for writing kernels "at a layer above SIMT", where you operate on tiles and the compiler maps them onto threads and tensor cores [2]. It shipped CUDA Tile IR, a new virtual instruction set, and cuTile Python, a Python language for tile kernels, first supported on Ampere, Ada and Blackwell GPUs [2]. The same release added deterministic floating-point reduction options in CCCL 3.1 and grouped FP8/BF16 matrix multiplies in cuBLAS aimed at mixture-of-experts models [2].

CUDA 13.3 (26 May 2026) brought CUDA Tile to C++, extended tile support to Hopper GPUs, and released CUDA Python 1.0 with a semantic-versioning commitment [3]. It also added CompileIQ, a compiler auto-tuner that NVIDIA says gives up to 15% speed-up on already-optimised Triton attention and CUTLASS matrix-multiply kernels [3].

On the competing side, AMD's ROCm 7.0 (September 2025) added MI350-series support and FP4/FP6/FP8 types [4].

The direction is clear: fewer people write thread-level CUDA, and more write tile-level code in Python or C++ that compilers map onto tensor cores.

Sources

  1. What Is CUDA? (NVIDIA blog) (2012)
  2. NVIDIA CUDA 13.1 Powers Next-Gen GPU Programming with NVIDIA CUDA Tile (2025)
  3. NVIDIA CUDA 13.3 Enhances GPU Development with Tile Programming in C++ (2026)
  4. AMD ROCm 7.0.0 release notes (2025)
  5. Tillet, Kung, Cox. Triton: An Intermediate Language and Compiler for Tiled Neural Network Computations (MAPL) (2019)
  6. Programming Tensor Cores in CUDA 9 (2017)