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.mojois the only source file for the tutorial solution, containing the kernel function and the main program. -
pixi.tomlis 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