Skip to main content

CudaGraph

Struct CudaGraph 

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

A captured CUDA graph that can be replayed with minimal dispatch overhead.

Created via cuda_graph_capture or manually with new() + capture_begin() / capture_end().

Implementations§

Source§

impl CudaGraph

Source

pub fn new() -> Result<Self>

Create a new empty CUDA graph. Errors on CPU-only builds.

Source

pub fn capture_begin( &mut self, pool: Option<MemPoolId>, mode: CaptureMode, ) -> Result<()>

Begin capturing GPU operations into this graph.

All CUDA kernel launches on the current stream after this call will be recorded until capture_end.

Source

pub fn capture_end(&mut self) -> Result<()>

End capture and finalize the graph.

Source

pub fn replay(&self) -> Result<()>

Replay the captured graph. All kernels are launched with a single CUDA API call, eliminating per-kernel dispatch overhead.

Source

pub fn reset(&mut self) -> Result<()>

Reset the graph, allowing recapture.

Source

pub fn pool(&self) -> MemPoolId

Get the memory pool ID for this graph.

Trait Implementations§

Source§

impl Drop for CudaGraph

Source§

fn drop(&mut self)

Executes the destructor for this type. 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> 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, 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.