File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
samples/introduction/async_api/src Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,11 @@ fn correct_output(data: &[u32], x: u32) -> bool {
2323}
2424
2525fn main ( ) -> Result < ( ) , cust:: error:: CudaError > {
26- cust :: init ( CudaFlags :: empty ( ) ) . expect ( "Couldn't initialize CUDA environment!" ) ;
27-
26+ // Set up the context, load the module, and create a stream to run kernels in.
27+ let _ctx = cust :: quick_init ( ) ;
2828 let device = Device :: get_device ( 0 ) . expect ( "Couldn't find Cuda supported devices!" ) ;
29-
3029 println ! ( "Device Name: {}" , device. name( ) . unwrap( ) ) ;
3130
32- // Set up the context, load the module, and create a stream to run kernels in.
33- let _ctx = Context :: new ( device) ;
3431 let module = Module :: from_ptx ( PTX , & [ ] ) . expect ( "Module couldn't be init!" ) ;
3532 let increment = module
3633 . get_function ( "increment" )
You can’t perform that action at this time.
0 commit comments