Skip to main content

GraphNode

Struct GraphNode 

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

A node inside a Graph. Lightweight handle that borrows the parent graph’s storage — destroying the graph invalidates all of its nodes.

GraphNode is Copy so you can use a single node as a dependency of many successors without cloning.

Implementations§

Source§

impl GraphNode

Source

pub fn as_raw(&self) -> CUgraphNode

Raw CUgraphNode. Use with care.

Source

pub fn node_type(&self) -> Result<c_int>

Return the CUgraphNodeType code for this node. Compare against constants in baracuda_cuda_sys::types::CUgraphNodeType.

Source

pub fn dependencies(&self) -> Result<Vec<GraphNode>>

Return this node’s upstream dependencies.

Source

pub fn dependent_nodes(&self) -> Result<Vec<GraphNode>>

Return nodes that depend on this node.

Source

pub fn kernel_params(&self) -> Result<CUDA_KERNEL_NODE_PARAMS>

Fetch current kernel-node params (kernel-node nodes only).

Source

pub unsafe fn set_kernel_params( &self, params: &CUDA_KERNEL_NODE_PARAMS, ) -> Result<()>

Overwrite this kernel-node’s params on the template graph (not the instantiated exec — use GraphExec::set_kernel_node_params for live edit).

§Safety

The caller ensures the new params describe a valid kernel launch — same kind of invariants as crate::LaunchBuilder::launch.

Source

pub unsafe fn set_params(&self, params: &mut CUgraphNodeParams) -> Result<()>

Generic params edit on the template graph — works for any node kind (kernel, memcpy, memset, child-graph, host, …) by reading the type_ field of CUgraphNodeParams and dispatching to the matching internal setter. CUDA 12.3+.

§Safety

The type_ discriminant in params must match the node’s actual kind, and the union payload must be initialized for that type.

Source

pub fn memset_params(&self) -> Result<CUDA_MEMSET_NODE_PARAMS>

Fetch current memset-node params (memset-node nodes only).

Source

pub fn set_memset_params(&self, params: &CUDA_MEMSET_NODE_PARAMS) -> Result<()>

Overwrite this memset-node’s params on the template graph.

Source

pub fn mem_free_ptr(&self) -> Result<CUdeviceptr>

Fetch the device pointer this MemFree node will free. Only valid on nodes of type CUgraphNodeType::MEM_FREE.

Source

pub fn mem_alloc_params(&self) -> Result<CUDA_MEM_ALLOC_NODE_PARAMS>

Fetch the full mem-alloc-node params (pool props + bytesize + the output dptr CUDA will write into at execute time).

Source

pub fn memcpy_params(&self) -> Result<CUDA_MEMCPY3D>

Fetch current memcpy-node params.

Source

pub fn set_memcpy_params(&self, params: &CUDA_MEMCPY3D) -> Result<()>

Overwrite this memcpy-node’s params on the template graph.

Source

pub unsafe fn destroy(self) -> Result<()>

Explicitly destroy this node inside its parent graph. Usually you just drop the Graph to clean up everything at once; this is only useful for surgically editing a graph mid-construction.

§Safety

The caller must not use this GraphNode (or any dependency-list reference to it) after calling this function.

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 Copy for GraphNode

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<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> 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.