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

Method nodes

crates/cust/src/graph.rs:300–316  ·  view source on GitHub ↗

Get all of the nodes in this graph.

(&mut self)

Source from the content-addressed store, hash-verified

298
299 /// Get all of the nodes in this graph.
300 pub fn nodes(&mut self) -> CudaResult<&[GraphNode]> {
301 if self.node_cache.is_none() {
302 unsafe {
303 let mut len = self.num_nodes()?;
304 let mut vec = Vec::with_capacity(len);
305 cuda::cuGraphGetNodes(
306 self.raw,
307 vec.as_mut_ptr() as *mut cuda::CUgraphNode,
308 &mut len as *mut usize,
309 )
310 .to_result()?;
311 vec.set_len(len);
312 self.node_cache = Some(vec);
313 }
314 }
315 Ok(self.node_cache.as_ref().unwrap())
316 }
317
318 /// Creates a new graph from some flags.
319 pub fn new(flags: GraphCreationFlags) -> CudaResult<Self> {

Callers 1

is_valid_nodeMethod · 0.80

Calls 4

num_nodesMethod · 0.80
to_resultMethod · 0.45
as_mut_ptrMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected