docs-6.1.1/amd_openvx/openvx/include/VX/vx_khr_nn.h Source File

docs-6.1.1/amd_openvx/openvx/include/VX/vx_khr_nn.h Source File#

MIVisionX: docs-6.1.1/amd_openvx/openvx/include/VX/vx_khr_nn.h Source File
vx_khr_nn.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2020 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 #ifndef _VX_KHR_NN_H_
18 #define _VX_KHR_NN_H_
19 
28 #define OPENVX_KHR_NN "vx_khr_nn"
29 
30 #include <VX/vx.h>
31 
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 /*==============================================================================
39 CONVOLUTIONAL_NETWORK structs and enums
40 =============================================================================*/
41 
45 #define VX_LIBRARY_KHR_NN_EXTENSION (0x1)
46 
83 };
84 
89 {
90  VX_ENUM_NN_ROUNDING_TYPE = 0x1A,
91  VX_ENUM_NN_POOLING_TYPE = 0x1B,
92  VX_ENUM_NN_NORMALIZATION_TYPE = 0x1C,
93  VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE = 0x1D,
94 };
95 
103 {
105  VX_NN_DS_SIZE_ROUNDING_FLOOR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ROUNDING_TYPE) + 0x0,
107  VX_NN_DS_SIZE_ROUNDING_CEILING = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ROUNDING_TYPE) + 0x1
108 };
109 
110 
116 {
118  VX_NN_POOLING_MAX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_POOLING_TYPE) + 0x0,
120  VX_NN_POOLING_AVG = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_POOLING_TYPE) + 0x1
121 };
122 
123 
128 {
130  VX_NN_NORMALIZATION_SAME_MAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_NORMALIZATION_TYPE) + 0x0,
132  VX_NN_NORMALIZATION_ACROSS_MAPS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_NORMALIZATION_TYPE) + 0x1,
133 };
134 
135 
136 
154 {
155  VX_NN_ACTIVATION_LOGISTIC = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x0,
156  VX_NN_ACTIVATION_HYPERBOLIC_TAN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x1,
157  VX_NN_ACTIVATION_RELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x2,
158  VX_NN_ACTIVATION_BRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x3,
159  VX_NN_ACTIVATION_SOFTRELU = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x4,
160  VX_NN_ACTIVATION_ABS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x5,
161  VX_NN_ACTIVATION_SQUARE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x6,
162  VX_NN_ACTIVATION_SQRT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x7,
163  VX_NN_ACTIVATION_LINEAR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_NN_ACTIVATION_FUNCTION_TYPE) + 0x8,
164 };
165 
166 
174 };
175 
180 {
189 
190 
195 {
203 
208 {
211 
212 /*==============================================================================
213  NN Nodes
214 =============================================================================*/
252 VX_API_ENTRY vx_node VX_API_CALL vxConvolutionLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor biases, const vx_nn_convolution_params_t *convolution_params, vx_size size_of_convolution_params, vx_tensor outputs);
253 
280 VX_API_ENTRY vx_node VX_API_CALL vxFullyConnectedLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor biases, vx_enum overflow_policy, vx_enum rounding_policy, vx_tensor outputs);
281 
282 
307 VX_API_ENTRY vx_node VX_API_CALL vxPoolingLayer(vx_graph graph, vx_tensor inputs, vx_enum pooling_type,
308  vx_size pooling_size_x,
309  vx_size pooling_size_y,
310  vx_size pooling_padding_x,
311  vx_size pooling_padding_y,
312  vx_enum rounding,
313  vx_tensor outputs);
314 
334 VX_API_ENTRY vx_node VX_API_CALL vxSoftmaxLayer(vx_graph graph, vx_tensor inputs, vx_tensor outputs);
335 
356  vx_size normalization_size,
357  vx_float32 alpha,
358  vx_float32 beta,
359  vx_float32 bias,
360  vx_tensor outputs);
361 
378 VX_API_ENTRY vx_node VX_API_CALL vxActivationLayer(vx_graph graph, vx_tensor inputs, vx_enum function, vx_float32 a,vx_float32 b, vx_tensor outputs);
379 
399 VX_API_ENTRY vx_node VX_API_CALL vxROIPoolingLayer(vx_graph graph, vx_tensor input_data, vx_tensor input_rois, const vx_nn_roi_pool_params_t *roi_pool_params, vx_size size_of_roi_params, vx_tensor output_arr);
400 
401 
446 VX_API_ENTRY vx_node VX_API_CALL vxDeconvolutionLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor biases, const vx_nn_deconvolution_params_t *deconvolution_params, vx_size size_of_deconv_params, vx_tensor outputs);
447 
448 
449 #ifdef __cplusplus
450 }
451 #endif
452 
453 
454 #endif
VX_API_ENTRY vx_node VX_API_CALL vxDeconvolutionLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor biases, const vx_nn_deconvolution_params_t *deconvolution_params, vx_size size_of_deconv_params, vx_tensor outputs)
[Graph] Creates a Convolutional Network Deconvolution Layer Node.
VX_API_ENTRY vx_node VX_API_CALL vxConvolutionLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor biases, const vx_nn_convolution_params_t *convolution_params, vx_size size_of_convolution_params, vx_tensor outputs)
[Graph] Creates a Convolutional Network Convolution Layer Node.
#define VX_LIBRARY_KHR_NN_EXTENSION
The Neural Network Extension Library Set.
Definition: vx_khr_nn.h:45
struct _vx_nn_deconvolution_params_t vx_nn_deconvolution_params_t
Input parameters for a deconvolution operation.
vx_nn_type_e
The type enumeration lists all NN extension types.
Definition: vx_khr_nn.h:170
struct _vx_nn_convolution_params_t vx_nn_convolution_params_t
Input parameters for a convolution operation.
struct _vx_nn_roi_pool_params_t vx_nn_roi_pool_params_t
Input parameters for ROI pooling operation.
VX_API_ENTRY vx_node VX_API_CALL vxROIPoolingLayer(vx_graph graph, vx_tensor input_data, vx_tensor input_rois, const vx_nn_roi_pool_params_t *roi_pool_params, vx_size size_of_roi_params, vx_tensor output_arr)
[Graph] Creates a Convolutional Network ROI pooling node
vx_nn_pooling_type_e
The Neural Network pooling type list.
Definition: vx_khr_nn.h:116
VX_API_ENTRY vx_node VX_API_CALL vxLocalResponseNormalizationLayer(vx_graph graph, vx_tensor inputs, vx_enum type, vx_size normalization_size, vx_float32 alpha, vx_float32 beta, vx_float32 bias, vx_tensor outputs)
[Graph] Creates a Convolutional Network Local Response Normalization Layer Node. This function is opt...
vx_nn_norm_type_e
The Neural Network normalization type list.
Definition: vx_khr_nn.h:128
VX_API_ENTRY vx_node VX_API_CALL vxSoftmaxLayer(vx_graph graph, vx_tensor inputs, vx_tensor outputs)
[Graph] Creates a Convolutional Network Softmax Layer Node.
vx_nn_rounding_type_e
down scale rounding.
Definition: vx_khr_nn.h:103
VX_API_ENTRY vx_node VX_API_CALL vxActivationLayer(vx_graph graph, vx_tensor inputs, vx_enum function, vx_float32 a, vx_float32 b, vx_tensor outputs)
[Graph] Creates a Convolutional Network Activation Layer Node. The function operate a specific functi...
VX_API_ENTRY vx_node VX_API_CALL vxFullyConnectedLayer(vx_graph graph, vx_tensor inputs, vx_tensor weights, vx_tensor biases, vx_enum overflow_policy, vx_enum rounding_policy, vx_tensor outputs)
[Graph] Creates a Fully connected Convolutional Network Layer Node.
vx_kernel_nn_ext_e
The list of Neural Network Extension Kernels.
Definition: vx_khr_nn.h:50
VX_API_ENTRY vx_node VX_API_CALL vxPoolingLayer(vx_graph graph, vx_tensor inputs, vx_enum pooling_type, vx_size pooling_size_x, vx_size pooling_size_y, vx_size pooling_padding_x, vx_size pooling_padding_y, vx_enum rounding, vx_tensor outputs)
[Graph] Creates a Convolutional Network Pooling Layer Node.
vx_nn_enum_e
NN extension type enums.
Definition: vx_khr_nn.h:89
vx_nn_activation_function_e
The Neural Network activation functions list.
Definition: vx_khr_nn.h:154
@ VX_TYPE_NN_CONVOLUTION_PARAMS
A vx_nn_convolution_params_t.
Definition: vx_khr_nn.h:171
@ VX_TYPE_NN_DECONVOLUTION_PARAMS
A vx_nn_deconvolution_params_t.
Definition: vx_khr_nn.h:172
@ VX_TYPE_NN_ROI_POOL_PARAMS
A vx_nn_roi_pool_params_t.
Definition: vx_khr_nn.h:173
@ VX_NN_POOLING_MAX
max pooling
Definition: vx_khr_nn.h:118
@ VX_NN_POOLING_AVG
average pooling
Definition: vx_khr_nn.h:120
@ VX_NN_NORMALIZATION_ACROSS_MAPS
Normalization is done across different IFMs.
Definition: vx_khr_nn.h:132
@ VX_NN_NORMALIZATION_SAME_MAP
normalization is done on same IFM
Definition: vx_khr_nn.h:130
@ VX_NN_DS_SIZE_ROUNDING_FLOOR
floor rounding
Definition: vx_khr_nn.h:105
@ VX_NN_DS_SIZE_ROUNDING_CEILING
ceil rounding
Definition: vx_khr_nn.h:107
@ VX_KERNEL_LOCAL_RESPONSE_NORMALIZATION_LAYER
The Neural Network Extension local response normalization Kernel (with bias).
Definition: vx_khr_nn.h:82
@ VX_KERNEL_ROI_POOLING_LAYER
The Neural Network POI Pooling Kernel.
Definition: vx_khr_nn.h:74
@ VX_KERNEL_DECONVOLUTION_LAYER
The Neural Network Extension Deconvolution Kernel.
Definition: vx_khr_nn.h:78
@ VX_KERNEL_CONVOLUTION_LAYER
The Neural Network Extension convolution Kernel.
Definition: vx_khr_nn.h:54
@ VX_KERNEL_SOFTMAX_LAYER
The Neural Network Extension softmax Kernel.
Definition: vx_khr_nn.h:66
@ VX_KERNEL_FULLY_CONNECTED_LAYER
The Neural Network Extension fully connected Kernel.
Definition: vx_khr_nn.h:58
@ VX_KERNEL_POOLING_LAYER
The Neural Network Extension pooling Kernel.
Definition: vx_khr_nn.h:62
@ VX_KERNEL_ACTIVATION_LAYER
The Neural Network Extension activation Kernel.
Definition: vx_khr_nn.h:70
Input parameters for a convolution operation.
Definition: vx_khr_nn.h:180
vx_enum overflow_policy
A VX_TYPE_ENUM of the vx_convert_policy_e enumeration.
Definition: vx_khr_nn.h:183
vx_size padding_y
Number of elements added at each side in the y dimension of the input.
Definition: vx_khr_nn.h:182
vx_size dilation_y
“inflate” the kernel by inserting zeros between the kernel elements in the y direction....
Definition: vx_khr_nn.h:187
vx_enum rounding_policy
A VX_TYPE_ENUM of the vx_round_policy_e enumeration.
Definition: vx_khr_nn.h:184
vx_size padding_x
Number of elements added at each side in the x dimension of the input.
Definition: vx_khr_nn.h:181
vx_size dilation_x
“inflate” the kernel by inserting zeros between the kernel elements in the x direction....
Definition: vx_khr_nn.h:186
vx_enum down_scale_size_rounding
Rounding method for calculating output dimensions. See vx_nn_rounding_type_e
Definition: vx_khr_nn.h:185
Input parameters for a deconvolution operation.
Definition: vx_khr_nn.h:195
vx_enum rounding_policy
A VX_TYPE_ENUM of the vx_round_policy_e enumeration.
Definition: vx_khr_nn.h:199
vx_size padding_y
Number of elements subtracted at each side in the y dimension of the output.
Definition: vx_khr_nn.h:197
vx_size a_y
user-specified quantity used to distinguish between the different possible output sizes.
Definition: vx_khr_nn.h:201
vx_size padding_x
Number of elements subtracted at each side in the x dimension of the output.
Definition: vx_khr_nn.h:196
vx_enum overflow_policy
A VX_TYPE_ENUM of the vx_convert_policy_e enumeration.
Definition: vx_khr_nn.h:198
vx_size a_x
user-specified quantity used to distinguish between the different possible output sizes.
Definition: vx_khr_nn.h:200
Input parameters for ROI pooling operation.
Definition: vx_khr_nn.h:208
vx_enum pool_type
Of type vx_nn_pooling_type_e. Only VX_NN_POOLING_MAX pooling is supported.
Definition: vx_khr_nn.h:209
The top level OpenVX Header.
size_t vx_size
A wrapper of size_t to keep the naming convention uniform.
Definition: vx_types.h:157
struct _vx_tensor_t * vx_tensor
The multidimensional data object (Tensor).
Definition: vx_types.h:287
int32_t vx_enum
Sets the standard enumeration type size to be a fixed quantity.
Definition: vx_types.h:152
#define VX_ENUM_BASE(vendor, id)
Defines the manner in which to combine the Vendor and Object IDs to get the base value of the enumera...
Definition: vx_types.h:550
struct _vx_graph * vx_graph
An opaque reference to a graph.
Definition: vx_types.h:211
struct _vx_node * vx_node
An opaque reference to a kernel node.
Definition: vx_types.h:204
#define VX_API_CALL
Defines calling convention for OpenVX API.
Definition: vx_types.h:56
#define VX_KERNEL_BASE(vendor, lib)
Defines the manner in which to combine the Vendor and Library IDs to get the base value of the enumer...
Definition: vx_types.h:540
float vx_float32
A 32-bit float value.
Definition: vx_types.h:129
@ VX_ID_KHRONOS
The Khronos Group.
Definition: vx_vendors.h:30