Skip to main content

Crate singe_cuda_sys

Crate singe_cuda_sys 

Source
Expand description

Low-level FFI bindings for the CUDA driver and runtime APIs, NVRTC, NVVM, nvJitLink, NVTX, and the CUDA profiler.

Most users want the safe crate, singe-cuda.

§Bindings

BindsHeaderModuleFeature
The CUDA driver APIcuda.hdriverdriver_13_4
The CUDA runtime APIcuda_runtime_api.hruntimeruntime_13_4
CUDA profiler start and stopcudaProfiler.hprofilerdriver_13_4
Data types shared by the CUDA librarieslibrary_types.hlibrary_typesruntime_13_4
NVRTC, which compiles CUDA C++nvrtc.hnvrtcnvrtc_13_4
NVVM, which compiles NVVM IRnvvm.hnvvmnvvm_13_4
nvJitLink, which links device codenvJitLink.hnvjitlinknvjitlink_13_4
NVTX annotationsnvToolsExt.hnvtxnvtx_3

Every feature is on by default. The bindings are generated with bindgen from the CUDA 13.4 and NVTX 3 headers.

§Loading

Nothing links at build time. singe_loader loads each library on the first call of one of its functions, or up front with load_driver, load_runtime, load_nvrtc, load_nvvm, load_nvjitlink, or load_nvtx. When a library or one of its symbols is missing, a function that returns a status returns an error status, and take_absence reports what was missing. A function without a status returns zero, null, or nothing instead. provide_driver and provide_runtime serve the driver and runtime from an in-process implementation instead, such as singe-cuda-emulator.

Modules§

driver
CUDA Driver API declarations for contexts, memory, kernels, and graphs.
library_types
Scalar data types and library property enums shared by NVIDIA libraries.
nvjitlink
CUDA runtime linking library.
nvrtc
NVRTC runtime compilation declarations.
nvtx
NVTX event annotation declarations.
nvvm
NVVM IR compilation and version-query declarations.
profiler
CUDA profiler start and stop declarations.
runtime
CUDA Runtime API declarations and driver-compatible handle aliases.

Enums§

Absence
Why a function could not be called.
LoadError
A library or symbol that would not load.

Functions§

load_driver
Loads the CUDA driver now, instead of on the first call of one of its functions.
load_nvjitlink
Loads nvJitLink now, instead of on the first call of one of its functions.
load_nvrtc
Loads NVRTC now, instead of on the first call of one of its functions.
load_nvtx
Loads NVTX now, instead of on the first call of one of its functions.
load_nvvm
Loads NVVM now, instead of on the first call of one of its functions.
load_runtime
Loads the CUDA runtime now, instead of on the first call of one of its functions.
nvrtc_paths
Returns the path of each NVRTC file, loading NVRTC first if it is not loaded yet.
provide_driver
Serves the CUDA driver’s functions from provider, such as an emulator, instead of loading the driver.
provide_runtime
Serves the CUDA runtime’s functions from provider, such as an emulator, instead of loading the runtime.
take_absence
Returns and clears the absence the last status-returning function called on this thread recorded.

Type Aliases§

Provider
Returns the address of the function a library exports as name, or None if it has none.