Files
metabuilder/libraries/mojo/samples/examples/gpu-intro
2026-03-09 22:30:41 +00:00
..
2026-03-09 22:30:41 +00:00
2026-03-09 22:30:41 +00:00
2026-03-09 22:30:41 +00:00
2026-03-09 22:30:41 +00:00
2026-03-09 22:30:41 +00:00

Get started with GPU programming tutorial solution

This directory contains a complete solution for the Get started with GPU programming tutorial project, which is an implementation of a simple vector addition GPU kernel using Mojo. Please refer to the tutorial for an explanation of the code and concepts.

This example requires a supported GPU to run the kernel. If your system doesn't have a supported GPU, you can compile the program but the only output you'll see when you run it is:

No compatible GPU found

Files

This directory contains the following files:

  • vector_addition.mojo is the only source file for the tutorial solution, containing the kernel function and the main program.

  • pixi.toml is a Pixi project file containing the project dependencies and task definitions.

Run the code

If you have Pixi installed, you can execute the example by running the following command:

pixi run mojo vector_addition.mojo