pub struct TestPipeline<SrcClk: PlatformClock> { /* private fields */ }Expand description
concrete graph implementation used for testing.
Implementations§
Source§impl<SrcClk: PlatformClock> TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> TestPipeline<SrcClk>
Sourcepub 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_0: TestSpscRingBuf<32>,
q_1: TestSpscRingBuf<32>,
mgr_0: StaticMemoryManager<TestTensor, 35>,
mgr_1: StaticMemoryManager<TestTensor, 35>,
) -> Self
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_0: TestSpscRingBuf<32>, q_1: TestSpscRingBuf<32>, mgr_0: StaticMemoryManager<TestTensor, 35>, mgr_1: StaticMemoryManager<TestTensor, 35>, ) -> Self
Returns a TestPipeline graph given the nodes and edges.
Trait Implementations§
Source§impl<SrcClk: PlatformClock> GraphApi<3, 3> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphApi<3, 3> for TestPipeline<SrcClk>
Source§fn get_node_descriptors(&self) -> [NodeDescriptor; 3]
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]
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]
fn get_node_policies(&self) -> [NodePolicy; 3]
Returns the static
NodePolicy for every node in the graph. Read moreSource§fn get_edge_policies(&self) -> [EdgePolicy; 3]
fn get_edge_policies(&self) -> [EdgePolicy; 3]
Returns the static
EdgePolicy for every edge in the graph. Read moreSource§fn edge_occupancy_for<const E: usize>(
&self,
) -> Result<EdgeOccupancy, GraphError>
fn edge_occupancy_for<const E: usize>( &self, ) -> Result<EdgeOccupancy, GraphError>
Returns a one-shot occupancy snapshot for edge
E. Read moreSource§fn write_all_edge_occupancies(
&self,
out: &mut [EdgeOccupancy; 3],
) -> Result<(), GraphError>
fn write_all_edge_occupancies( &self, out: &mut [EdgeOccupancy; 3], ) -> Result<(), GraphError>
Write current occupancy for all edges into
out. Read moreSource§fn refresh_occupancies_for_node<const I: usize, const IN: usize, const OUT: usize>(
&self,
out: &mut [EdgeOccupancy; 3],
) -> Result<(), GraphError>
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 moreSource§fn step_node_by_index<C, T>(
&mut self,
index: usize,
clock: &C,
telemetry: &mut T,
) -> Result<StepResult, NodeError>
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 moreSource§fn validate_graph(&self) -> Result<(), GraphError>
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,
) -> NodePolicywhere
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>,
fn node_policy_for<const I: usize, const IN: usize, const OUT: usize>(
&self,
) -> NodePolicywhere
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>,
Source§impl<SrcClk: PlatformClock> GraphEdgeAccess<1> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphEdgeAccess<1> for TestPipeline<SrcClk>
Source§impl<SrcClk: PlatformClock> GraphEdgeAccess<2> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphEdgeAccess<2> for TestPipeline<SrcClk>
Source§impl<SrcClk: PlatformClock> GraphNodeAccess<0> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphNodeAccess<0> for TestPipeline<SrcClk>
Source§impl<SrcClk: PlatformClock> GraphNodeAccess<1> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphNodeAccess<1> for TestPipeline<SrcClk>
Source§impl<SrcClk: PlatformClock> GraphNodeAccess<2> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphNodeAccess<2> for TestPipeline<SrcClk>
Source§impl<SrcClk: PlatformClock> GraphNodeContextBuilder<0, 0, 1> for TestPipeline<SrcClk>where
Self: GraphNodeAccess<0, Node = NodeLink<SourceNode<TestCounterSourceTensor<SrcClk, 32>, TestTensor, 1>, 0, 1, (), TestTensor>>,
impl<SrcClk: PlatformClock> GraphNodeContextBuilder<0, 0, 1> for TestPipeline<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>
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>
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>
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> GraphNodeContextBuilder<1, 1, 1> for TestPipeline<SrcClk>where
Self: GraphNodeAccess<1, Node = NodeLink<TestIdentityModelNodeTensor<TEST_MAX_BATCH>, 1, 1, TestTensor, TestTensor>>,
impl<SrcClk: PlatformClock> GraphNodeContextBuilder<1, 1, 1> for TestPipeline<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>
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>
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>
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> GraphNodeContextBuilder<2, 1, 0> for TestPipeline<SrcClk>where
Self: GraphNodeAccess<2, Node = NodeLink<SinkNode<TestSinkNodeTensor, TestTensor, 1>, 1, 0, TestTensor, ()>>,
impl<SrcClk: PlatformClock> GraphNodeContextBuilder<2, 1, 0> for TestPipeline<SrcClk>where
Self: GraphNodeAccess<2, Node = NodeLink<SinkNode<TestSinkNodeTensor, TestTensor, 1>, 1, 0, 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, 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>
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>
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>
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> GraphNodeTypes<0, 0, 1> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphNodeTypes<0, 0, 1> for TestPipeline<SrcClk>
Source§impl<SrcClk: PlatformClock> GraphNodeTypes<1, 1, 1> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphNodeTypes<1, 1, 1> for TestPipeline<SrcClk>
Source§type InP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>
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>
type OutP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>
Payload type for messages produced by the node.
Source§type InQ = TestSpscRingBuf<32>
type InQ = TestSpscRingBuf<32>
Queue type used for input ports.
Source§type OutQ = TestSpscRingBuf<32>
type OutQ = TestSpscRingBuf<32>
Queue type used for output ports.
Source§impl<SrcClk: PlatformClock> GraphNodeTypes<2, 1, 0> for TestPipeline<SrcClk>
impl<SrcClk: PlatformClock> GraphNodeTypes<2, 1, 0> for TestPipeline<SrcClk>
Source§type InP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>
type InP = Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>
Payload type for messages consumed by the node.
Source§type InQ = TestSpscRingBuf<32>
type InQ = TestSpscRingBuf<32>
Queue type used for input ports.
Source§type InM = StaticMemoryManager<Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, 35>
type InM = StaticMemoryManager<Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, 35>
Memory manager type for input ports.
Source§type OutM = StaticMemoryManager<(), 1>
type OutM = StaticMemoryManager<(), 1>
Memory manager type for output ports.
Auto Trait Implementations§
impl<SrcClk> !Freeze for TestPipeline<SrcClk>
impl<SrcClk> !RefUnwindSafe for TestPipeline<SrcClk>
impl<SrcClk> Send for TestPipeline<SrcClk>where
SrcClk: Send,
impl<SrcClk> !Sync for TestPipeline<SrcClk>
impl<SrcClk> Unpin for TestPipeline<SrcClk>where
SrcClk: Unpin,
impl<SrcClk> UnsafeUnpin for TestPipeline<SrcClk>where
SrcClk: UnsafeUnpin,
impl<SrcClk> UnwindSafe for TestPipeline<SrcClk>where
SrcClk: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more