Skip to main content

ParkedGraph

Struct ParkedGraph 

Source
pub struct ParkedGraph<T = Forward> { /* private fields */ }
Expand description

A parked cuGraph graph that can be moved across Rust threads.

Graph<T> itself remains !Send/!Sync because native cuGraph operations require a thread-local entered execution context. ParkedGraph<T> is the transfer state for an idle graph: it owns the native graph pointer, retains runtime-bound handle leases needed for teardown, and carries a CUDA event recorded after tracked work on the parking binding’s stream, plus that binding’s identity. Exact resume requires an entered context for the binding that parked the graph; resume_under executes under a different same-device binding after ordering it behind the park event.

Implementations§

Source§

impl<T> ParkedGraph<T>

Source

pub fn device(&self) -> i32

The CUDA device this parked graph resides on.

Source

pub fn properties(&self) -> GraphProperties

Structural properties declared when this graph was constructed.

Source

pub fn vertex_dtype(&self) -> DataType

The data type of vertex IDs in this graph.

Source

pub fn weight_dtype(&self) -> DataType

The data type of edge weights in this graph.

Source

pub fn resume(self, handle: &EnteredContext<'_>) -> Result<Graph<T>>

Resume this parked graph under a runtime-bound entered context.

Resume is exact-binding by construction: handle must use the cudf runtime stream/MR binding that parked the graph. The runtime stream waits on the park event before the live Graph is returned to the caller. Retained creation leases stay untouched for teardown; use resume_under to execute under a different same-device binding.

If this method returns an error, the consumed parked graph is dropped.

Source

pub fn resume_under(self, handle: &EnteredContext<'_>) -> Result<Graph<T>>

Resume this parked graph under a different runtime-bound execution binding on the same device (storage/execution split).

The resume stream waits on the park event, ordering preceding storage writes before borrower kernels read the graph. Algorithm temporaries allocate through the entering handle, charging workspace, auxiliary streams, and outputs to the borrower domain. cuGraph algorithms observe the graph through a const view: the borrower must not mutate shared storage, and the exclusive checkout guard that owns this parked graph must outlive every kernel launched under the borrower binding. Teardown still runs under the retained creation leases. Re-park with park_under under the same borrower binding.

If this method returns an error, the consumed parked graph is dropped.

Trait Implementations§

Source§

impl<T> Debug for ParkedGraph<T>

Source§

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

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

impl<T> Drop for ParkedGraph<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<T: Send> Send for ParkedGraph<T>

Auto Trait Implementations§

§

impl<T = Forward> !RefUnwindSafe for ParkedGraph<T>

§

impl<T = Forward> !Sync for ParkedGraph<T>

§

impl<T = Forward> !UnwindSafe for ParkedGraph<T>

§

impl<T> Freeze for ParkedGraph<T>
where PhantomData<T>: Freeze,

§

impl<T> Unpin for ParkedGraph<T>
where PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for ParkedGraph<T>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.