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 <TI/tivx.h>
29 #include <VX/vx_khr_safe_casts.h>
30 #include <TI/tivx_mem.h>
31 #include <TI/tivx_obj_desc.h>
32 #include <TI/tivx_target_kernel.h>
33 #include <TI/tivx_debug.h>
34 #include <tivx_platform.h>
35 #include <tivx_ipc.h>
36 #include <TI/tivx_mutex.h>
37 #include <TI/tivx_event.h>
38 #include <TI/tivx_task.h>
39 #include <TI/tivx_queue.h>
40 #include <TI/tivx_config.h>
41 #include <tivx_obj_desc_priv.h>
42 #include <tivx_target.h>
45 #include <tivx_obj_desc_queue.h>
46 #include <tivx_event_queue.h>
47 
48 #include <vx_reference.h>
49 #include <tivx_data_ref_queue.h>
50 #include <vx_context.h>
51 #include <vx_error.h>
52 #include <vx_graph.h>
53 #include <vx_kernel.h>
54 #include <vx_node.h>
55 #include <vx_parameter.h>
56 #include <vx_remap.h>
57 #include <vx_scalar.h>
58 #include <vx_image.h>
59 #include <vx_matrix.h>
60 #include <vx_lut.h>
61 #include <vx_convolution.h>
62 #include <vx_distribution.h>
63 #include <vx_threshold.h>
64 #include <vx_pyramid.h>
65 #include <vx_objarray.h>
66 #include <vx_array.h>
67 #include <vx_user_data_object.h>
68 #include <tivx_raw_image.h>
69 #include <tivx_super_node.h>
70 #include <vx_tensor.h>
71 #include <vx_delay.h>
72 #include <vx_module.h>
73 #include <vx_meta_format.h>
74 #include <tivx_objects.h>
75 #include <tivx_log_rt_trace.h>
76 #include <tivx_log_resource.h>
78 
79 
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83 
92 #define TIVX_ALIGN(value, align) ((((value)+((align)-1U))/(align))*(align))
93 
97 #define TIVX_FLOOR(value, align) (((value)/(align))*(align))
98 
105 #define TIVX_DEFAULT_STRIDE_Y_ALIGN (16U)
106 
110 #define TIVX_TYPE_IS_SCALAR(type) (((vx_enum)VX_TYPE_INVALID < (type)) && ((type) < (vx_enum)VX_TYPE_SCALAR_MAX))
111 
115 #define TIVX_TYPE_IS_STRUCT(type) (((type) >= (vx_enum)VX_TYPE_RECTANGLE) && ((type) < (vx_enum)VX_TYPE_KHRONOS_STRUCT_MAX))
116 
120 #define TIVX_TYPE_IS_OBJECT(type) (((type) >= (vx_enum)VX_TYPE_REFERENCE) && ((type) < (vx_enum)VX_TYPE_KHRONOS_OBJECT_END))
121 
125 #define TIVX_TYPE_IS_TI_OBJECT(type) (((type) >= (vx_enum)VX_TYPE_VENDOR_OBJECT_START) && ((type) < (vx_enum)VX_TYPE_VENDOR_OBJECT_END))
126 
130 #define TIVX_MAGIC (0xFACEC0DEU)
131 
135 #define TIVX_BAD_MAGIC (42U)
136 
141  TIVX_TYPE_DATA_REF_Q = VX_TYPE_VENDOR_OBJECT_START,
158 };
159 
163 #define VX_CHECK_PARAM(ptr, size, type, align) ((NULL != ptr) && (size == sizeof(type)) && (((vx_size)ptr & align) == 0U))
164 
165 static inline void tivx_uint32_to_uint64(volatile uint64_t *val, uint32_t h, uint32_t l);
166 static inline void tivx_uint64_to_uint32(uint64_t val, volatile uint32_t *h, volatile uint32_t *l);
167 
171 static inline void tivx_uint32_to_uint64(volatile uint64_t *val, uint32_t h, uint32_t l)
172 {
173  *val = ((uint64_t)h<<32) | (uint64_t)l;
174 }
175 
179 static inline void tivx_uint64_to_uint32(uint64_t val, volatile uint32_t *h, volatile uint32_t *l)
180 {
181  *h = (uint32_t)(val >> 32);
182  *l = (uint32_t)(val >> 0);
183 }
184 
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #endif
191 
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:179
The internal error implementation.
A tivx_target_kernel.
Definition: vx_internal.h:151
A tivx_image_map_info.
Definition: vx_internal.h:144
VX_TYPE_VENDOR_STRUCT_START
Interface to Memory allocation and deallocation APIs.
Implementation of Remap object.
Interface to TI extension APIs.
Implementation of Module APIs.
A tivx_event.
Definition: vx_internal.h:153
Implementation of Context object.
A tivx_user_data_object_map_info.
Definition: vx_internal.h:147
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:152
Implementation of Object descriptor Queue Object APIs.
Implementation of Array object.
A graph->parameters.
Definition: vx_internal.h:156
Internal private implementation of object descriptor.
Data reference queue type.
Definition: vx_internal.h:142
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:140
Interface to object descriptor.
Implementation of Threshold object.
The OpenVX Pipelining, Streaming and Batch Processing extension API.
The Internal Debugging API.
Implementation of Meta Format Object.
Target Kernel Instance implementation APIs.
A tivx_raw_image_map_info.
Definition: vx_internal.h:145
Platform APIs.
Interface to Event APIs.
Implementation of Kernel object.
A tivx_array_map_info.
Definition: vx_internal.h:143
Interface file for utility functions for the Kernel.
Implementation of real-time trace log API.
Implementation of Scalar object.
Inter-processor Communication (IPC) APIs.
Implementation of Image object.
A tivx_tensor_map_info.
Definition: vx_internal.h:146
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:155
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:157
A tivx_event_queue_elem.
Definition: vx_internal.h:148
A tivx_target_kernel_instance.
Definition: vx_internal.h:150
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:171
Implementation of Super Node object.
Interface to Event Queue APIs.
Implementation of Node object.
Implementation of Convolution object.