Adds a kernel invocation node to this graph, [`KernelInvocation`] can be created using [`kernel_invocation`] which uses the same syntax as [`launch`](crate::launch). This will place the node after its dependencies (which will execute before it).
(
&mut self,
invocation: KernelInvocation,
dependencies: impl AsRef<[GraphNode]>,
)
| 373 | /// [`kernel_invocation`] which uses the same syntax as [`launch`](crate::launch). This will |
| 374 | /// place the node after its dependencies (which will execute before it). |
| 375 | pub fn add_kernel_node( |
| 376 | &mut self, |
| 377 | invocation: KernelInvocation, |
| 378 | dependencies: impl AsRef<[GraphNode]>, |
| 379 | ) -> CudaResult<GraphNode> { |
| 380 | let deps = dependencies.as_ref(); |
| 381 | self.check_deps_are_valid("add_kernel_node", deps)?; |
| 382 | // invalidate cache because it will change. |
| 383 | self.node_cache = None; |
| 384 | unsafe { |
| 385 | let deps_ptr = deps.as_ptr().cast(); |
| 386 | let mut node = MaybeUninit::<GraphNode>::uninit(); |
| 387 | let params = invocation.to_raw(); |
| 388 | cuda::cuGraphAddKernelNode( |
| 389 | node.as_mut_ptr().cast(), |
| 390 | self.raw, |
| 391 | deps_ptr, |
| 392 | deps.len(), |
| 393 | ¶ms as *const _, |
| 394 | ) |
| 395 | .to_result()?; |
| 396 | Ok(node.assume_init()) |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | /// The number of edges (dependency edges) inside this graph. |
| 401 | pub fn num_edges(&mut self) -> CudaResult<usize> { |
nothing calls this directly
no test coverage detected