Skip to main content

GraphOp

Trait GraphOp 

Source
pub trait GraphOp: Send + 'static {
    // Required method
    fn record(&mut self, ctx: &mut GraphRecordCtx<'_>) -> Result<(), GpuError>;

    // Provided method
    fn op_name(&self) -> &'static str { ... }
}
Expand description

A single op in a graph script.

Each op records itself onto the captured stream. The op is owned by the script — record takes &mut self so an op may stash temporaries (e.g. a borrowed-out Arc<DeviceSlice>) for the lifetime of the recording. After record returns, the op is dropped.

Required Methods§

Source

fn record(&mut self, ctx: &mut GraphRecordCtx<'_>) -> Result<(), GpuError>

Record this op into the captured stream. Called once per op during graph build; the resulting CUDA graph is then instantiated and replayed.

Provided Methods§

Source

fn op_name(&self) -> &'static str

Display name for telemetry / error messages. Defaults to a generic label so trivial impls don’t need to override.

Trait Implementations§

Source§

impl GraphOp for Box<dyn GraphOp>

Source§

fn record(&mut self, ctx: &mut GraphRecordCtx<'_>) -> Result<(), GpuError>

Record this op into the captured stream. Called once per op during graph build; the resulting CUDA graph is then instantiated and replayed.
Source§

fn op_name(&self) -> &'static str

Display name for telemetry / error messages. Defaults to a generic label so trivial impls don’t need to override.

Implementations on Foreign Types§

Source§

impl GraphOp for Box<dyn GraphOp>

Source§

fn record(&mut self, ctx: &mut GraphRecordCtx<'_>) -> Result<(), GpuError>

Source§

fn op_name(&self) -> &'static str

Implementors§