Defines the Graph Object interface.
A set of nodes connected in a directed (only goes one-way) acyclic (does not loop back) fashion. A Graph may have sets of Nodes that are unconnected to other sets of Nodes within the same Graph. See Graph Formalisms. Figure below shows the Graph state transition diagram. Also see vx_graph_state_e
.
|
typedef struct _vx_graph * | vx_graph |
| An opaque reference to a graph. More...
|
|
|
vx_graph VX_API_CALL | vxCreateGraph (vx_context context) |
| Creates an empty graph. More...
|
|
vx_bool VX_API_CALL | vxIsGraphVerified (vx_graph graph) |
| Returns a Boolean to indicate the state of graph verification. More...
|
|
vx_status VX_API_CALL | vxProcessGraph (vx_graph graph) |
| This function causes the synchronous processing of a graph. If the graph has not been verified, then the implementation verifies the graph immediately. If verification fails this function returns a status identical to what vxVerifyGraph would return. After the graph verfies successfully then processing occurs. If the graph was previously verified via vxVerifyGraph or vxProcessGraph then the graph is processed. This function blocks until the graph is completed. More...
|
|
vx_status VX_API_CALL | vxQueryGraph (vx_graph graph, vx_enum attribute, void *ptr, vx_size size) |
| Allows the user to query attributes of the Graph. More...
|
|
vx_status VX_API_CALL | vxRegisterAutoAging (vx_graph graph, vx_delay delay) |
| Register a delay for auto-aging. More...
|
|
vx_status VX_API_CALL | vxReleaseGraph (vx_graph *graph) |
| Releases a reference to a graph. The object may not be garbage collected until its total reference count is zero. Once the reference count is zero, all node references in the graph are automatically released as well. Releasing the graph will only release the nodes if the nodes were not previously released by the application. Data referenced by those nodes may not be released as the user may still have references to the data. More...
|
|
vx_status VX_API_CALL | vxScheduleGraph (vx_graph graph) |
| Schedules a graph for future execution. If the graph has not been verified, then the implementation verifies the graph immediately. If verification fails this function returns a status identical to what vxVerifyGraph would return. After the graph verfies successfully then processing occurs. If the graph was previously verified via vxVerifyGraph or vxProcessGraph then the graph is processed. More...
|
|
vx_status VX_API_CALL | vxSetGraphAttribute (vx_graph graph, vx_enum attribute, const void *ptr, vx_size size) |
| Allows the attributes of the Graph to be set to the provided value. More...
|
|
vx_status VX_API_CALL | vxVerifyGraph (vx_graph graph) |
| Verifies the state of the graph before it is executed. This is useful to catch programmer errors and contract errors. If not verified, the graph verifies before being processed. More...
|
|
vx_status VX_API_CALL | vxWaitGraph (vx_graph graph) |
| Waits for a specific graph to complete. If the graph has been scheduled multiple times since the last call to vxWaitGraph, then vxWaitGraph returns only when the last scheduled execution completes. More...
|
|
The Graph State Enumeration.
Enumerator |
---|
VX_GRAPH_STATE_UNVERIFIED |
The graph should be verified before execution.
|
VX_GRAPH_STATE_VERIFIED |
The graph has been verified and has not been executed or scheduled for execution yet.
|
VX_GRAPH_STATE_RUNNING |
The graph either has been scheduled and not completed, or is being executed.
|
VX_GRAPH_STATE_ABANDONED |
The graph execution was abandoned.
|
VX_GRAPH_STATE_COMPLETED |
The graph execution is completed and the graph is not scheduled for execution.
|
Definition at line 661 of file vx_types.h.
The graph attributes list.
Enumerator |
---|
VX_GRAPH_NUMNODES |
Returns the number of nodes in a graph. Read-only. Use a vx_uint32 parameter.
|
VX_GRAPH_PERFORMANCE |
Returns the overall performance of the graph. Read-only. Use a vx_perf_t parameter. The accuracy of timing information is platform dependent.
- Note
- Performance tracking must have been enabled. See
vx_directive_e
|
VX_GRAPH_NUMPARAMETERS |
Returns the number of explicitly declared parameters on the graph. Read-only. Use a vx_uint32 parameter.
|
VX_GRAPH_STATE |
Returns the state of the graph. See vx_graph_state_e enum.
|
Definition at line 677 of file vx_types.h.
Creates an empty graph.
- Parameters
-
[in] | context | The reference to the implementation context. |
- Returns
- A graph reference
vx_graph
. Any possible errors preventing a successful creation should be checked using vxGetStatus
.
Releases a reference to a graph. The object may not be garbage collected until its total reference count is zero. Once the reference count is zero, all node references in the graph are automatically released as well. Releasing the graph will only release the nodes if the nodes were not previously released by the application. Data referenced by those nodes may not be released as the user may still have references to the data.
- Parameters
-
[in] | graph | The pointer to the graph to release. |
- Postcondition
- After returning from this function the reference is zeroed.
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference. |
Verifies the state of the graph before it is executed. This is useful to catch programmer errors and contract errors. If not verified, the graph verifies before being processed.
- Precondition
- Memory for data objects is not guarenteed to exist before this call.
- Postcondition
- After this call data objects exist unless the implementation optimized them out.
- Parameters
-
[in] | graph | The reference to the graph to verify. |
- Returns
- A status code for graphs with more than one error; it is undefined which error will be returned. Register a log callback using
vxRegisterLogCallback
to receive each specific error in the graph.
-
A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference. |
VX_ERROR_MULTIPLE_WRITERS | If the graph contains more than one writer to any data object. |
VX_ERROR_INVALID_NODE | If a node in the graph is invalid or failed be created. |
VX_ERROR_INVALID_GRAPH | If the graph contains cycles or some other invalid topology. |
VX_ERROR_INVALID_TYPE | If any parameter on a node is given the wrong type. |
VX_ERROR_INVALID_VALUE | If any value of any parameter is out of bounds of specification. |
VX_ERROR_INVALID_FORMAT | If the image format is not compatible. |
- See also
- vxProcessGraph
This function causes the synchronous processing of a graph. If the graph has not been verified, then the implementation verifies the graph immediately. If verification fails this function returns a status identical to what vxVerifyGraph
would return. After the graph verfies successfully then processing occurs. If the graph was previously verified via vxVerifyGraph
or vxProcessGraph
then the graph is processed. This function blocks until the graph is completed.
- Parameters
-
[in] | graph | The graph to execute. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | Graph has been processed; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference. |
VX_FAILURE | A catastrophic error occurred during processing. |
Schedules a graph for future execution. If the graph has not been verified, then the implementation verifies the graph immediately. If verification fails this function returns a status identical to what vxVerifyGraph
would return. After the graph verfies successfully then processing occurs. If the graph was previously verified via vxVerifyGraph
or vxProcessGraph
then the graph is processed.
- Parameters
-
[in] | graph | The graph to schedule. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | The graph has been scheduled; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference. |
VX_ERROR_NO_RESOURCES | The graph cannot be scheduled now. |
VX_ERROR_NOT_SUFFICIENT | The graph is not verified and has failed forced verification. |
Waits for a specific graph to complete. If the graph has been scheduled multiple times since the last call to vxWaitGraph, then vxWaitGraph returns only when the last scheduled execution completes.
- Parameters
-
[in] | graph | The graph to wait on. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | The graph has successfully completed execution and its outputs are the valid results of the most recent execution; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference. |
VX_FAILURE | An error occurred or the graph was never scheduled. Output data of the graph is undefined. |
- Precondition
vxScheduleGraph
Allows the user to query attributes of the Graph.
- Parameters
-
[in] | graph | The reference to the created graph. |
[in] | attribute | The vx_graph_attribute_e type needed. |
[out] | ptr | The location at which to store the resulting value. |
[in] | size | The size in bytes of the container to which ptr points. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference. |
Allows the attributes of the Graph to be set to the provided value.
- Parameters
-
[in] | graph | The reference to the graph. |
[in] | attribute | The vx_graph_attribute_e type needed. |
[in] | ptr | The location from which to read the value. |
[in] | size | The size in bytes of the container to which ptr points. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference. |
Returns a Boolean to indicate the state of graph verification.
- Parameters
-
[in] | graph | The reference to the graph to check. |
- Returns
- A
vx_bool
value.
- Return values
-
Register a delay for auto-aging.
This function registers a delay object to be auto-aged by the graph. This delay object will be automatically aged after each successful completion of this graph. Aging of a delay object cannot be called during graph execution. A graph abandoned due to a node callback will trigger an auto-aging.
If a delay is registered for auto-aging multiple times in a same graph, the delay will be only aged a single time at each graph completion. If a delay is registered for auto-aging in multiple graphs, this delay will aged automatically after each successful completion of any of these graphs.
- Parameters
-
[in] | graph | The graph to which the delay is registered for auto-aging. |
[in] | delay | The delay to automatically age. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | graph is not a valid vx_graph reference, or delay is not a valid vx_delay reference. |