cudaz exposes a single top-level namespace that you import withDocumentation 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.
@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
Cuda namespace.
Public Exports
| Export | Type | Purpose |
|---|---|---|
Cuda.Device | struct | GPU device management, memory allocation, and host↔device transfers |
Cuda.Compile | namespace | Runtime CUDA kernel compilation to PTX via NVRTC |
Cuda.LaunchConfig | struct | Kernel launch grid and block dimension configuration |
Cuda.Cudaslice | fn(type) type | Generic type alias for CudaSlice(T) — a type-safe GPU buffer |
Cuda.Module | struct | A loaded PTX module on the device |
Cuda.Function | struct | A kernel function handle retrieved from a Module |
Cuda.Rng | struct | GPU random number generator backed by cuRAND |
Cuda.CAPI | namespace | Raw C API access (CUDA driver, NVRTC, cuRAND headers) |
Cuda.CudaError | type | Combined 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.