Last updated: 2026-06-12
CUDA Runtime
Pipeline
CUDA compute pipeline wrapper — NVRTC-compiled CUfunction (mirrors src/metal/pipeline.zig).
Compiles a `.cu` source string for the running device's arch (sm_XY) or loads a precompiled cubin/PTX image. Each pipeline holds a `CUmodule` + `CUfunction` pair obtained from the C shim. Use `createPipeline` for JIT compilation via NVRTC or `createPipelineFromImage` when an offline-compiled cubin/PTX blob is available. Free with `freePipeline` when done.
5 exports shown
struct
CudaPipeline
pub const CudaPipeline = struct A compiled CUDA kernel ready for dispatch.
function
createPipeline
pub fn createPipeline(ctx: ?*shim.CudaCtx, cu_source: [*:0]const u8, fn_name: [*:0]const u8) !CudaPipeline NVRTC-compile `cu_source` and resolve `fn_name` for dispatch.
function
createPipelineFromImage
pub fn createPipelineFromImage(ctx: ?*shim.CudaCtx, image: [*]const u8, image_size: usize, fn_name: [*:0]const u8) !CudaPipeline Load a kernel from a precompiled cubin/PTX image (offline nvcc path).
function
freePipeline
pub fn freePipeline(pipe: *CudaPipeline) void Release the pipeline handle.
Safe to call with a null handle.