Skip to main content

Module init

Module init 

Source
Expand description

Runtime-API initialization helpers.

The CUDA Runtime API initializes lazily on first use (typically when you call cudaSetDevice), so there’s no explicit init() you must call. The helpers here exist for fail-fast setup: version queries, cudaInitDevice for pre-warming the primary context without making it current, etc.

Functions§

device_synchronize
Block the calling host thread until all work on the current device has completed. Equivalent to cudaDeviceSynchronize.
driver_version
CUDA driver version (latest supported by the installed libcuda).
get_device_flags
Query current device-scheduling flags.
last_error
Retrieve and clear the per-thread “sticky” error from the runtime.
peek_last_error
As last_error but doesn’t clear the sticky slot.
runtime_version
CUDA Runtime version linked via libcudart.
set_device_flags
Set the process’s device-level scheduling/map flags. Typically called before the first CUDA call on the current thread — the flags bind when the primary context is created. Passes are flags from baracuda_cuda_sys::runtime::types::cudaDeviceScheduleFlags.