Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update internal ovxlib to rel/1.2.2 #674

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/tim/vx/internal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# Some header file
include/vsi_nn_feature_config.h

# User-specific files
*.suo
*.user
Expand Down
2 changes: 2 additions & 0 deletions src/tim/vx/internal/include/interface/ops.def
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,5 @@ DEF_OP(GRID_SAMPLE)
DEF_OP(LPNORM)
DEF_OP(RESIZE_3D)
DEF_OP(REDUCEL2)
DEF_OP(CROP_AND_RESIZE)
DEF_OP(TAN)
1 change: 1 addition & 0 deletions src/tim/vx/internal/include/kernel/vsi_nn_kernel_lut.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ typedef int32_t vsi_nn_kernel_lut_act_e; enum
VSI_NN_KERNEL_LUT_ATANH = 21,
VSI_NN_KERNEL_LUT_ACOSH = 22,
VSI_NN_KERNEL_LUT_INVERSE_SIGMOID = 23,
VSI_NN_KERNEL_LUT_TAN = 24,

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,21 @@ enum
BI_LSTM_BW_INPUT_LAYERNORM_C = 54,
BI_LSTM_BW_INPUT_LAYERNORM_O = 55,

BI_LSTM_FW_INPUT_BIAS_R2I = 56,
BI_LSTM_FW_INPUT_BIAS_R2F = 57,
BI_LSTM_FW_INPUT_BIAS_R2C = 58,
BI_LSTM_FW_INPUT_BIAS_R2O = 59,

BI_LSTM_BW_INPUT_BIAS_R2I = 60,
BI_LSTM_BW_INPUT_BIAS_R2F = 61,
BI_LSTM_BW_INPUT_BIAS_R2C = 62,
BI_LSTM_BW_INPUT_BIAS_R2O = 63,

BI_LSTM_INPUT_CNT,

BI_LSTM_FW_OUTPUT_OUTPUT = 0,
BI_LSTM_BW_OUTPUT_OUTPUT = 1,

BI_LSTM_OUTPUT_CNT
};

Expand Down
47 changes: 47 additions & 0 deletions src/tim/vx/internal/include/ops/vsi_nn_op_crop_and_resize.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/****************************************************************************
*
* Copyright (c) 2020 Vivante Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*****************************************************************************/

#ifndef _VSI_NN_OP_CROP_AND_RESIZE_H
#define _VSI_NN_OP_CROP_AND_RESIZE_H

#include "vsi_nn_types.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _vsi_nn_crop_and_resize_param
{
struct _crop_and_resize_local_data_t * lcl_data;
const int32_t* crop_size;
vsi_enum resize_method;
float extrapolation_value;
} vsi_nn_crop_and_resize_param;

#ifdef __cplusplus
}
#endif

#endif

5 changes: 5 additions & 0 deletions src/tim/vx/internal/include/ops/vsi_nn_op_lstm_ovxlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ enum
LSTM_INPUT_AUX_WEIGHT_I2C = 27,
LSTM_INPUT_AUX_WEIGHT_I2O = 28,

LSTM_INPUT_BIAS_R2I = 29,
LSTM_INPUT_BIAS_R2F = 30,
LSTM_INPUT_BIAS_R2C = 31,
LSTM_INPUT_BIAS_R2O = 32,

LSTM_INPUT_CNT,

LSTM_OUTPUT_OUTPUT = 0,
Expand Down
5 changes: 5 additions & 0 deletions src/tim/vx/internal/include/ops/vsi_nn_op_lstmunit_ovxlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ enum
LSTMUNIT_INPUT_AUX_WEIGHT_I2C = 27,
LSTMUNIT_INPUT_AUX_WEIGHT_I2O = 28,

LSTMUNIT_INPUT_BIAS_R2I = 29,
LSTMUNIT_INPUT_BIAS_R2F = 30,
LSTMUNIT_INPUT_BIAS_R2C = 31,
LSTMUNIT_INPUT_BIAS_R2O = 32,

LSTMUNIT_INPUT_CNT,

LSTMUNIT_OUTPUT_OUTPUT = 0,
Expand Down
3 changes: 2 additions & 1 deletion src/tim/vx/internal/include/ops/vsi_nn_op_resize.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ typedef uint32_t vsi_nn_interpolation_type_t; enum
{
VSI_NN_INTERPOLATION_NEAREST_NEIGHBOR = 0,
VSI_NN_INTERPOLATION_BILINEAR,
VSI_NN_INTERPOLATION_AREA
VSI_NN_INTERPOLATION_AREA,
VSI_NN_INTERPOLATION_CUBIC
};

typedef uint32_t vsi_nn_resize_layout_type_t; enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extern "C" {
typedef struct _vsi_nn_scatter_nd_update_param
{
vsi_bool use_locking;
vsi_nn_reduction_type_e reduction;
} vsi_nn_scatter_nd_update_param;

#ifdef __cplusplus
Expand Down
6 changes: 6 additions & 0 deletions src/tim/vx/internal/include/utils/vsi_nn_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@ char* vsi_nn_getenv
const char * var_name
);

int32_t vsi_nn_getenv_asint
(
const char* env,
int32_t default_value
);

FILE* vsi_nn_fopen
(
const char * file_name,
Expand Down
1 change: 1 addition & 0 deletions src/tim/vx/internal/include/vip/virtual_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class IDevice {
OVXLIB_API IDevice(uint32_t id);
OVXLIB_API ~IDevice();
OVXLIB_API uint32_t Id() const;
OVXLIB_API bool GraphSubmit(vsi_nn_graph_t* graph, bool (*func)(const void*), data_t data);
OVXLIB_API bool GraphSubmit(vsi_nn_graph_t* graph, func_t func, data_t data);
OVXLIB_API bool GraphRemove(const vsi_nn_graph_t* graph);
OVXLIB_API bool ThreadExit();
Expand Down
2 changes: 2 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ typedef struct _vsi_nn_runtime_option_t
int32_t enable_dataconvert_optimize;
int32_t enable_stream_processor;
int32_t enable_rgb88_planar_nhwc;
int32_t enable_slice_optimize;
int32_t enable_batch_opt;
} vsi_nn_runtime_option_t;

/**
Expand Down
33 changes: 33 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_feature_config.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/****************************************************************************
*
* Copyright (c) 2019 Vivante Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the Software),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*****************************************************************************/
/*****Auto generated header file, Please DO NOT modify manually!*****/
#ifndef _VSI_NN_FEATURE_CONFIG_H
#define _VSI_NN_FEATURE_CONFIG_H
Expand All @@ -20,5 +43,15 @@
#define VSI_CONCAT_ENHANCE_SUPPORT
#endif
#define VSI_CREATE_TENSOR_FROM_VIEW_SUPPORT
#ifndef VSI_SWAP_HANDLE_CACHE_SUPPORT
#define VSI_SWAP_HANDLE_CACHE_SUPPORT
#endif
#define VSI_EXPORT_APIS_FOR_SETUP_GRAPH 1
#if defined(VX_SET_TENSOR_MEMPOOL_TYPE_SUPPORT) && VX_SET_TENSOR_MEMPOOL_TYPE_SUPPORT
#define VSI_CREATE_TENSOR_FROM_AXISRAM_SUPPORT
#endif
#if defined(VX_13_NN_COMPATIBLITY)
#define VSI_MAP_TENSOR_PATCH_SUPPORT
#endif

#endif
37 changes: 37 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,31 @@ OVXLIB_API vsi_nn_tensor_id_t vsi_nn_AddTensorFromView
vsi_size_t* end
);

/**
* Add a new tensor from AXI-SRAM
* Create a new tensor from internal AXI-SRAM and add it to graph.
* It just creates the tensor object and does not actually allocate the memory
* in AXI-SRAM until the verify graph stage. In the other words, the tensor object is
* created beforehand,but the memory for storing its data is not allocate until verify
* graph stage. AXI-SRAM is the internal memory resource that memory allocation is done
* strategically to optimize performance and resource usage in graph verification.
* If there is no enough memory in AXI-SRAM, vsi_nn_VerifyGraph will return VSI_FAILURE
* User can't access the tensor memory(read/write tensor data) before the graph has verified,
* since the tensor memory is not allocated.
* @param[in] graph Graph handle
* @param[in] id Optional id to the tensor, set it to VSI_NN_TENSOR_ID_AUTO,
* and a new id will be generated.
* @param[in] attr Tensor attirbutes to the new tensor.
*
* @return The new tensor id on success, or VSI_NN_TENSOR_ID_NA otheriwse.
*/
OVXLIB_API vsi_nn_tensor_id_t vsi_nn_AddTensorFromAXISRAM
(
vsi_nn_graph_t * graph,
vsi_nn_tensor_id_t id,
vsi_nn_tensor_attr_t * attr
);

/**
* Attach tensor to graph
* Attach an exist tensor to graph.
Expand Down Expand Up @@ -796,6 +821,18 @@ OVXLIB_API vsi_status vsi_nn_SetGraphTransformOption
size_t size
);

/**
* graph shape inference
*
* @param[in] graph Graph handle
*
* @return VSI_SUCCESS on success, or appropriate error code otherwise
* */
OVXLIB_API vsi_status vsi_nn_InferShape
(
vsi_nn_graph_t* graph
);

#ifdef __cplusplus
}
#endif
Expand Down
16 changes: 16 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,22 @@ OVXLIB_API void vsi_nn_PrintNode
vsi_nn_node_id_t id
);

#if VX_GRAPH_BATCH_OPT_SUPPORT
/**
* Set how much this node is divided into on batch dim.
*
* @param[in] node Node.
* @param[in] split_num.
*
* @return VSI_SUCCESS on success, or error core otherwise.
*/
OVXLIB_API vsi_status vsi_nn_SetNodeBatchSplitNum
(
vsi_nn_node_t* node,
int8_t split_num
);
#endif

/**
* Update node attribute
* Update openvx node attribute based on ovxlib's node attribute
Expand Down
2 changes: 2 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_node_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
#include "ops/vsi_nn_op_lpnorm.h"
#include "ops/vsi_nn_op_resize_3d.h"
#include "ops/vsi_nn_op_reducel2.h"
#include "ops/vsi_nn_op_crop_and_resize.h"
/* custom node head define define */
#include "custom/vsi_nn_custom_node_type.h"
#include "ops/vsi_nn_op_inverse_sigmoid.h"
Expand Down Expand Up @@ -406,6 +407,7 @@ typedef union _vsi_nn_nn_param
vsi_nn_lpnorm_param lpnorm;
vsi_nn_resize_3d_param resize_3d;
vsi_nn_reducel2_param reducel2;
vsi_nn_crop_and_resize_param crop_and_resize;
void* client_param;

/* custom node data struct define */
Expand Down
3 changes: 3 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#if defined(VX_KHR_COMPATIBILITY) && (0x1==VX_KHR_COMPATIBILITY)
#include <VX/vx_khr_compatible.h>
#endif
#ifdef VSI_CREATE_TENSOR_FROM_AXISRAM_SUPPORT
#include <VX/vx_viv_sys.h>
#endif

/*
This is a compatibility head file for backward compatibility OpenVX 1.1 spec
Expand Down
2 changes: 2 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_pre_post_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ typedef enum
VSI_NN_SOURCE_FORMAT_IMAGE_YUYV422,
VSI_NN_SOURCE_FORMAT_IMAGE_UYVY422,
VSI_NN_SOURCE_FORMAT_IMAGE_NV21,
VSI_NN_SOURCE_FORMAT_IMAGE_NV12_RGGB,
VSI_NN_SOURCE_FORMAT_IMAGE_NV21_BGGR,
} vsi_nn_preprocess_source_format_e;

/**
Expand Down
5 changes: 5 additions & 0 deletions src/tim/vx/internal/include/vsi_nn_pub.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,10 @@
#include "utils/vsi_nn_dtype_util.h"
#include "quantization/vsi_nn_asymmetric_affine.h"
#include "quantization/vsi_nn_dynamic_fixed_point.h"

#if defined(VSI_ENABLE_LCOV_TEST) && VSI_ENABLE_LCOV_TEST
#include "lcov/vsi_nn_coverage.h"
#endif

#endif

Loading
Loading