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 {
55  uint32_t pipeline_depth;
63  vx_bool replicated_flags[TIVX_KERNEL_MAX_PARAMS];
79 
82 
84  uint16_t incounter;
85 
88 
91 
94 
97 
103  uint32_t parameter_index_num_buf[TIVX_KERNEL_MAX_PARAMS];
104 
107 
110 
113 
116 
119 
122 
123 } tivx_node_t;
124 
137 
150 
151 
156 
161 
166 
171 
176 vx_status ownNodeKernelSchedule(vx_node node, uint32_t pipeline_id);
177 
182 
187 
191 vx_status ownUpdateNodePerf(vx_node node, uint32_t pipeline_id);
192 
196 uint32_t ownNodeGetNumParameters(vx_node node);
197 
201 vx_enum ownNodeGetParameterDir(vx_node node, uint32_t prm_index);
202 
206 vx_reference ownNodeGetParameterRef(vx_node node, uint32_t prm_index);
207 
208 
213 
217 vx_status ownNodeReplaceOutNode(vx_node node, vx_node old_out_node, vx_node new_out_node);
218 
222 vx_status ownNodeAddInNode(vx_node node, vx_node out_node);
223 
227 vx_status ownNodeReplaceInNode(vx_node node, vx_node old_in_node, vx_node new_in_node);
228 
232 uint32_t ownNodeGetNumInNodes(vx_node node);
233 
237 uint32_t ownNodeGetNumOutNodes(vx_node node);
238 
244 vx_status ownNodeCreateUserCallbackCommand(vx_node node, uint32_t pipeline_id);
245 
251 
256 void ownNodeClearExecuteState(vx_node node, uint32_t pipeline_id);
257 
263 
264 
269 vx_bool ownNodeIsPrmReplicated(vx_node node, uint32_t prm_idx);
270 
275 void ownNodeSetParameter(vx_node node, vx_uint32 index, vx_reference value);
276 
282 
288 
295 vx_bool ownCheckNodeCompleted(vx_node node, uint32_t pipeline_id);
296 
297 
302 vx_status ownNodeRegisterEvent(vx_node node, vx_enum event_type, vx_uint32 app_value);
303 
304 
309 void ownNodeCheckAndSendCompletionEvent(const tivx_obj_desc_node_t *node_obj_desc, uint64_t timestamp);
310 
315 void ownNodeCheckAndSendErrorEvent(const tivx_obj_desc_node_t *node_obj_desc, uint64_t timestamp, vx_status status);
316 
317 
322 vx_status ownNodeAllocObjDescForPipeline(vx_node node, uint32_t pipeline_depth);
323 
329 
335 
336 
341 void ownNodeLinkDataRefQueue(vx_node node, uint32_t prm_id, tivx_data_ref_queue data_ref_q);
342 
347 void ownNodeLinkArrayElement(vx_node node, uint32_t prm_id);
348 
357 uint32_t ownNodeGetParameterNumBuf(vx_node node, vx_uint32 index);
358 
359 #ifdef __cplusplus
360 }
361 #endif
362 
363 #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.
vx_node ownNodeGetNextInNode(vx_node node, vx_uint32 index)
Get next node at given input index.
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.
uint32_t node_error_app_value
Value returned with node error event.
Definition: vx_node.h:109
vx_status ownNodeAllocObjDescForPipeline(vx_node node, uint32_t pipeline_depth)
Alloc additional node obj desc's for pipelining.
vx_enum vx_status
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.
vx_bool ownCheckNodeCompleted(vx_node node, uint32_t pipeline_id)
Check if node is completed.
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:121
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
uint32_t node_completed_app_value
Value returned with node completion event.
Definition: vx_node.h:106
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
#define TIVX_GRAPH_MAX_PIPELINE_DEPTH
Max possible pipeline depth of a graph.
tivx_super_node super_node
The pointer to the super node that this node references.
Definition: vx_node.h:115
uint32_t vx_uint32
vx_uint32 timeout_val
Control API processing Timeout value in milli-sec.
Definition: vx_node.h:118
#define TIVX_KERNEL_MAX_PARAMS
Max parameters in a kernel.
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:112
vx_node ownNodeGetNextNode(vx_node node, vx_uint32 index)
Get next node at given output index.
struct _vx_node * vx_node
vx_bool ownNodeIsPrmReplicated(vx_node node, uint32_t prm_idx)
Is prm_idx of node replicated.
Node object descriptor.
uint32_t ownNodeGetParameterNumBuf(vx_node node, vx_uint32 index)
Return number of buffers to alocate at a node,index.
vx_kernel kernel
The pointer to the kernel structure.
Definition: vx_node.h:51
vx_nodecomplete_f user_callback
Node completeion 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.
void ownNodeSetParameter(vx_node node, vx_uint32 index, vx_reference value)
Set parameter at node.
vx_size local_data_size
local data size
Definition: vx_node.h:73
vx_bool is_context_event
flag to indicate whether event is using context event queue
Definition: vx_node.h:96