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 <TI/tivx_mem.h>
30 #include <TI/tivx_obj_desc.h>
31 #include <TI/tivx_target_kernel.h>
32 #include <TI/tivx_debug.h>
33 #include <tivx_platform.h>
34 #include <tivx_ipc.h>
35 #include <TI/tivx_mutex.h>
36 #include <TI/tivx_event.h>
37 #include <TI/tivx_task.h>
38 #include <TI/tivx_queue.h>
39 #include <TI/tivx_config.h>
40 #include <tivx_obj_desc_priv.h>
41 #include <tivx_target.h>
44 #include <tivx_obj_desc_queue.h>
45 #include <tivx_event_queue.h>
46 
47 #include <vx_reference.h>
48 #include <tivx_data_ref_queue.h>
49 #include <vx_context.h>
50 #include <vx_error.h>
51 #include <vx_graph.h>
52 #include <vx_kernel.h>
53 #include <vx_node.h>
54 #include <vx_parameter.h>
55 #include <vx_remap.h>
56 #include <vx_scalar.h>
57 #include <vx_image.h>
58 #include <vx_matrix.h>
59 #include <vx_lut.h>
60 #include <vx_convolution.h>
61 #include <vx_distribution.h>
62 #include <vx_threshold.h>
63 #include <vx_pyramid.h>
64 #include <vx_objarray.h>
65 #include <vx_array.h>
66 #include <vx_user_data_object.h>
67 #include <tivx_raw_image.h>
68 #include <tivx_super_node.h>
69 #include <vx_tensor.h>
70 #include <vx_delay.h>
71 #include <vx_module.h>
72 #include <vx_meta_format.h>
73 #include <tivx_objects.h>
74 #include <tivx_log_rt_trace.h>
75 #include <tivx_log_resource.h>
77 
78 
79 #ifdef __cplusplus
80 extern "C" {
81 #endif
82 
91 #define TIVX_ALIGN(value, align) ((((value)+((align)-1U))/(align))*(align))
92 
96 #define TIVX_FLOOR(value, align) (((value)/(align))*(align))
97 
104 #define TIVX_DEFAULT_STRIDE_Y_ALIGN (16U)
105 
109 #define TIVX_TYPE_IS_SCALAR(type) (((vx_enum)VX_TYPE_INVALID < (type)) && ((type) < (vx_enum)VX_TYPE_SCALAR_MAX))
110 
114 #define TIVX_TYPE_IS_STRUCT(type) (((type) >= (vx_enum)VX_TYPE_RECTANGLE) && ((type) < (vx_enum)VX_TYPE_KHRONOS_STRUCT_MAX))
115 
119 #define TIVX_TYPE_IS_OBJECT(type) (((type) >= (vx_enum)VX_TYPE_REFERENCE) && ((type) < (vx_enum)VX_TYPE_KHRONOS_OBJECT_END))
120 
124 #define TIVX_TYPE_IS_TI_OBJECT(type) (((type) >= (vx_enum)VX_TYPE_VENDOR_OBJECT_START) && ((type) < (vx_enum)VX_TYPE_VENDOR_OBJECT_END))
125 
129 #define TIVX_MAGIC (0xFACEC0DEU)
130 
131 
135 #define TIVX_BAD_MAGIC (42U)
136 
141 
142  TIVX_TYPE_DATA_REF_Q = VX_TYPE_VENDOR_OBJECT_START,
143 };
144 
148 #define VX_CHECK_PARAM(ptr, size, type, align) ((NULL != ptr) && (size == sizeof(type)) && (((vx_size)ptr & align) == 0U))
149 
150 static inline void tivx_uint32_to_uint64(volatile uint64_t *val, uint32_t h, uint32_t l);
151 static inline void tivx_uint64_to_uint32(uint64_t val, volatile uint32_t *h, volatile uint32_t *l);
152 
156 static inline void tivx_uint32_to_uint64(volatile uint64_t *val, uint32_t h, uint32_t l)
157 {
158  *val = ((uint64_t)h<<32) | (uint64_t)l;
159 }
160 
164 static inline void tivx_uint64_to_uint32(uint64_t val, volatile uint32_t *h, volatile uint32_t *l)
165 {
166  *h = (uint32_t)(val >> 32);
167  *l = (uint32_t)(val >> 0);
168 }
169 
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #endif
176 
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:164
The internal error implementation.
Interface to Memory allocation and deallocation APIs.
Implementation of Remap object.
Interface to TI extension APIs.
Implementation of Module APIs.
Implementation of Context object.
Implementation of Target Object APIs.
Implementation of Data Reference Queue Object APIs.
Implementation of Raw Image object.
Implementation of Object descriptor Queue Object APIs.
Implementation of Array object.
Internal private implementation of object descriptor.
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.
Platform APIs.
Interface to Event APIs.
Implementation of Kernel object.
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.
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 Lut object.
VX_TYPE_VENDOR_OBJECT_START
Target Kernel implementation APIs.
Interface to Queue APIs.
Interface to kernel APIs on target.
Implementation of Parameter object.
Implementation of Lut object.
Interface to Task APIs.
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:156
Implementation of Super Node object.
Interface to Event Queue APIs.
Implementation of Node object.
Implementation of Lut object.