TIOVX User Guide
vx_node.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2016 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 
18 
19 #ifndef VX_NODE_H_
20 #define VX_NODE_H_
21 
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
35 #define TIVX_DEFAULT_TILE_HEIGHT (48u)
36 
40 #define TIVX_DEFAULT_TILE_WIDTH (64u)
41 
45 typedef struct _vx_node {
53  vx_reference parameters[TIVX_KERNEL_MAX_PARAMS];
55  uint32_t pipeline_depth;
57  tivx_obj_desc_node_t *obj_desc[TIVX_GRAPH_MAX_PIPELINE_DEPTH];
59  tivx_obj_desc_cmd_t *obj_desc_cmd[TIVX_GRAPH_MAX_PIPELINE_DEPTH];
63  vx_bool replicated_flags[TIVX_KERNEL_MAX_PARAMS];
79 
82 
84  uint16_t incounter;
85 
88 
91 
94 
97 
100 
103 
109  uint32_t parameter_index_num_buf[TIVX_KERNEL_MAX_PARAMS];
110 
113 
116 
119 
122 
125 
128 
129 } tivx_node_t;
130 
143 
156 
157 
162 
167 
172 
177 
182 vx_status ownNodeKernelSchedule(vx_node node, uint32_t pipeline_id);
183 
188 
193 
197 vx_status ownUpdateNodePerf(vx_node node, uint32_t pipeline_id);
198 
202 uint32_t ownNodeGetNumParameters(vx_node node);
203 
207 vx_enum ownNodeGetParameterDir(vx_node node, uint32_t prm_index);
208 
212 vx_reference ownNodeGetParameterRef(vx_node node, uint32_t prm_index);
213 
214 
219 
223 vx_status ownNodeReplaceOutNode(vx_node node, vx_node old_out_node, vx_node new_out_node);
224 
228 vx_status ownNodeAddInNode(vx_node node, vx_node out_node);
229 
233 vx_status ownNodeReplaceInNode(vx_node node, vx_node old_in_node, vx_node new_in_node);
234 
238 uint32_t ownNodeGetNumInNodes(vx_node node);
239 
243 uint32_t ownNodeGetNumOutNodes(vx_node node);
244 
250 vx_status ownNodeCreateUserCallbackCommand(vx_node node, uint32_t pipeline_id);
251 
257 
262 void ownNodeClearExecuteState(vx_node node, uint32_t pipeline_id);
263 
269 
270 
275 vx_bool ownNodeIsPrmReplicated(vx_node node, uint32_t prm_idx);
276 
282 
288 
294 
299 vx_status ownNodeRegisterEvent(vx_node node, vx_enum event_type, vx_uint32 app_value);
300 
301 
306 void ownNodeCheckAndSendCompletionEvent(const tivx_obj_desc_node_t *node_obj_desc, uint64_t timestamp);
307 
312 void ownNodeCheckAndSendErrorEvent(const tivx_obj_desc_node_t *node_obj_desc, uint64_t timestamp, vx_status status);
313 
314 
319 vx_status ownNodeAllocObjDescForPipeline(vx_node node, uint32_t pipeline_depth);
320 
326 
332 
333 
338 void ownNodeLinkDataRefQueue(vx_node node, uint32_t prm_id, tivx_data_ref_queue data_ref_q);
339 
344 void ownNodeLinkArrayElement(vx_node node, uint32_t prm_id);
345 
354 uint32_t ownNodeGetParameterNumBuf(vx_node node, vx_uint32 idx);
355 
356 #ifdef __cplusplus
357 }
358 #endif
359 
360 #endif
vx_bool local_data_set_allow
Flag to indicate if local data size and ptr set is allowed.
Definition: vx_node.h:81
vx_bool is_kernel_created
to check if kernel is created
Definition: vx_node.h:69
vx_bool
vx_bool local_data_ptr_is_alloc
flag to indicate if local_data_ptr is allocated by system TRUE: allocated by system (TIOVX implementa...
Definition: vx_node.h:78
vx_status ownNodeKernelInitKernelName(vx_node node)
Init user kernel or target kernel name associated with this node.
vx_bool is_enable_send_complete_event
when true a event is sent when a node execution is completed
Definition: vx_node.h:87
vx_action(* vx_nodecomplete_f)(vx_node node)
vx_status ownNodeAddInNode(vx_node node, vx_node out_node)
Associate a input node with a given node.
size_t vx_size
vx_status ownSetNodeImmTarget(vx_node node)
Set the target for node based on immediate mode target set in context.
int32_t vx_enum
void ownNodeLinkArrayElement(vx_node node, uint32_t prm_id)
Link array element to node at parameter index 'prm_id'.
The most basic type in the OpenVX system. Any type that inherits from tivx_reference_t must have a vx...
Definition: vx_reference.h:63
vx_status ownNodeKernelDeinitKernelName(vx_node node)
Deinit user kernel or target kernel name associated with this node.
vx_status ownNodeSetParameter(vx_node node, vx_uint32 idx, vx_reference value)
Set parameter at node.
uint32_t node_error_app_value
Value returned with node error event.
Definition: vx_node.h:115
vx_status ownNodeAllocObjDescForPipeline(vx_node node, uint32_t pipeline_depth)
Alloc additional node obj desc's for pipelining.
vx_enum vx_status
vx_bool is_initialized
flag to indicate if node has been initialized
Definition: vx_node.h:102
tivx_reference_t base
The internal reference object.
Definition: vx_node.h:47
struct _vx_meta_format * vx_meta_format
struct _vx_reference * vx_reference
vx_status ownNodeKernelDeinit(vx_node node)
DeInit user kernel or target kernel associated with this node.
vx_status ownUpdateNodePerf(vx_node node, uint32_t pipeline_id)
Called by graph each time after node execution.
vx_status ownNodeKernelSchedule(vx_node node, uint32_t pipeline_id)
Schedule user kernel or target kernel associated with this node for execution.
vx_perf_t perf
Node performance.
Definition: vx_node.h:61
vx_action ownNodeExecuteUserCallback(vx_node node)
Call user specified callback.
uint32_t pipeline_depth
pipeline depth of graph this node belongs to
Definition: vx_node.h:55
void * local_data_ptr
local data pointer
Definition: vx_node.h:71
vx_bool is_graph_event
flag to indicate whether event is using graph event queue
Definition: vx_node.h:93
vx_status ownNodeKernelInit(vx_node node)
Init user kernel or target kernel associated with this node.
vx_status ownNodeRegisterEvent(vx_node node, vx_enum event_type, vx_uint32 app_value)
Register node completion event.
uint32_t ownNodeGetParameterNumBuf(vx_node node, vx_uint32 idx)
Return number of buffers to allocate at a node,index.
vx_bool is_timed_out
flag to indicate whether node has timed out
Definition: vx_node.h:99
vx_graph graph
The pointer to parent graph.
Definition: vx_node.h:49
vx_uint32 node_depth
Depth of a given node.
Definition: vx_node.h:127
vx_reference ownNodeGetParameterRef(vx_node node, uint32_t prm_index)
Get reference associated with a parameters of a parameter.
vx_bool is_enable_send_error_event
when true a event is sent when a node execution is completed and is an error
Definition: vx_node.h:90
void ownNodeSetObjDescParamDirection(vx_node node)
Set param direction for 0th node obj desc.
Command object descriptor.
void ownNodeCheckAndSendCompletionEvent(const tivx_obj_desc_node_t *node_obj_desc, uint64_t timestamp)
Send node completion event if enabled.
struct _tivx_super_node * tivx_super_node
The Super Node Framework Object. Super Node is a strongly-typed container for connected nodes...
struct _vx_kernel * vx_kernel
struct _tivx_data_ref_queue * tivx_data_ref_queue
Data Ref Queue Object.
uint32_t ownNodeGetNumParameters(vx_node node)
Return number of node parameters.
vx_status ownNodeCreateUserCallbackCommand(vx_node node, uint32_t pipeline_id)
Create resources required to call a user callback If user callback is assigned then nothing is done...
vx_status ownNodeReplaceOutNode(vx_node node, vx_node old_out_node, vx_node new_out_node)
Replace an output node for a given node with a new output node.
uint32_t ownNodeGetNumInNodes(vx_node node)
Get number of input nodes associated with this node.
vx_status ownNodeUserKernelExecute(vx_node node, vx_reference prm_ref[])
Execute user kernel.
vx_bool valid_rect_reset
reset valid rectangle
Definition: vx_node.h:65
vx_enum vx_action
void ownNodeClearExecuteState(vx_node node, uint32_t pipeline_id)
clears execute status of the node
vx_status ownNodeAddOutNode(vx_node node, vx_node out_node)
Associate a output node with a given node.
vx_status ownResetNodePerf(vx_node node)
Reset node performance statistics.
uint32_t ownNodeGetNumOutNodes(vx_node node)
Get number of output nodes associated with this node.
The internal representation of a node.
Definition: vx_node.h:45
vx_node ownNodeGetNextNode(vx_node node, vx_uint32 idx)
Get next node at given output index.
uint32_t node_completed_app_value
Value returned with node completion event.
Definition: vx_node.h:112
void ownNodeLinkObjDescForPipeline(vx_node node)
Update in node id and out node id for node pipeline obj desc's.
uint16_t incounter
used by graph topological sort for internal state keeping
Definition: vx_node.h:84
tivx_super_node super_node
The pointer to the super node that this node references.
Definition: vx_node.h:121
uint32_t vx_uint32
vx_uint32 timeout_val
Control API processing Timeout value in milli-sec.
Definition: vx_node.h:124
struct _vx_graph * vx_graph
vx_status ownNodeReplaceInNode(vx_node node, vx_node old_in_node, vx_node new_in_node)
Replace an input node for a given node with a new input node.
vx_bool is_super_node
flag to indicate whether node is a placeholder for a super node
Definition: vx_node.h:118
struct _vx_node * vx_node
vx_bool ownNodeIsPrmReplicated(vx_node node, uint32_t prm_idx)
Is prm_idx of node replicated.
Node object descriptor.
vx_kernel kernel
The pointer to the kernel structure.
Definition: vx_node.h:51
vx_nodecomplete_f user_callback
Node completion callback.
Definition: vx_node.h:67
void ownNodeLinkDataRefQueue(vx_node node, uint32_t prm_id, tivx_data_ref_queue data_ref_q)
Link data ref q to node at parameter index 'prm_id'.
vx_status ownSetNodeAttributeValidRectReset(vx_node node, vx_bool is_reset)
Set the attribute VX_NODE_VALID_RECT_RESET in node.
vx_enum ownNodeGetParameterDir(vx_node node, uint32_t prm_index)
Get direction of a parameter.
vx_status ownNodeKernelValidate(vx_node node, vx_meta_format meta[])
Validate user kernel or target kernel associated with this node.
void ownNodeCheckAndSendErrorEvent(const tivx_obj_desc_node_t *node_obj_desc, uint64_t timestamp, vx_status status)
Send node error event if node failed.
vx_size local_data_size
local data size
Definition: vx_node.h:73
vx_node ownNodeGetNextInNode(vx_node node, vx_uint32 idx)
Get next node at given input index.
vx_bool is_context_event
flag to indicate whether event is using context event queue
Definition: vx_node.h:96