TIOVX User Guide
vx_internal.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_INTERNAL_H_
20 #define VX_INTERNAL_H_
21 
22 #include <stdarg.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 
26 #include <VX/vx.h>
27 #include <VX/vx_khr_pipelining.h>
28 #include <VX/vx_khr_swap_move.h>
29 #include <VX/vx_khr_supplementary_data.h>
30 #include <TI/tivx.h>
31 #include <VX/vx_khr_safe_casts.h>
32 #include <TI/tivx_ext_suppl_data.h>
33 #include <TI/tivx_mem.h>
34 #include <TI/tivx_obj_desc.h>
35 #include <TI/tivx_target_kernel.h>
36 #include <TI/tivx_debug.h>
37 #include <tivx_platform.h>
38 #include <tivx_ipc.h>
39 #include <tivx_mem.h>
40 #include <TI/tivx_mutex.h>
41 #include <TI/tivx_event.h>
42 #include <TI/tivx_task.h>
43 #include <TI/tivx_queue.h>
44 #include <TI/tivx_config.h>
45 #include <tivx_obj_desc_priv.h>
46 #include <tivx_target.h>
49 #include <tivx_obj_desc_queue.h>
50 #include <tivx_event_queue.h>
51 #include <TI/tivx_log_stats.h>
52 #include <tivx_debug.h>
53 
54 #include <vx_reference.h>
55 #include <tivx_data_ref_queue.h>
56 #include <vx_context.h>
57 #include <vx_error.h>
58 #include <vx_graph.h>
59 #include <vx_kernel.h>
60 #include <vx_node.h>
61 #include <vx_parameter.h>
62 #include <vx_remap.h>
63 #include <vx_scalar.h>
64 #include <vx_image.h>
65 #include <vx_matrix.h>
66 #include <vx_lut.h>
67 #include <vx_convolution.h>
68 #include <vx_distribution.h>
69 #include <vx_threshold.h>
70 #include <vx_pyramid.h>
71 #include <vx_objarray.h>
72 #include <vx_array.h>
73 #include <vx_user_data_object.h>
74 #include <tivx_raw_image.h>
75 #include <tivx_super_node.h>
76 #include <vx_tensor.h>
77 #include <vx_delay.h>
78 #include <vx_module.h>
79 #include <vx_meta_format.h>
80 #include <tivx_objects.h>
81 #include <tivx_log_rt_trace.h>
82 #include <tivx_log_resource.h>
83 #include <tivx_kernels_common_utils.h>
84 #include <vx_copy_swap.h>
85 
86 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
99 #define TIVX_ALIGN(value, align) ((((value)+((align)-1U))/(align))*(align))
100 
104 #define TIVX_FLOOR(value, align) (((value)/(align))*(align))
105 
110 #define TIVX_DEFAULT_STRIDE_Y_ALIGN (16U)
111 
116 #define TIVX_DEFAULT_STRIDE_Y_MULTIPLE (8U)
117 
121 #define TIVX_TYPE_IS_SCALAR(type) (((vx_enum)VX_TYPE_INVALID < (type)) && ((type) < (vx_enum)VX_TYPE_SCALAR_MAX))
122 
126 #define TIVX_TYPE_IS_STRUCT(type) (((type) >= (vx_enum)VX_TYPE_RECTANGLE) && ((type) < (vx_enum)VX_TYPE_KHRONOS_STRUCT_MAX))
127 
131 #define TIVX_TYPE_IS_OBJECT(type) (((type) >= (vx_enum)VX_TYPE_REFERENCE) && ((type) < (vx_enum)VX_TYPE_KHRONOS_OBJECT_END))
132 
136 #define TIVX_TYPE_IS_TI_OBJECT(type) (((type) >= (vx_enum)VX_TYPE_VENDOR_OBJECT_START) && ((type) < (vx_enum)VX_TYPE_VENDOR_OBJECT_END))
137 
141 #define TIVX_MAGIC (0xFACEC0DEU)
142 
146 #define TIVX_DATA_BUFFER_ALIGNMENT (128U)
147 
151 #define TIVX_BAD_MAGIC (42U)
152 
157  TIVX_TYPE_DATA_REF_Q = VX_TYPE_VENDOR_OBJECT_START,
174 };
175 
179 #define VX_CHECK_PARAM(ptr, size, type, align) ((NULL != ptr) && (size == sizeof(type)) && (((vx_size)ptr & align) == 0U))
180 
181 static inline void tivx_uint32_to_uint64(volatile uint64_t *val, uint32_t h, uint32_t l);
182 static inline void tivx_uint64_to_uint32(uint64_t val, volatile uint32_t *h, volatile uint32_t *l);
183 
187 static inline void tivx_uint32_to_uint64(volatile uint64_t *val, uint32_t h, uint32_t l)
188 {
189  *val = ((uint64_t)h<<32) | (uint64_t)l;
190 }
191 
195 static inline void tivx_uint64_to_uint32(uint64_t val, volatile uint32_t *h, volatile uint32_t *l)
196 {
197  *h = (uint32_t)(val >> 32);
198  *l = (uint32_t)(val >> 0);
199 }
200 
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif
207 
Implementation of Reference object.
static void tivx_uint64_to_uint32(uint64_t val, volatile uint32_t *h, volatile uint32_t *l)
Macro to convert uint64 to 2x uint32.
Definition: vx_internal.h:195
The internal error implementation.
A tivx_target_kernel.
Definition: vx_internal.h:167
A tivx_image_map_info.
Definition: vx_internal.h:160
VX_TYPE_VENDOR_STRUCT_START
Implementation of Remap object.
Interface to TI extension APIs.
Implementation of Module APIs.
A tivx_event.
Definition: vx_internal.h:169
Implementation of Context object.
A tivx_user_data_object_map_info.
Definition: vx_internal.h:163
int32_t vx_enum
Implementation of Target Object APIs.
Implementation of Data Reference Queue Object APIs.
Implementation of Raw Image object.
A tivx_delay_param.
Definition: vx_internal.h:168
Implementation of Object descriptor Queue Object APIs.
Implementation of Array object.
A graph->parameters.
Definition: vx_internal.h:172
Internal private implementation of object descriptor.
Data reference queue type.
Definition: vx_internal.h:158
Implementation of Graph object.
Implementation of Matrix object.
Implementation of Delay object.
Implementation of resource log API.
tivx_type_e
TIVX defined reference types.
Definition: vx_internal.h:156
Interface to object descriptor.
Implementation of Threshold object.
The OpenVX Pipelining, Streaming and Batch Processing extension API.
Implementation of Meta Format Object.
Target Kernel Instance implementation APIs.
A tivx_raw_image_map_info.
Definition: vx_internal.h:161
The Internal Debugging API.
Platform APIs.
Interface to Event APIs.
Implementation of Kernel object.
A tivx_array_map_info.
Definition: vx_internal.h:159
Implementation of real-time trace log API.
Implementation of Scalar object.
Inter-processor Communication (IPC) APIs.
Implementation of Image object.
Interface to Memory allocation and deallocation APIs.
A tivx_tensor_map_info.
Definition: vx_internal.h:162
Implementation of Object Array data object.
Interface to Mutex APIs.
Implementation of Pyramid object.
Implementation of Tensor object.
Implementation of user data object.
Implementation of Distribution object.
VX_TYPE_VENDOR_OBJECT_START
Target Kernel implementation APIs.
A context->user_structs.
Definition: vx_internal.h:171
Interface to Queue APIs.
Interface to kernel APIs on target.
Implementation of Parameter object.
Implementation of Lut object.
Interface to Task APIs.
A graph->data_ref_q_list.
Definition: vx_internal.h:173
A tivx_event_queue_elem.
Definition: vx_internal.h:164
A tivx_target_kernel_instance.
Definition: vx_internal.h:166
static void tivx_uint32_to_uint64(volatile uint64_t *val, uint32_t h, uint32_t l)
Macro to convert 2x uint32 to uint64.
Definition: vx_internal.h:187
Implementation of Super Node object.
Interface to Event Queue APIs.
Implementation of Node object.
Implementation of Convolution object.