Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/akhildevelops/cudaz/llms.txt

Use this file to discover all available pages before exploring further.

cudaz exposes a single top-level namespace that you import with @import("cudaz"). From that namespace you get fully typed handles for every stage of GPU programming: device management, memory allocation, kernel compilation, PTX loading, kernel launch configuration, and random number generation. All error conditions surface as Zig error unions so you can handle them with try or catch like any other Zig code.

Importing cudaz

const Cuda = @import("cudaz");
Every symbol described in this reference is accessed through this Cuda namespace.

Public Exports

ExportTypePurpose
Cuda.DevicestructGPU device management, memory allocation, and host↔device transfers
Cuda.CompilenamespaceRuntime CUDA kernel compilation to PTX via NVRTC
Cuda.LaunchConfigstructKernel launch grid and block dimension configuration
Cuda.Cudaslicefn(type) typeGeneric type alias for CudaSlice(T) — a type-safe GPU buffer
Cuda.ModulestructA loaded PTX module on the device
Cuda.FunctionstructA kernel function handle retrieved from a Module
Cuda.RngstructGPU random number generator backed by cuRAND
Cuda.CAPInamespaceRaw C API access (CUDA driver, NVRTC, cuRAND headers)
Cuda.CudaErrortypeCombined error set covering CUDA driver and cuRAND error codes
Cuda.CudaError is defined as CurandError.Error || NvrtcError.Error — the full set of error codes that any cudaz function may return. Individual functions declare more specific subsets in their signatures.

Module Pages

Device

Initialize GPUs, allocate and transfer memory, load PTX modules, and manage device contexts.

CudaSlice

Type-safe GPU buffer types: the generic CudaSlice(T), the runtime-typed CudaSliceR, and the DType enum.

Compile

Compile inline CUDA C strings or .cu files to PTX at runtime using NVRTC, with full option control.

Module & Function

Load PTX modules onto a device, look up kernel functions by name, and launch them with typed parameters.

LaunchConfig

Configure kernel grid and block dimensions manually or auto-compute them for a given element count.

Rng

Generate arrays of uniform random f32 values on the GPU using cuRAND pseudo-random generators.

Build docs developers (and LLMs) love