Last updated: 2026-11-17

Inference Runtime

Interface

All API Sections

GPU backend abstraction — comptime-resolved, zero runtime overhead.

macOS → Metal. Linux → Vulkan by default, CUDA with `-Dbackend=cuda`, or ROCm/HIP with `-Dbackend=rocm`.

6 exports 0 methods src/gpu/interface.zig

6 exports shown

constant

is_metal

#
pub const is_metal = builtin.os.tag == .macos

True when compiling for macOS (Metal backend).

src/gpu/interface.zig:10

constant

is_rocm

#
pub const is_rocm = builtin.os.tag == .linux and std.mem.eql(u8, build_options.backend, "rocm")

True when compiling for Linux with `-Dbackend=rocm` (AMD + HIP).

src/gpu/interface.zig:12

constant

is_cuda

#
pub const is_cuda = builtin.os.tag == .linux and (std.mem.eql(u8, build_options.backend, "cuda") or is_rocm)

True for the CUDA-family orchestration shared by native CUDA and ROCm/HIP.

src/gpu/interface.zig:14

constant

is_vulkan

#
pub const is_vulkan = builtin.os.tag == .linux and !is_cuda

True when compiling for Linux with the Vulkan backend (the Linux default).

src/gpu/interface.zig:17

constant

backend

#
pub const backend = if (is_metal) @import("../metal/device.zig") else if (is_cuda) @import("../cuda/device.zig") else @import("../vulkan/instance.zig")

Platform-specific GPU device module (Metal / ROCm / CUDA / Vulkan).

src/gpu/interface.zig:22

constant

vk

#
pub const vk = if (is_vulkan) @import("../vulkan/vk.zig") else struct}

Vulkan C bindings (empty struct off-Vulkan).

src/gpu/interface.zig:30