pub struct GraphNode { /* private fields */ }Implementations§
Source§impl GraphNode
impl GraphNode
Sourcepub const unsafe fn from_raw(handle: cudaGraphNode_t) -> Self
pub const unsafe fn from_raw(handle: cudaGraphNode_t) -> Self
Wraps an existing CUDA graph node handle.
The returned node is not associated with any Graph identity, so
graph and executable-graph methods cannot validate that it belongs to
the target graph before calling CUDA.
§Safety
handle must be a valid CUDA graph node handle. The caller must ensure
the node remains valid for every operation using the returned token and
that it belongs to the graph or executable graph passed to those
operations.
Sourcepub fn node_type(&self) -> Result<GraphNodeType>
pub fn node_type(&self) -> Result<GraphNodeType>
Returns the node type.
Graph objects are not threadsafe.
§Errors
Returns an error if CUDA cannot query the node type or if a previous asynchronous launch
reported an error. CUDA may also return initialization-related errors such as
crate::error::Status::NotInitialized, crate::error::Status::CallRequiresNewerDriver, or
crate::error::Status::NoDevice if this call initializes internal runtime state. Callbacks must not
call CUDA functions; see Stream::add_callback.
Sourcepub fn dependencies(&self) -> Result<Vec<GraphDependency>>
pub fn dependencies(&self) -> Result<Vec<GraphDependency>>
Returns this node’s dependencies.
Graph objects are not threadsafe.
§Errors
Returns an error if CUDA cannot query the dependencies, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn dependent_nodes(&self) -> Result<Vec<GraphDependency>>
pub fn dependent_nodes(&self) -> Result<Vec<GraphDependency>>
Returns this node’s dependent nodes.
Graph objects are not threadsafe.
§Errors
Returns an error if CUDA cannot query the dependent nodes, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn event_record_node_event(&self) -> Result<cudaEvent_t>
pub fn event_record_node_event(&self) -> Result<cudaEvent_t>
Returns the event of this event record node.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not an event-record node, CUDA cannot query the event, CUDA returns a null event handle, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn event_wait_node_event(&self) -> Result<cudaEvent_t>
pub fn event_wait_node_event(&self) -> Result<cudaEvent_t>
Returns the event of this event wait node.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not an event-wait node, CUDA cannot query the event, CUDA returns a null event handle, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn child_graph(&self) -> Result<BorrowedGraph<'_>>
pub fn child_graph(&self) -> Result<BorrowedGraph<'_>>
Returns a borrowed handle to the embedded graph in a child graph node.
This does not clone the graph.
Changes to the returned graph are reflected in the node, and the child
node retains ownership of the embedded graph handle.
The returned BorrowedGraph is tied to this node borrow and does not
destroy the embedded graph when dropped.
Allocation and free nodes cannot be added to the returned graph. Attempting to do so returns an error.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not a child-graph node, CUDA cannot query the child graph, CUDA returns a null graph handle, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn memcpy_node_params(&self) -> Result<cudaMemcpy3DParms>
pub fn memcpy_node_params(&self) -> Result<cudaMemcpy3DParms>
Returns the parameters of this memcpy node.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not a memcpy node, CUDA cannot query the parameters, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn memset_node_params(&self) -> Result<CUDA_MEMSET_NODE_PARAMS>
pub fn memset_node_params(&self) -> Result<CUDA_MEMSET_NODE_PARAMS>
Returns the parameters of this memset node.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not a memset node, CUDA cannot query the parameters, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn host_node_params(&self) -> Result<CUDA_HOST_NODE_PARAMS>
pub fn host_node_params(&self) -> Result<CUDA_HOST_NODE_PARAMS>
Returns the parameters of this host node.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not a host node, CUDA cannot query the parameters, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub fn mem_alloc_node_info(&self) -> Result<MemoryAllocationNodeInfo>
pub fn mem_alloc_node_info(&self) -> Result<MemoryAllocationNodeInfo>
Returns the parameters of a memory allocation node.
The poolProps and accessDescs values in the returned parameters are owned by the node.
This memory remains valid until the node is destroyed.
The returned parameters must not be modified.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not a memory-allocation node, CUDA cannot query the parameters, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
Sourcepub unsafe fn mem_free_node_ptr(&self) -> Result<DevicePtr>
pub unsafe fn mem_free_node_ptr(&self) -> Result<DevicePtr>
Returns the address of this memory free node.
Graph objects are not threadsafe.
§Errors
Returns an error if this is not a memory-free node, CUDA cannot query the pointer, a previous asynchronous launch reports an error, or CUDA reports runtime initialization diagnostics.
§Safety
The node must still be a valid memory-free node in a live graph, and the returned pointer must not be used after the graph frees it.
Sourcepub fn kernel_node_attribute(
self,
id: GraphKernelNodeAttributeId,
) -> Result<GraphKernelNodeAttribute>
pub fn kernel_node_attribute( self, id: GraphKernelNodeAttributeId, ) -> Result<GraphKernelNodeAttribute>
Returns the requested kernel node attribute.
§Errors
Returns an error if this is not a kernel node, CUDA cannot query the attribute, or a previous asynchronous launch reports an error.
Sourcepub fn set_kernel_node_attribute(
&mut self,
attribute: GraphKernelNodeAttribute,
) -> Result<()>
pub fn set_kernel_node_attribute( &mut self, attribute: GraphKernelNodeAttribute, ) -> Result<()>
Sets a kernel node attribute.
§Errors
Returns an error if this is not a kernel node, CUDA rejects the attribute update, or a previous asynchronous launch reports an error.
Sourcepub fn copy_kernel_node_attributes(self, other: Self) -> Result<()>
pub fn copy_kernel_node_attributes(self, other: Self) -> Result<()>
Copies attributes from src to this node.
Both nodes must have the same context.
§Errors
Returns an error if CUDA rejects the attribute copy or if a previous asynchronous launch reported an error.