After compiling CUDA C source to PTX, you load it onto a device as aDocumentation 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.
Module and then retrieve individual kernel entry points as Function handles. Calling func.run(...) dispatches the kernel on the GPU with the grid and block dimensions you specify in a LaunchConfig. The Module and Function types are thin, zero-overhead wrappers around the CUDA driver API’s CUmodule and CUfunction handles.
Module
A Module represents a loaded PTX image on a CUDA device. You obtain a Module by calling Device.loadPtxText or Device.loadPtx.
Fields
| Field | Type | Description |
|---|---|---|
cu_module | cuda.CUmodule | Underlying CUDA driver module handle |
getFunc
Function handle. Uses cuModuleGetFunction internally.
The loaded PTX module to query.
The C-linkage name of the kernel function (without name mangling). Must match the symbol as it appears in the compiled PTX.
CudaError.Error!Function
The kernel must be declared with
extern "C" linkage in your CUDA source to prevent C++ name mangling. The typical declaration is extern "C" __global__ void my_kernel(...). The name string you pass to getFunc must match this symbol exactly.Example
Function
A Function is a handle to a single __global__ kernel entry point within a loaded Module. You use it to launch the kernel on the GPU.
Fields
| Field | Type | Description |
|---|---|---|
cu_func | cuda.CUfunction | Underlying CUDA driver function handle |
run
cuLaunchKernel. Grid and block dimensions are taken from cfg. The kernel arguments are passed via params, which must be a struct literal where each field is a pointer to a kernel argument value.
The kernel function handle to launch.
A struct literal whose fields are pointers to the kernel arguments, in the same order as the kernel’s C parameter list. Must be a struct — arrays are rejected at compile time.
Grid and block dimensions and shared memory size for this launch. See LaunchConfig.
CudaError.Error!void