Skip to content

Commit

Permalink
memset io input output (#116)
Browse files Browse the repository at this point in the history
* memset io input output

* modify index

* ax620e
  • Loading branch information
ZHEQIUSHUI authored Jan 5, 2024
1 parent a9f9941 commit f261455
Show file tree
Hide file tree
Showing 24 changed files with 4,206 additions and 54 deletions.
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ include_directories(.)
if(AXERA_TARGET_CHIP MATCHES "ax650")
add_subdirectory(${CMAKE_SOURCE_DIR}/examples/ax650)
elseif(AXERA_TARGET_CHIP MATCHES "ax620e")
add_subdirectory(${CMAKE_SOURCE_DIR}/examples/ax650)
add_subdirectory(${CMAKE_SOURCE_DIR}/examples/ax620e)
elseif(AXERA_TARGET_CHIP MATCHES "ax620a")
add_subdirectory(${CMAKE_SOURCE_DIR}/examples/ax620)
elseif(AXERA_TARGET_CHIP MATCHES "ax630a")
Expand Down
8 changes: 8 additions & 0 deletions examples/ax620/middleware/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ namespace middleware
return nullptr;
}
io.pInputs = new AX_JOINT_IO_BUFFER_T[io.nInputSize];
memset(io.pInputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nInputSize);

// fill input

Expand Down Expand Up @@ -202,6 +203,7 @@ namespace middleware
// deal with output
io.nOutputSize = io_info->nOutputSize;
io.pOutputs = new AX_JOINT_IO_BUFFER_T[io.nOutputSize];
memset(io.pOutputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nOutputSize);
for (size_t i = 0; i < io.nOutputSize; ++i)
{
const AX_JOINT_IOMETA_T* pMeta = io_info->pOutputs + i;
Expand All @@ -223,6 +225,7 @@ namespace middleware
return -1;
}
io.pInputs = new AX_JOINT_IO_BUFFER_T[io.nInputSize];
memset(io.pInputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nInputSize);

// fill input
{
Expand Down Expand Up @@ -255,6 +258,7 @@ namespace middleware
{
io.nOutputSize = io_info->nOutputSize;
io.pOutputs = new AX_JOINT_IO_BUFFER_T[io.nOutputSize];
memset(io.pOutputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nOutputSize);
for (size_t i = 0; i < io.nOutputSize; ++i)
{
const AX_JOINT_IOMETA_T* pMeta = io_info->pOutputs + i;
Expand All @@ -277,6 +281,7 @@ namespace middleware
return -1;
}
io.pInputs = new AX_JOINT_IO_BUFFER_T[io.nInputSize];
memset(io.pInputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nInputSize);

// fill input
{
Expand Down Expand Up @@ -319,6 +324,7 @@ namespace middleware
{
io.nOutputSize = io_info->nOutputSize;
io.pOutputs = new AX_JOINT_IO_BUFFER_T[io.nOutputSize];
memset(io.pOutputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nOutputSize);
for (size_t i = 0; i < io.nOutputSize; ++i)
{
const AX_JOINT_IOMETA_T* pMeta = io_info->pOutputs + i;
Expand All @@ -340,6 +346,7 @@ namespace middleware
return -1;
}
io.pInputs = new AX_JOINT_IO_BUFFER_T[io.nInputSize];
memset(io.pInputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nInputSize);

// fill input
{
Expand Down Expand Up @@ -382,6 +389,7 @@ namespace middleware
{
io.nOutputSize = io_info->nOutputSize;
io.pOutputs = new AX_JOINT_IO_BUFFER_T[io.nOutputSize];
memset(io.pOutputs, 0, sizeof(AX_JOINT_IO_BUFFER_T) * io.nOutputSize);
for (size_t i = 0; i < io.nOutputSize; ++i)
{
const AX_JOINT_IOMETA_T* pMeta = io_info->pOutputs + i;
Expand Down
39 changes: 39 additions & 0 deletions examples/ax620e/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# AXERA is pleased to support the open source community by making ax-samples available.
#
# Copyright (c) 2022, AXERA Semiconductor (Shanghai) Co., Ltd. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
# Author:
#

find_package(Threads)
find_package(OpenCV REQUIRED)

include("${CMAKE_SOURCE_DIR}/cmake/ax650.cmake")

axera_example(ax_classification ax_classification_steps.cc)

axera_example(ax_yolov5s ax_yolov5s_steps.cc)
axera_example(ax_yolov5s_seg ax_yolov5s_seg_steps.cc)
axera_example(ax_yolov5_face ax_yolov5_face_steps.cc)
axera_example(ax_yolov6 ax_yolov6_steps.cc)
axera_example(ax_yolov7_tiny_face ax_yolov7_tiny_face_steps.cc)
axera_example(ax_yolov7 ax_yolov7_steps.cc)
axera_example(ax_yolov8 ax_yolov8s_steps.cc)
axera_example(ax_yolov8_pose ax_yolov8s_pose_steps.cc)
axera_example(ax_yolox ax_yolox_steps.cc)

axera_example(ax_scrfd ax_scrfd_steps.cc)
axera_example(ax_simcc_pose ax_simcc_pose_steps.cc)

axera_example(ax_imgproc ax_imgproc_steps.cc)
axera_example(ax_model_info ax_model_info.cc)
Loading

0 comments on commit f261455

Please sign in to comment.