CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
coreflow::Graph Class Reference

#include <vx_graph.h>

Inheritance diagram for coreflow::Graph:
coreflow::Reference

Public Member Functions

 Graph (vx_context context, vx_reference scope)
 Construct a new Graph object.
 
vx_perf_t performance () const
 Get the graph performance.
 
vx_enum getState () const
 Get the Graph state.
 
vx_uint32 getNumNodes () const
 Get the number of nodes in the graph.
 
vx_uint32 getNumParams () const
 Get the number of parameters of the graph.
 
vx_bool isVerified ()
 Is graph verified.
 
vx_status verify ()
 Verify the graph.
 
vx_status schedule ()
 Schedule the graph.
 
vx_status wait ()
 Wait on the graph to complete.
 
vx_status process ()
 Process the graph.
 
vx_status addParameter (vx_parameter param)
 Add a graph paramter.
 
vx_status setParameterByIndex (vx_uint32 index, vx_reference value)
 Set the graph parameter by index.
 
vx_parameter getParameterByIndex (vx_uint32 index)
 Get the parameter object by index.
 
vx_status pipelineValidateRefsList (const vx_graph_parameter_queue_params_t graph_parameters_queue_param)
 Validate the graph parameters queue references list.
 
void clearVisitation ()
 Clears visited flag.
 
void clearExecution ()
 Clears execution flag.
 
vx_status findNodesWithReference (vx_reference ref, vx_uint32 refnodes[], vx_uint32 *count, vx_enum reftype)
 Find nodes using this reference as input or output parameter. This function starts on the next node in the list and loops until we hit the original node again. Parse over the nodes in circular fashion.
 
void findNextNodes (vx_uint32 last_nodes[VX_INT_MAX_REF], vx_uint32 numLast, vx_uint32 next_nodes[VX_INT_MAX_REF], vx_uint32 *numNext, vx_uint32 left_nodes[VX_INT_MAX_REF], vx_uint32 *numLeft)
 Given a set of last nodes, this function will determine the next set of nodes which are capable of being run. Nodes which are encountered but can't be run will be placed in the left nodes list.
 
void streamingLoop ()
 Streaming loop function.
 
void destruct () override final
 Destruct function for the Graph object.
 
vx_uint32 refCount () const
 Returns the reference count of the object.
 
vx_enum dataType () const
 Returns the type of the reference.
 
const vx_charrefName () const
 Returns the name of the reference.
 
void setName (const vx_char *name)
 Sets the name of the reference.
 
vx_uint32 incrementReference (vx_reftype_e refType)
 Increments the ref count.
 
vx_uint32 decrementReference (vx_reftype_e refType)
 Decrements the ref count.
 
vx_uint32 totalReferenceCount ()
 Returns the total reference count of the object.
 
void initReferenceForDelay (vx_delay delay, vx_int32 index)
 Used to initialize any vx_reference as a delay element.
 

Static Public Member Functions

static vx_graph createGraph (vx_context context)
 Create a graph.
 
static vx_reference createReference (vx_context context, vx_enum type, vx_reftype_e refType, vx_reference scope)
 Used to create a reference.
 
static void printReference (vx_reference ref)
 Prints the values of a reference.
 
static vx_bool isValidReference (vx_reference ref)
 Used to validate everything but vx_context, vx_image and vx_buffer.
 
static vx_bool isValidReference (vx_reference ref, vx_enum type)
 Used to validate everything but vx_context, vx_image and vx_buffer.
 
static vx_size sizeOfType (vx_enum type)
 Returns the number of bytes in the internal structure for a given type.
 
static vx_status releaseReference (vx_reference *ref, vx_enum type, vx_reftype_e reftype, vx_destructor_f special_destructor)
 Used to destroy a reference.
 

Public Attributes

vx_node nodes [VX_INT_MAX_REF]
 The array of all nodes in this graph.
 
vx_perf_t perf
 The performance logging variable.
 
vx_uint32 numNodes
 The number of nodes actively allocated in this graph.
 
vx_uint32 heads [VX_INT_MAX_REF]
 The array of all starting node indexes in the graph.
 
vx_uint32 numHeads
 The number of all nodes in heads list.
 
vx_enum state
 The state of the graph (vx_graph_state_e)
 
vx_bool verified
 This indicates that the graph has been verified.
 
vx_bool reverify
 This indicates that the graph has been verified earlier, but invalidated latter and is need for verification again.
 
vx_sem_t lock
 This lock is used to prevent multiple schedulings (data overwrite)
 
struct { 
 
   vx_node   node 
 The reference to the node which has the parameter. More...
 
   vx_uint32   index 
 The index to the parameter on the node. More...
 
parameters [VX_INT_MAX_PARAMS
 The list of graph parameters.
 
vx_uint32 numParams
 The number of graph parameters.
 
vx_bool shouldSerialize
 A switch to turn off SMP mode.
 
vx_graph parentGraph
 [hidden] If non-NULL, the parent graph, for scope handling.
 
vx_delay delays [VX_INT_MAX_REF]
 The array of all delays in this graph.
 
vx_graph_schedule_mode_type_e scheduleMode
 The graph scheduling mode.
 
struct _vx_platform * platform
 Platform for ICD compatibility.
 
vx_uint32 magic
 Used to validate references, must be set to VX_MAGIC.
 
vx_enum type
 Set to an enum value in vx_type_e.
 
vx_context context
 Pointer to the top level context. If this reference is the context, this will be NULL.
 
vx_reference scope
 The pointer to the object's scope parent. When virtual objects are scoped within a graph, this will point to that parent graph. This is left generic to allow future scoping variations. By default scope should be the same as context.
 
vx_uint32 external_count
 The count of the number of users with this reference. When greater than 0, this can not be freed. When zero, the value can be considered inaccessible.
 
vx_uint32 internal_count
 The count of the number of framework references. When greater than 0, this can not be freed.
 
vx_uint32 read_count
 The number of times the object has been read (in some portion)
 
vx_uint32 write_count
 The number of times the object has been written to (in some portion)
 
void * reserved
 A reserved field which can be used to store anonymous data.
 
vx_bool extracted
 This indicates if the object was extracted from another object.
 
vx_bool is_virtual
 This indicates if the object is virtual or not.
 
vx_delay delay
 
vx_int32 delay_slot_index
 
vx_bool is_accessible
 This indicates that if the object is virtual whether it is accessible at the moment or not.
 
vx_char name [VX_MAX_REFERENCE_NAME]
 The reference name.
 

Member Function Documentation

◆ streamingLoop()

void coreflow::Graph::streamingLoop ( )

Streaming loop function.

Member Data Documentation

◆ context

vx_context coreflow::Reference::context
inherited

Pointer to the top level context. If this reference is the context, this will be NULL.

◆ delay

vx_delay coreflow::Reference::delay
inherited

◆ delay_slot_index

vx_int32 coreflow::Reference::delay_slot_index
inherited

◆ delays

vx_delay coreflow::Graph::delays[VX_INT_MAX_REF]

The array of all delays in this graph.

◆ external_count

vx_uint32 coreflow::Reference::external_count
inherited

The count of the number of users with this reference. When greater than 0, this can not be freed. When zero, the value can be considered inaccessible.

◆ extracted

vx_bool coreflow::Reference::extracted
inherited

This indicates if the object was extracted from another object.

◆ heads

vx_uint32 coreflow::Graph::heads[VX_INT_MAX_REF]

The array of all starting node indexes in the graph.

◆ index

vx_uint32 coreflow::Graph::index

The index to the parameter on the node.

◆ internal_count

vx_uint32 coreflow::Reference::internal_count
inherited

The count of the number of framework references. When greater than 0, this can not be freed.

◆ is_accessible

vx_bool coreflow::Reference::is_accessible
inherited

This indicates that if the object is virtual whether it is accessible at the moment or not.

◆ is_virtual

vx_bool coreflow::Reference::is_virtual
inherited

This indicates if the object is virtual or not.

◆ lock

vx_sem_t coreflow::Graph::lock

This lock is used to prevent multiple schedulings (data overwrite)

◆ magic

vx_uint32 coreflow::Reference::magic
inherited

Used to validate references, must be set to VX_MAGIC.

◆ name

vx_char coreflow::Reference::name[VX_MAX_REFERENCE_NAME]
inherited

The reference name.

◆ node

vx_node coreflow::Graph::node

The reference to the node which has the parameter.

◆ nodes

vx_node coreflow::Graph::nodes[VX_INT_MAX_REF]

The array of all nodes in this graph.

◆ numHeads

vx_uint32 coreflow::Graph::numHeads

The number of all nodes in heads list.

◆ numNodes

vx_uint32 coreflow::Graph::numNodes

The number of nodes actively allocated in this graph.

◆ numParams

vx_uint32 coreflow::Graph::numParams

The number of graph parameters.

◆ [struct]

struct { ... } coreflow::Graph::parameters[VX_INT_MAX_PARAMS]

The list of graph parameters.

◆ parentGraph

vx_graph coreflow::Graph::parentGraph

[hidden] If non-NULL, the parent graph, for scope handling.

◆ perf

vx_perf_t coreflow::Graph::perf

The performance logging variable.

◆ platform

struct _vx_platform* coreflow::Reference::platform
inherited

Platform for ICD compatibility.

◆ read_count

vx_uint32 coreflow::Reference::read_count
inherited

The number of times the object has been read (in some portion)

◆ reserved

void* coreflow::Reference::reserved
inherited

A reserved field which can be used to store anonymous data.

◆ reverify

vx_bool coreflow::Graph::reverify

This indicates that the graph has been verified earlier, but invalidated latter and is need for verification again.

◆ scheduleMode

vx_graph_schedule_mode_type_e coreflow::Graph::scheduleMode

The graph scheduling mode.

◆ scope

vx_reference coreflow::Reference::scope
inherited

The pointer to the object's scope parent. When virtual objects are scoped within a graph, this will point to that parent graph. This is left generic to allow future scoping variations. By default scope should be the same as context.

◆ shouldSerialize

vx_bool coreflow::Graph::shouldSerialize

A switch to turn off SMP mode.

◆ state

vx_enum coreflow::Graph::state

The state of the graph (vx_graph_state_e)

◆ type

vx_enum coreflow::Reference::type
inherited

Set to an enum value in vx_type_e.

◆ verified

vx_bool coreflow::Graph::verified

This indicates that the graph has been verified.

◆ write_count

vx_uint32 coreflow::Reference::write_count
inherited

The number of times the object has been written to (in some portion)