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
- Why GPUs for AI Workloads
- Threads, Blocks, and Grids
- Writing a GPU Kernel Function
- Moving Data to and from Device