cudaz gives Zig developers a high-level, type-safe interface to NVIDIA GPU programming via CUDA. It handles device initialization, memory management, runtime kernel compilation through NVRTC, and random number generation through cuRAND — with idiomatic Zig error handling throughout.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.
Installation
Add cudaz to your Zig project with a single fetch command
Quickstart
Allocate GPU memory and run your first CUDA kernel in minutes
API Reference
Complete reference for every public type and function
Examples
Working examples for arrays, custom types, and matrix ops
What cudaz provides
GPU Memory Management
Type-safe
CudaSlice(T) for allocating, copying, and freeing GPU buffersRuntime Kernel Compilation
Compile
.cu source or inline CUDA text to PTX at runtime using NVRTCKernel Execution
Load PTX modules and launch kernels with configurable grid/block dimensions
Random Number Generation
Generate uniform random
f32 arrays on the GPU via cuRANDAuto CUDA Detection
Automatically locates your CUDA installation on Linux and macOS
Typed Error Handling
CUDA, NVRTC, and cuRAND errors surface as first-class Zig error values
Quick example
Run a CUDA kernel that increments every element of an array in parallel:quickstart.zig
Install cudaz
Run
zig fetch --save https://github.com/akhildevelops/cudaz/archive/0.4.0.tar.gz in your project directory.cudaz supports Linux and macOS. Windows is not currently supported.