Skip to main content

GraphNode

Struct GraphNode 

Source
pub struct GraphNode { /* private fields */ }

Implementations§

Source§

impl GraphNode

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn as_raw(&self) -> cudaGraphNode_t

Source

pub fn context(&self) -> Option<&Context>

Trait Implementations§

Source§

impl Clone for GraphNode

Source§

fn clone(&self) -> GraphNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for GraphNode

Source§

impl Hash for GraphNode

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for GraphNode

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.