Function cust::quick_init
source · [−]pub fn quick_init() -> CudaResult<Context>
Expand description
Shortcut for initializing the CUDA Driver API and creating a CUDA context with default settings for the first device.
You must keep this context alive while you do further operations or you will get an InvalidContext
error. e.g. using let _ctx = quick_init()?;
.
This is useful for testing or just setting up a basic CUDA context quickly. Users with more
complex needs (multiple devices, custom flags, etc.) should use init
and create their own
context.