One kernel, every GPU Pick targets in the build
The same kernel compiles to every backend. Switch targets in your build, not in your code.
Write the kernel once
A kernel is an ordinary Emma function marked with the kernel keyword.
1 2 3
kernel func vectorAdd(a: Float[], b: Float[], c: Float[]) { c[id.x] = a[id.x] + b[id.x] }
Targets CUDA, ROCm, Vulkan
Pick targets in the build
The targets live in your build file. Adding one does not touch the kernel.
1 2
[build] targets = ["cuda", "rocm", "vulkan"]