MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / init

Function init

crates/cust/src/lib.rs:105–107  ·  view source on GitHub ↗

Initialize the CUDA Driver API. This must be called before any other custa function is called. Typically, this should be at the start of your program. All other functions will fail unless the API is initialized first. The `flags` parameter is used to configure the CUDA API. Currently no flags are defined, so it must be `CudaFlags::empty()`.

(flags: CudaFlags)

Source from the content-addressed store, hash-verified

103/// The `flags` parameter is used to configure the CUDA API. Currently no flags are defined, so
104/// it must be `CudaFlags::empty()`.
105pub fn init(flags: CudaFlags) -> CudaResult<()> {
106 unsafe { cuInit(flags.bits()).to_result() }
107}
108
109/// Shortcut for initializing the CUDA Driver API and creating a CUDA context with default settings
110/// for the first device.

Callers 6

test_initFunction · 0.70
quick_initFunction · 0.70
test_init_twiceFunction · 0.70
mainFunction · 0.50
newMethod · 0.50
newMethod · 0.50

Calls 1

to_resultMethod · 0.45

Tested by 2

test_initFunction · 0.56
test_init_twiceFunction · 0.56