Skip to main content

cuda_init_device

Function cuda_init_device 

Source
pub unsafe extern "C" fn cuda_init_device(device_id: c_int) -> c_int
Expand description

Initialize CUDA device for ring buffer operations.

§Safety

This function is unsafe because it:

  • Modifies global CUDA state
  • Must be called before any other CUDA operations
  • Can fail if device doesn’t exist or is unavailable

§Arguments

  • device_id - CUDA device index (typically 0)

§Returns

  • 0: Success
  • -1: Device initialization failed
  • -2: Invalid device ID