# One kernel, every GPU

Ben Koska, Sep 23, 2026

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.

```emma
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.

```toml
[build]
targets = ["cuda", "rocm", "vulkan"]
```
