Skip to main content

TestPipelineStd

Struct TestPipelineStd 

Source
pub struct TestPipelineStd<SrcClk: PlatformClock + Send + 'static> { /* private fields */ }
Expand description

Concrete std graph using ConcurrentEdge (Arc-backed, Clone+Send+Sync).

Mirrors the output of a concurrent(true) codegen invocation. Ingress edges are not stored: occupancy and policy are obtained from the source node at runtime, matching codegen output exactly.

Implementations§

Source§

impl<SrcClk: PlatformClock + Send + 'static> TestPipelineStd<SrcClk>

Source

pub fn new( node_0: impl Into<SourceNode<TestCounterSourceTensor<SrcClk, 32>, TestTensor, 1>>, node_1: TestIdentityModelNodeTensor<TEST_MAX_BATCH>, node_2: impl Into<SinkNode<TestSinkNodeTensor, TestTensor, 1>>, q_1: ConcurrentEdge, q_2: ConcurrentEdge, mgr_1: ConcurrentMemoryManager<TestTensor>, mgr_2: ConcurrentMemoryManager<TestTensor>, ) -> Self

Construct a new concurrent graph instance.

Mirrors the new(..) constructor emitted by codegen for a concurrent(true) graph. Ingress probe edges are not created here — ingress occupancy and policy are read directly from the source node.

Trait Implementations§

Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphApi<3, 3> for TestPipelineStd<SrcClk>

Source§

fn get_node_descriptors(&self) -> [NodeDescriptor; 3]

Returns the static descriptors for all nodes in the graph. Read more
Source§

fn get_edge_descriptors(&self) -> [EdgeDescriptor; 3]

Returns the static descriptors for all edges in the graph. Read more
Source§

fn get_node_policies(&self) -> [NodePolicy; 3]

Returns the static NodePolicy for every node in the graph. Read more
Source§

fn get_edge_policies(&self) -> [EdgePolicy; 3]

Returns the static EdgePolicy for every edge in the graph. Read more
Source§

fn edge_occupancy_for<const E: usize>( &self, ) -> Result<EdgeOccupancy, GraphError>

Returns a one-shot occupancy snapshot for edge E. Read more
Source§

fn write_all_edge_occupancies( &self, out: &mut [EdgeOccupancy; 3], ) -> Result<(), GraphError>

Write current occupancy for all edges into out. Read more
Source§

fn refresh_occupancies_for_node<const I: usize, const IN: usize, const OUT: usize>( &self, out: &mut [EdgeOccupancy; 3], ) -> Result<(), GraphError>

Partial refresh: update only entries for edges incident to node I. Read more
Source§

fn step_node_by_index<C, T>( &mut self, index: usize, clock: &C, telemetry: &mut T, ) -> Result<StepResult, NodeError>

Drives a single scheduling step for the node at index. Read more
Source§

fn validate_graph(&self) -> Result<(), GraphError>

Validates the graph topology and policies derived from node and edge descriptors. Read more
Source§

fn node_policy_for<const I: usize, const IN: usize, const OUT: usize>( &self, ) -> NodePolicy
where Self: GraphNodeAccess<I> + GraphNodeTypes<I, IN, OUT>, <Self as GraphNodeAccess<I>>::Node: Node<IN, OUT, <Self as GraphNodeTypes<I, IN, OUT>>::InP, <Self as GraphNodeTypes<I, IN, OUT>>::OutP>,

Returns the static NodePolicy for node I (compile-time index). Read more
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphEdgeAccess<1> for TestPipelineStd<SrcClk>

Source§

type Edge = EdgeLink<ConcurrentEdge>

The concrete edge type at index E.
Source§

fn edge_ref(&self) -> &Self::Edge

Immutable access to the edge at index E.
Source§

fn edge_mut(&mut self) -> &mut Self::Edge

Mutable access to the edge at index E.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphEdgeAccess<2> for TestPipelineStd<SrcClk>

Source§

type Edge = EdgeLink<ConcurrentEdge>

The concrete edge type at index E.
Source§

fn edge_ref(&self) -> &Self::Edge

Immutable access to the edge at index E.
Source§

fn edge_mut(&mut self) -> &mut Self::Edge

Mutable access to the edge at index E.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeAccess<0> for TestPipelineStd<SrcClk>

Source§

type Node = NodeLink<SourceNode<TestCounterSourceTensor<SrcClk, 32>, Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, 1>, 0, 1, (), Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>>

The concrete node type at index I.
Source§

fn node_ref(&self) -> &Self::Node

Immutable access to the node at index I.
Source§

fn node_mut(&mut self) -> &mut Self::Node

Mutable access to the node at index I.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeAccess<1> for TestPipelineStd<SrcClk>

Source§

type Node = NodeLink<InferenceModel<TestTensorBackend, Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, TEST_MAX_BATCH>, 1, 1, Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>>

The concrete node type at index I.
Source§

fn node_ref(&self) -> &Self::Node

Immutable access to the node at index I.
Source§

fn node_mut(&mut self) -> &mut Self::Node

Mutable access to the node at index I.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeAccess<2> for TestPipelineStd<SrcClk>

Source§

type Node = NodeLink<SinkNode<TestSinkNodeTensor, Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, 1>, 1, 0, Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, ()>

The concrete node type at index I.
Source§

fn node_ref(&self) -> &Self::Node

Immutable access to the node at index I.
Source§

fn node_mut(&mut self) -> &mut Self::Node

Mutable access to the node at index I.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeContextBuilder<0, 0, 1> for TestPipelineStd<SrcClk>
where Self: GraphNodeAccess<0, Node = NodeLink<SourceNode<TestCounterSourceTensor<SrcClk, 32>, TestTensor, 1>, 0, 1, (), TestTensor>>,

Source§

fn make_step_context<'graph, 'telemetry, 'clock, C, T>( &'graph mut self, clock: &'clock C, telemetry: &'telemetry mut T, ) -> StepContext<'graph, 'telemetry, 'clock, 0, 1, <Self as GraphNodeTypes<0, 0, 1>>::InP, <Self as GraphNodeTypes<0, 0, 1>>::OutP, <Self as GraphNodeTypes<0, 0, 1>>::InQ, <Self as GraphNodeTypes<0, 0, 1>>::OutQ, <Self as GraphNodeTypes<0, 0, 1>>::InM, <Self as GraphNodeTypes<0, 0, 1>>::OutM, C, T>

Construct a StepContext for node I. Read more
Source§

fn with_node_and_step_context<'telemetry, 'clock, C, T, R, E>( &mut self, clock: &'clock C, telemetry: &'telemetry mut T, f: impl FnOnce(&mut <Self as GraphNodeAccess<0>>::Node, &mut StepContext<'_, 'telemetry, 'clock, 0, 1, <Self as GraphNodeTypes<0, 0, 1>>::InP, <Self as GraphNodeTypes<0, 0, 1>>::OutP, <Self as GraphNodeTypes<0, 0, 1>>::InQ, <Self as GraphNodeTypes<0, 0, 1>>::OutQ, <Self as GraphNodeTypes<0, 0, 1>>::InM, <Self as GraphNodeTypes<0, 0, 1>>::OutM, C, T>) -> Result<R, E>, ) -> Result<R, E>

Borrowed handoff: in one &mut self borrow, lend both &mut node(I) and a fully wired StepContext to a closure. This avoids overlapping &mut borrows escaping the call.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeContextBuilder<1, 1, 1> for TestPipelineStd<SrcClk>
where Self: GraphNodeAccess<1, Node = NodeLink<TestIdentityModelNodeTensor<TEST_MAX_BATCH>, 1, 1, TestTensor, TestTensor>>,

Source§

fn make_step_context<'graph, 'telemetry, 'clock, C, T>( &'graph mut self, clock: &'clock C, telemetry: &'telemetry mut T, ) -> StepContext<'graph, 'telemetry, 'clock, 1, 1, <Self as GraphNodeTypes<1, 1, 1>>::InP, <Self as GraphNodeTypes<1, 1, 1>>::OutP, <Self as GraphNodeTypes<1, 1, 1>>::InQ, <Self as GraphNodeTypes<1, 1, 1>>::OutQ, <Self as GraphNodeTypes<1, 1, 1>>::InM, <Self as GraphNodeTypes<1, 1, 1>>::OutM, C, T>

Construct a StepContext for node I. Read more
Source§

fn with_node_and_step_context<'telemetry, 'clock, C, T, R, E>( &mut self, clock: &'clock C, telemetry: &'telemetry mut T, f: impl FnOnce(&mut <Self as GraphNodeAccess<1>>::Node, &mut StepContext<'_, 'telemetry, 'clock, 1, 1, <Self as GraphNodeTypes<1, 1, 1>>::InP, <Self as GraphNodeTypes<1, 1, 1>>::OutP, <Self as GraphNodeTypes<1, 1, 1>>::InQ, <Self as GraphNodeTypes<1, 1, 1>>::OutQ, <Self as GraphNodeTypes<1, 1, 1>>::InM, <Self as GraphNodeTypes<1, 1, 1>>::OutM, C, T>) -> Result<R, E>, ) -> Result<R, E>

Borrowed handoff: in one &mut self borrow, lend both &mut node(I) and a fully wired StepContext to a closure. This avoids overlapping &mut borrows escaping the call.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeContextBuilder<2, 1, 0> for TestPipelineStd<SrcClk>

Source§

fn make_step_context<'graph, 'telemetry, 'clock, C, T>( &'graph mut self, clock: &'clock C, telemetry: &'telemetry mut T, ) -> StepContext<'graph, 'telemetry, 'clock, 1, 0, <Self as GraphNodeTypes<2, 1, 0>>::InP, <Self as GraphNodeTypes<2, 1, 0>>::OutP, <Self as GraphNodeTypes<2, 1, 0>>::InQ, <Self as GraphNodeTypes<2, 1, 0>>::OutQ, <Self as GraphNodeTypes<2, 1, 0>>::InM, <Self as GraphNodeTypes<2, 1, 0>>::OutM, C, T>

Construct a StepContext for node I. Read more
Source§

fn with_node_and_step_context<'telemetry, 'clock, C, T, R, E>( &mut self, clock: &'clock C, telemetry: &'telemetry mut T, f: impl FnOnce(&mut <Self as GraphNodeAccess<2>>::Node, &mut StepContext<'_, 'telemetry, 'clock, 1, 0, <Self as GraphNodeTypes<2, 1, 0>>::InP, <Self as GraphNodeTypes<2, 1, 0>>::OutP, <Self as GraphNodeTypes<2, 1, 0>>::InQ, <Self as GraphNodeTypes<2, 1, 0>>::OutQ, <Self as GraphNodeTypes<2, 1, 0>>::InM, <Self as GraphNodeTypes<2, 1, 0>>::OutM, C, T>) -> Result<R, E>, ) -> Result<R, E>

Borrowed handoff: in one &mut self borrow, lend both &mut node(I) and a fully wired StepContext to a closure. This avoids overlapping &mut borrows escaping the call.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeTypes<0, 0, 1> for TestPipelineStd<SrcClk>

Source§

type InP = ()

Payload type for messages consumed by the node.
Source§

type OutP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>

Payload type for messages produced by the node.
Source§

type InQ = NoQueue

Queue type used for input ports.
Source§

type OutQ = ConcurrentEdge

Queue type used for output ports.
Source§

type InM = StaticMemoryManager<(), 1>

Memory manager type for input ports.
Source§

type OutM = ConcurrentMemoryManager<Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>>

Memory manager type for output ports.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeTypes<1, 1, 1> for TestPipelineStd<SrcClk>

Source§

type InP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>

Payload type for messages consumed by the node.
Source§

type OutP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>

Payload type for messages produced by the node.
Source§

type InQ = ConcurrentEdge

Queue type used for input ports.
Source§

type OutQ = ConcurrentEdge

Queue type used for output ports.
Source§

type InM = ConcurrentMemoryManager<Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>>

Memory manager type for input ports.
Source§

type OutM = ConcurrentMemoryManager<Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>>

Memory manager type for output ports.
Source§

impl<SrcClk: PlatformClock + Send + 'static> GraphNodeTypes<2, 1, 0> for TestPipelineStd<SrcClk>

Source§

type InP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>

Payload type for messages consumed by the node.
Source§

type OutP = ()

Payload type for messages produced by the node.
Source§

type InQ = ConcurrentEdge

Queue type used for input ports.
Source§

type OutQ = NoQueue

Queue type used for output ports.
Source§

type InM = ConcurrentMemoryManager<Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>>

Memory manager type for input ports.
Source§

type OutM = StaticMemoryManager<(), 1>

Memory manager type for output ports.
Source§

impl<SrcClk: PlatformClock + Clone + Send + Sync + 'static> ScopedGraphApi<3, 3> for TestPipelineStd<SrcClk>

Source§

fn run_scoped<C, T, S>(&mut self, clock: C, telemetry: T, scheduler: S)
where C: PlatformClock + Clone + Send + Sync + 'static, T: Telemetry + Clone + Send + 'static, S: WorkerScheduler + 'static,

Run the graph concurrently with scheduler-controlled workers. Read more

Auto Trait Implementations§

§

impl<SrcClk> Freeze for TestPipelineStd<SrcClk>
where SrcClk: Freeze,

§

impl<SrcClk> RefUnwindSafe for TestPipelineStd<SrcClk>
where SrcClk: RefUnwindSafe,

§

impl<SrcClk> Send for TestPipelineStd<SrcClk>

§

impl<SrcClk> Sync for TestPipelineStd<SrcClk>
where SrcClk: Sync,

§

impl<SrcClk> Unpin for TestPipelineStd<SrcClk>
where SrcClk: Unpin,

§

impl<SrcClk> UnsafeUnpin for TestPipelineStd<SrcClk>
where SrcClk: UnsafeUnpin,

§

impl<SrcClk> UnwindSafe for TestPipelineStd<SrcClk>
where SrcClk: UnwindSafe,

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.