Skip to main content

GraphExec

Struct GraphExec 

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

An instantiated (executable) CUDA graph.

Implementations§

Source§

impl GraphExec

Source

pub fn launch(&self, stream: &Stream) -> Result<()>

Launch this graph on stream. Can be called repeatedly — that’s the whole point of CUDA graphs.

Source

pub fn as_raw(&self) -> CUgraphExec

Raw CUgraphExec. Use with care.

Source

pub fn update(&self, new_template: &Graph) -> Result<UpdateResult>

Try to update this executable graph in place based on a new template graph. Returns Ok(info) in all cases — inspect UpdateResult to distinguish success from the various reasons CUDA refused the update. On refusal, the executable graph is left unchanged (not corrupted), so the caller can fall back to re-instantiating.

Only topology-invariant changes are allowed (same number + type of nodes, same dependency edges). Changes to kernel arguments, grid dims, memset values, memcpy params, etc. are supported.

Source

pub unsafe fn set_kernel_node_params( &self, node: GraphNode, params: &CUDA_KERNEL_NODE_PARAMS, ) -> Result<()>

Live-edit a kernel-node’s parameters on the instantiated graph. Avoids re-instantiation when only arg values / grid dims / shmem change. The topology must match (no new nodes, no new edges).

§Safety

Same launch invariants as crate::LaunchBuilder::launch.

Source

pub fn set_memcpy_node_params( &self, node: GraphNode, params: &CUDA_MEMCPY3D, ) -> Result<()>

Live-edit a memcpy-node’s parameters on the instantiated graph.

Source

pub fn set_memset_node_params( &self, node: GraphNode, params: &CUDA_MEMSET_NODE_PARAMS, ) -> Result<()>

Live-edit a memset-node’s parameters on the instantiated graph.

Source

pub unsafe fn set_host_node_params( &self, node: GraphNode, fn_: unsafe extern "C" fn(*mut c_void), user_data: *mut c_void, ) -> Result<()>

Live-edit a host-node’s callback on the instantiated graph.

§Safety

fn_ must remain callable with user_data for the lifetime of this GraphExec.

Trait Implementations§

Source§

impl Clone for GraphExec

Source§

fn clone(&self) -> GraphExec

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 GraphExec

Source§

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

Formats the value using the given formatter. Read more

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.