Last updated: 2026-06-12

Inference Runtime

Interface

All API Sections

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

macOS → Metal. Linux → Vulkan by default, or CUDA with `-Dbackend=cuda` (NVIDIA / WSL2, where Vulkan is CPU-only). See docs/cuda-backend.md.

5 exports 0 methods src/gpu/interface.zig

5 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_cuda

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

True when compiling for Linux with `-Dbackend=cuda` (NVIDIA / WSL2).

src/gpu/interface.zig:12

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:14

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 / CUDA / Vulkan).

src/gpu/interface.zig:19

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:27