0Pricing
Mojo Academy · Lesson

Writing a GPU Kernel Function

Express device code in Mojo.

What a Kernel Is

A GPU kernel is the function each thread runs. You write the work for one element, and the hardware repeats it across many.

Think One Thread

The trick is to write a kernel from a single thread's view. Each thread does its own small slice of the work.

All lessons in this course

  1. Why GPUs for AI Workloads
  2. Threads, Blocks, and Grids
  3. Writing a GPU Kernel Function
  4. Moving Data to and from Device
← Back to Mojo Academy