TIOVX User Guide
vx_khr_pipelining.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2025 The Khronos Group Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _OPENVX_PIPELINING_H_
18 #define _OPENVX_PIPELINING_H_
19 
25 #define OPENVX_KHR_PIPELINING "vx_khr_pipelining"
26 
27 #include <VX/vx.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
34 #define VX_TIMEOUT_WAIT_FOREVER ((vx_uint32)0xFFFFFFFFU)
35 
36 /*
37  * PIPELINING API
38  */
39 
44 #define VX_LIBRARY_KHR_PIPELINING_EXTENSION (0x1)
45 
51 {
53 };
54 
62 
66 
70 
74 };
75 
84 
97 
108 
126 };
127 
141 };
142 
149 typedef struct _vx_graph_parameter_queue_params_t {
150 
161 
169 typedef struct _vx_graph_parameter_config_t {
186 
298  vx_graph graph,
299  vx_enum graph_schedule_mode,
300  vx_uint32 graph_parameters_list_size,
301  const vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[]
302  );
303 
327  vx_graph graph,
328  vx_uint32 param,
329  vx_uint32 ref_list_size,
330  vx_reference refs_list[]
331  );
332 
357  vx_graph graph,
358  vx_uint32 graph_parameter_index,
359  vx_uint32 number_to_add,
360  const vx_reference new_references[]
361  );
362 
401  vx_uint32 graph_parameter_index,
402  const vx_reference *refs,
403  vx_uint32 num_refs);
404 
445  vx_uint32 graph_parameter_index,
446  vx_reference *refs,
447  vx_uint32 max_refs,
448  vx_uint32 *num_refs);
449 
470  vx_uint32 graph_parameter_index,
471  vx_uint32 *num_refs);
472 
473 /*
474  * EVENT QUEUE API
475  */
476 
482 {
484 };
485 
498 };
499 
505 
517 
525 
531 
537 
548 };
549 
554 typedef struct _vx_event_graph_parameter_consumed {
555 
562 
567 typedef struct _vx_event_graph_completed {
568 
572 
577 typedef struct _vx_event_node_completed {
578 
585 
590 typedef struct _vx_event_node_error {
591 
601 
606 typedef struct _vx_event_user_event {
607 
612 
617 typedef union _vx_event_info_t {
618 
635 
636 
641 typedef struct _vx_event {
642 
656 } vx_event_t;
657 
683 VX_API_ENTRY vx_status VX_API_CALL vxWaitEvent(vx_context context, vx_event_t *event, vx_bool do_not_block);
684 
696 VX_API_ENTRY vx_status VX_API_CALL vxEnableEvents(vx_context context);
697 
712 VX_API_ENTRY vx_status VX_API_CALL vxDisableEvents(vx_context context);
713 
727 VX_API_ENTRY vx_status VX_API_CALL vxSendUserEvent(vx_context context, vx_uint32 app_value, const void *parameter);
728 
729 
751 VX_API_ENTRY vx_status VX_API_CALL vxRegisterEvent(vx_reference ref, enum vx_event_type_e type, vx_uint32 param, vx_uint32 app_value);
752 
774 VX_API_ENTRY vx_status VX_API_CALL vxRegisterGraphEvent(vx_reference graph_or_node, enum vx_event_type_e type, vx_uint32 param, vx_uint32 app_value);
775 
792 VX_API_ENTRY vx_status VX_API_CALL vxWaitGraphEvent(vx_graph graph, vx_event_t * event, vx_bool do_not_block);
793 
805 
817 
831 VX_API_ENTRY vx_status VX_API_CALL vxSendUserGraphEvent(vx_graph graph, vx_uint32 app_value, const void *parameter);
832 
833 /*
834  * STREAMING API
835  */
836 
842 {
844 };
845 
851 
855 
859 
860 };
861 
868 };
869 
889 
905 };
906 
922 VX_API_ENTRY vx_status VX_API_CALL vxEnableGraphStreaming(vx_graph graph, vx_node trigger_node);
923 
953 
954 
973 
974 /* Additional helper API */
977 typedef struct _vx_kernel_parameter_config_t {
984 
1009  vx_kernel kernel,
1010  vx_uint32 num_params,
1011  vx_kernel_parameter_config_t parameter_config[]
1012  );
1013 
1035  vx_graph graph,
1036  vx_uint32 num_params,
1037  vx_graph_parameter_config_t parameter_config[]
1038  );
1039 
1040 #ifdef __cplusplus
1041 }
1042 #endif
1043 
1044 #endif
vx_bool
Schedule graph in queueing mode with auto scheduling.
Returns the schedule mode of a graph. Read-only. Use a vx_enum parameter. See vx_graph_schedule_mode_...
vx_event_node_error node_error
vx_uint32 index
index of the parameter, starting at zero
Node error event.
vx_meta_format meta
More information about the parameter, if not NULL, this will need releasing.
vx_uint32 refs_list_size
Number of elements in array &#39;refs_list&#39;.
VX_ID_KHRONOS
Node completion event.
vx_event_type_e
Type of event that can be generated during system execution.
VX_TYPE_REFERENCE
Sets or returns the timeout value, in milliseconds, for the function: vxWaitGraphEvent. Read-write. Use a vx_uint32 parameter, or the implementation-defined VX_TIMEOUT_WAIT_FOREVER. The implementation shall initially set this attribute to VX_TIMEOUT_WAIT_FOREVER.
Sets or returns the timeout value, in milliseconds, for the functions vxWaitGraph, vxProcessGraph, vxGraphParameterDequeueDoneRef, and vxStopGraphStreaming. Read-write. Use a vx_uint32 parameter, or the implementation-defined VX_TIMEOUT_WAIT_FOREVER. The implementation shall initially set this attribute to VX_TIMEOUT_WAIT_FOREVER.
VX_API_ENTRY vx_status VX_API_CALL vxRegisterGraphEvent(vx_reference graph_or_node, enum vx_event_type_e type, vx_uint32 param, vx_uint32 app_value)
Registers an event for a specific graph.
vx_node_state_e
Node state.
VX_API_ENTRY vx_status VX_API_CALL vxDisableEvents(vx_context context)
Disable event generation.
The pipeup output depth required by the kernel. This is called by kernels that need to be primed with...
int32_t vx_enum
vx_node_attribute_streaming_e
The node attributes added by this extension.
vx_graph graph
graph which generated this event
VX_API_ENTRY vx_status VX_API_CALL vxSetGraphScheduleConfig(vx_graph graph, vx_enum graph_schedule_mode, vx_uint32 graph_parameters_list_size, const vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[])
Sets the graph scheduler config.
VX_API_ENTRY vx_status VX_API_CALL vxGraphParameterCheckDoneRef(vx_graph graph, vx_uint32 graph_parameter_index, vx_uint32 *num_refs)
Checks and returns the number of references that are ready for dequeue.
Schedule graph in non-queueing mode.
VX_API_ENTRY vx_status VX_API_CALL vxStopGraphStreaming(vx_graph graph)
Stop streaming mode of graph execution.
VX_API_ENTRY vx_status VX_API_CALL vxSendUserEvent(vx_context context, vx_uint32 app_value, const void *parameter)
Generate user defined event.
vx_graph graph
graph which generated this event
Node is in steady state (output expected for each invocation)
vx_uint32 index
index of graph parameter, starting at 0
Parameter structure returned with event of type VX_EVENT_USER_EVENT.
Parameter structure returned with event of type VX_EVENT_NODE_COMPLETED.
vx_uint64 timestamp
The pipeup input depth required by the kernel. This is called by kernels that need to retain one or m...
vx_enum vx_status
vx_enum state
X_PARAMETER_STATE_REQUIRED or VX_PARAMETER_STATE_OPTIONAL.
#define VX_ENUM_BASE(vendor, id)
struct _vx_context * vx_context
struct _vx_meta_format * vx_meta_format
VX_API_ENTRY vx_status VX_API_CALL vxGraphParameterDequeueDoneRef(vx_graph graph, vx_uint32 graph_parameter_index, vx_reference *refs, vx_uint32 max_refs, vx_uint32 *num_refs)
Dequeues &#39;consumed&#39; references from a graph parameter.
Parameter structure returned with event of type VX_EVENT_NODE_ERROR.
Graph parameter consumed event.
Parameter structure returned with event of type VX_EVENT_GRAPH_PARAMETER_CONSUMED.
VX_API_ENTRY vx_status VX_API_CALL vxSendUserGraphEvent(vx_graph graph, vx_uint32 app_value, const void *parameter)
Generate user defined graph event.
struct _vx_reference * vx_reference
vx_event_graph_parameter_consumed graph_parameter_consumed
vx_uint32 graph_parameter_index
graph parameter index which generated this event
vx_node node
node which generated this event
Parameter structure returned with event of type VX_EVENT_GRAPH_COMPLETED.
VX_API_ENTRY vx_status VX_API_CALL vxStartGraphStreaming(vx_graph graph)
Start streaming mode of graph execution.
vx_event_user_event user_event
vx_graph_attribute_pipelining_e
The graph attributes added by this extension.
vx_node node
node which generated this event
Sets or returns the timeout value, in milliseconds, for the function: vxWaitEvent. Read-write. Use a vx_uint32 parameter, or the implementation-defined VX_TIMEOUT_WAIT_FOREVER. The implementation shall initially set this attribute to VX_TIMEOUT_WAIT_FOREVER.
VX_API_ENTRY vx_status VX_API_CALL vxGetGraphParameterRefsList(vx_graph graph, vx_uint32 param, vx_uint32 ref_list_size, vx_reference refs_list[])
Returns the list of references allowed for queueing on a particular graph parameter.
vx_reference * refs_list
Array of references that could be enqueued at a later point of time at this graph parameter...
vx_event_graph_completed graph_completed
vx_graph_schedule_mode_type_e
Type of graph scheduling mode.
vx_graph graph
graph which generated this event
vx_enum direction
VX_INPUT, VX_OUTPUT or VX_BIDIRECTIONAL.
Node state type enumeration.
vx_event_enum_e
Extra type enum.
vx_uint32 refs_list_size
The number of different references that may be assigned to this parameter.
VX_TYPE_CONTEXT
Schedule graph in queueing mode with manual scheduling.
vx_uint32 app_value
#define VX_ATTRIBUTE_BASE(vendor, object)
Set or return the graph pipeline depth; the depth used in the graph is known after graph verification...
vx_context_attribute_event_e
The context attribute added by this extension.
VX_API_ENTRY vx_status VX_API_CALL vxRegisterEvent(vx_reference ref, enum vx_event_type_e type, vx_uint32 param, vx_uint32 app_value)
Register an event to be generated.
Query the number of times this reference has been enqueued; Read-only. Use a vx_uint32 parameter...
VX_API_ENTRY vx_status VX_API_CALL vxGetGraphParameterConfig(vx_graph graph, vx_uint32 num_params, vx_graph_parameter_config_t parameter_config[])
Returns the graph parameter configuration.
VX_TYPE_KERNEL
Graph completion event.
VX_API_ENTRY vx_status VX_API_CALL vxGetKernelParameterConfig(vx_kernel kernel, vx_uint32 num_params, vx_kernel_parameter_config_t parameter_config[])
Returns the kernel parameter configuration.
vx_status status
error condition of node
Event Type enumeration.
This data structure is used to return information about kernel parameters via the vxGetKernelParamete...
struct _vx_kernel * vx_kernel
User defined event.
vx_enum type
see event type vx_event_type_e
Graph schedule mode type enumeration.
Data structure which holds event information.
vx_enum state
VX_PARAMETER_STATE_REQUIRED or VX_PARAMETER_STATE_OPTIONAL.
VX_API_ENTRY vx_status VX_API_CALL vxEnableEvents(vx_context context)
Enable event generation.
Parameter structure associated with an event. Depends on type of the event.
Queueing parameters for a specific graph parameter.
VX_API_ENTRY vx_status VX_API_CALL vxEnableGraphStreaming(vx_graph graph, vx_node trigger_node)
Enable streaming mode of graph execution.
VX_API_ENTRY vx_status VX_API_CALL vxWaitGraphEvent(vx_graph graph, vx_event_t *event, vx_bool do_not_block)
Waits for an event from a specific graph.
Queries the state of the node. Read-only. See vx_graph_state_e enum.
vx_enum direction
VX_INPUT, VX_OUTPUT or VX_BIDIRECTIONAL.
vx_node_state_enum_e
Extra enums.
void * user_event_parameter
User defined parameter value. This is used to pass additional user defined parameters with a user eve...
vx_enum type
A type enumerator such as VX_TYPE_IMAGE.
VX_TYPE_NODE
VX_API_ENTRY vx_status VX_API_CALL vxDisableGraphEvents(vx_graph graph)
Disables events from a specific graph.
VX_API_ENTRY vx_status VX_API_CALL vxWaitEvent(vx_context context, vx_event_t *event, vx_bool do_not_block)
Wait for a single event.
uint32_t vx_uint32
Details for a specific graph parameter.
vx_reference_attribute_pipelining_e
The reference attributes added by this extension.
uint32_t graph_parameter_index
Index of graph parameter to which these properties apply.
struct _vx_graph * vx_graph
vx_graph graph
graph which generated this event
VX_API_ENTRY vx_status VX_API_CALL vxGraphParameterEnqueueReadyRef(vx_graph graph, vx_uint32 graph_parameter_index, const vx_reference *refs, vx_uint32 num_refs)
Enqueues new references into a graph parameter for processing.
vx_kernel_attribute_streaming_e
The kernel attributes added by this extension.
vx_graph_schedule_mode_enum_e
Extra enums.
vx_event_info_t event_info
struct _vx_node * vx_node
vx_event_node_completed node_completed
Node is in pipeup state (output not expected for each invocation)
uint64_t vx_uint64
vx_status(* VX_API_CALL)(vx_reference *ref)
Callback type used to register release callbacks from object derived from references.
Definition: vx_reference.h:56
VX_API_ENTRY vx_status VX_API_CALL vxEnableGraphEvents(vx_graph graph)
Enables events from a specific graph.
VX_TYPE_GRAPH
VX_API_ENTRY vx_status VX_API_CALL vxAddReferencesToGraphParameterList(vx_graph graph, vx_uint32 graph_parameter_index, vx_uint32 number_to_add, const vx_reference new_references[])
Allows more references to be added to the list of references that may be queued on a graph parameter...
vx_enum type
an object type, such as VX_TYPE_IMAGE