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

Method launch

crates/cust/src/stream.rs:250–279  ·  view source on GitHub ↗
(
        &self,
        func: &Function,
        grid_size: G,
        block_size: B,
        shared_mem_bytes: u32,
        args: &[*mut c_void],
    )

Source from the content-addressed store, hash-verified

248 // Hidden implementation detail function. Highly unsafe. Use the `launch!` macro instead.
249 #[doc(hidden)]
250 pub unsafe fn launch<G, B>(
251 &self,
252 func: &Function,
253 grid_size: G,
254 block_size: B,
255 shared_mem_bytes: u32,
256 args: &[*mut c_void],
257 ) -> CudaResult<()>
258 where
259 G: Into<GridSize>,
260 B: Into<BlockSize>,
261 {
262 let grid_size: GridSize = grid_size.into();
263 let block_size: BlockSize = block_size.into();
264
265 cuda::cuLaunchKernel(
266 func.to_raw(),
267 grid_size.x,
268 grid_size.y,
269 grid_size.z,
270 block_size.x,
271 block_size.y,
272 block_size.z,
273 shared_mem_bytes,
274 self.inner,
275 args.as_ptr() as *mut _,
276 ptr::null_mut(),
277 )
278 .to_result()
279 }
280
281 // Get the inner `CUstream` from the `Stream`. If you use this handle elsewhere,
282 // make sure not to use it after the stream has been dropped. Or ManuallyDrop the struct to be safe.

Callers

nothing calls this directly

Calls 3

as_ptrMethod · 0.80
to_resultMethod · 0.45
to_rawMethod · 0.45

Tested by

no test coverage detected