0Pricing
Mojo Academy · Lesson

Anatomy of a Compute Kernel

The hot inner loop that does the work.

What Is a Kernel?

A compute kernel is the small, focused routine that does the real numerical work, like adding two arrays element by element.

The Hot Inner Loop

Most of a kernel's time lives in one tight inner loop. Speed up that loop and you speed up the whole program.

for i in range(n):
    out[i] = a[i] + b[i]

All lessons in this course

  1. Anatomy of a Compute Kernel
  2. Combining SIMD with Loops
  3. Reducing Memory Traffic
  4. Tiling for Cache Locality
← Back to Mojo Academy