Skip to main content

ConditionalCudaGraphSequenceBuilder

Struct ConditionalCudaGraphSequenceBuilder 

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

Builds one dependency-ordered parent graph containing ordinary captured segments, one-shot conditional-IF bodies and conditional-WHILE loops.

Stratified Datalog uses this topology so work before a recursive strongly connected component executes once, only that component is placed in a device-controlled WHILE, and later strata depend on its completion. An IF body instead admits or skips a whole bounded step after its device preflight. The finished value launches through one cuGraphLaunch.

Implementations§

Source§

impl ConditionalCudaGraphSequenceBuilder

Source

pub fn new(stream: &CudaStream) -> Result<Self, CudaConditionalGraphUnavailable>

Create an empty parent graph bound to stream’s CUDA context.

Source

pub fn capture_segment_on_stream<F, E>( &mut self, stream: &CudaStream, record: F, ) -> Result<(), CudaConditionalGraphUnavailable>
where F: FnOnce() -> Result<(), E>, E: Display,

Capture one ordinary graph segment after the current dependency frontier. The callback may enqueue only capture-compatible operations. Capture setup and cleanup may wait for deferred destruction under the module-level lifecycle contract.

Source

pub fn add_conditional_while<F>( &mut self, initial_value: u32, assign_default_on_launch: bool, populate_body: F, ) -> Result<CUgraphConditionalHandle, CudaConditionalGraphUnavailable>

Append one conditional-WHILE node after the current frontier.

Source

pub fn add_conditional_if<P, F, E>( &mut self, stream: &CudaStream, preflight: P, populate_body: F, ) -> Result<CUgraphConditionalHandle, CudaConditionalGraphUnavailable>

Capture a device admission test, then execute its body at most once.

The preflight receives the actual graph handle and must set it on every replay. Its nodes precede the IF node on the same dependency frontier; a rejected step never enters the body. The handle defaults to false on each launch. Neither callback runs when the finished graph is replayed.

Source

pub fn instantiate( self, ) -> Result<CapturedCudaGraph, CudaConditionalGraphUnavailable>

Instantiate the complete parent graph exactly once.

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> Same for T

Source§

type Output = T

Should always be Self
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.