Refactor CMake build system (#184)

* Remove unnecessary compiler flags

* Refactor CMakeLists.txt

* Tweak CMakeLists.txt for libtim_internal

* Tweak CMakeLists.txt for libtim-vx

* Make TIM_VX_ENABLE_TEST defaults to OFF

* Eliminate usage of include_directories

* Fix CI unit test
This commit is contained in:
Goose Bomb 2021-10-12 10:44:49 +08:00 committed by GitHub
parent 8aacd785b1
commit 914e280209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
58 changed files with 192 additions and 177 deletions

View File

@ -24,7 +24,7 @@ jobs:
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTIM_VX_ENABLE_TEST=ON
- name: Build
# Build your program with the given configuration

View File

@ -1,11 +1,13 @@
cmake_minimum_required (VERSION 3.14)
project(tim-vx LANGUAGES C CXX)
OPTION(TIM_VX_ENABLE_TEST "Build the unit test" ON)
OPTION(TIM_VX_ENABLE_LAYOUT_INFER "Enable layout inference support" ON)
OPTION(TIM_VX_CODE_COVERAGE "Run code coverage with gconv(gcc only" OFF)
OPTION(TIM_VX_USE_EXTERNAL_OVXLIB "Use external OVXLIB" OFF)
OPTION(TIM_VX_ENABLE_NB_PARSER_EXAMPLE "Demo shows nbg parser usage" OFF)
option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
option(TIM_VX_ENABLE_TEST "Build the unit test" OFF)
option(TIM_VX_ENABLE_LAYOUT_INFER "Enable layout inference support" ON)
option(TIM_VX_ENABLE_NBG_PARSER "Enable NBG parser" OFF)
option(TIM_VX_CODE_COVERAGE "Run code coverage with gconv(gcc only" OFF)
option(TIM_VX_USE_EXTERNAL_OVXLIB "Use external OVXLIB" OFF)
option(TIM_VX_BUILD_EXAMPLES "Build demos show general usage" OFF)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@ -27,7 +29,6 @@ if(EXTERNAL_VIV_SDK AND EXISTS ${EXTERNAL_VIV_SDK})
# this is for internal development purpose
include(cmake/local_sdk.cmake)
else()
set(TIM_VX_ENABLE_TEST OFF)
if("${CONFIG}" STREQUAL "A311D")
include(cmake/A311D.cmake)
elseif("${CONFIG}" STREQUAL "S905D3")
@ -37,7 +38,6 @@ else()
elseif("${CONFIG}" STREQUAL "YOCTO")
include(cmake/YOCTO.cmake)
else()
set(TIM_VX_ENABLE_TEST ON)
include(cmake/X86_64_linux.cmake)
endif()
endif()
@ -60,7 +60,8 @@ if(TIM_VX_ENABLE_TEST)
endif()
endif()
include_directories(${OVXDRV_INCLUDE_DIRS})
add_subdirectory("src/tim")
add_subdirectory("src/tim/")
add_subdirectory("samples")
if(TIM_VX_BUILD_EXAMPLES)
add_subdirectory("samples")
endif()

View File

@ -1,7 +1,10 @@
add_subdirectory("benchmark_test")
add_subdirectory("lenet")
add_subdirectory("nbg_runner")
if(NOT ANDROID_TOOLCHAIN)
add_subdirectory("multi_thread_test")
endif()
if(TIM_VX_ENABLE_NBG_PARSER)
add_subdirectory("nbg_runner")
endif()

View File

@ -1,11 +1,9 @@
message("benchmark_test")
message("samples/benchmark_test")
set(TARGET_NAME "benchmark_test")
aux_source_directory(. SRC)
aux_source_directory(. ${TARGET_NAME}_SRCS)
add_executable(${TARGET_NAME} ${${TARGET_NAME}_SRCS})
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(./)
add_executable(${TARGET_NAME} ${SRC})
target_link_libraries(${TARGET_NAME} ${OVXDRV_LIBRARIES} tim-vx-static)
target_link_libraries(${TARGET_NAME} PRIVATE tim-vx)
target_include_directories(${TARGET_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include)

View File

@ -2,10 +2,11 @@ message("samples/lenet")
set(TARGET_NAME "lenet")
aux_source_directory(. SRC)
aux_source_directory(. ${TARGET_NAME}_SRCS)
add_executable(${TARGET_NAME} ${${TARGET_NAME}_SRCS})
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(./)
add_executable(${TARGET_NAME} ${SRC})
target_link_libraries(${TARGET_NAME} ${OVXDRV_LIBRARIES} tim-vx-static)
target_link_libraries(${TARGET_NAME} PRIVATE tim-vx)
target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
)

View File

@ -2,10 +2,13 @@ message("samples/multi_thread_test")
set(TARGET_NAME "multi_thread_test")
aux_source_directory(. SRC)
find_package(Threads REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(./)
aux_source_directory(. ${TARGET_NAME}_SRCS)
add_executable(${TARGET_NAME} ${${TARGET_NAME}_SRCS})
add_executable(${TARGET_NAME} ${SRC})
target_link_libraries(${TARGET_NAME} ${OVXDRV_LIBRARIES} tim-vx-static pthread)
target_link_libraries(${TARGET_NAME} PRIVATE tim-vx Threads::Threads)
target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
)

View File

@ -1,8 +1,9 @@
if(TIM_VX_ENABLE_NB_PARSER_EXAMPLE)
message("samples/nbg_runner")
include_directories(${PROJECT_SOURCE_DIR}/include)
aux_source_directory(. nbg_runner_src)
add_executable(nbg_runner ${nbg_runner_src})
target_link_libraries(nbg_runner tim-vx-static nbg_parser)
set(TARGET_NAME "nbg_runner")
endif()
aux_source_directory(. ${TARGET_NAME}_SRCS)
add_executable(${TARGET_NAME} ${${TARGET_NAME}_SRCS})
target_link_libraries(${TARGET_NAME} PRIVATE tim-vx nbg_parser)
target_include_directories(${TARGET_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include)

View File

@ -15,15 +15,11 @@ endif()
aux_source_directory(./vx VX_SRC)
aux_source_directory(./vx/ops OPS_SRC)
set(SRC)
list(APPEND SRC
set(${TARGET_NAME}_SRCS)
list(APPEND ${TARGET_NAME}_SRCS
${VX_SRC}
${OPS_SRC}
)
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/include/tim/vx)
include_directories(${PROJECT_SOURCE_DIR}/src/tim/vx)
)
if(${TIM_VX_USE_EXTERNAL_OVXLIB})
if(NOT OVXLIB_INC)
@ -34,51 +30,57 @@ else()
set(OVXLIB_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src/tim/vx/internal/include")
endif()
message(STATUS "OVXLIB include directory: ${OVXLIB_INCLUDE_DIR}")
include_directories(${OVXLIB_INCLUDE_DIR})
if(TIM_VX_ENABLE_LAYOUT_INFER)
include_directories(${PROJECT_SOURCE_DIR}/)
aux_source_directory(./transform LAYOUT_INFER_FRAMEWORK_SRCS)
aux_source_directory(./transform/ops LAYOUT_INFER_OP_SRCS)
list(APPEND SRC
list(APPEND ${TARGET_NAME}_SRCS
${LAYOUT_INFER_FRAMEWORK_SRCS}
${LAYOUT_INFER_OP_SRCS}
)
endif()
foreach(src_file ${SRC})
foreach(src_file ${${TARGET_NAME}_SRCS})
if(${src_file} MATCHES ".*_test\.cc")
list(REMOVE_ITEM SRC ${src_file})
list(APPEND UT_SRC ${src_file})
list(REMOVE_ITEM ${TARGET_NAME}_SRCS ${src_file})
list(APPEND ${TARGET_NAME}_TEST_SRCS ${src_file})
endif()
endforeach()
add_library(${TARGET_NAME} SHARED ${SRC})
add_library(${TARGET_NAME} ${${TARGET_NAME}_SRCS})
target_link_libraries(${TARGET_NAME} PRIVATE
-Wl,--whole-archive tim_internal -Wl,--no-whole-archive)
target_include_directories(${TARGET_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/vx
${CMAKE_CURRENT_SOURCE_DIR}/transform
${OVXLIB_INCLUDE_DIR}
${OVXDRV_INCLUDE_DIRS}
)
add_library(${TARGET_NAME}-static STATIC ${SRC})
target_link_libraries(${TARGET_NAME}-static PRIVATE
-Wl,--whole-archive tim_internal -Wl,--no-whole-archive)
install(TARGETS ${TARGET_NAME} ${TARGET_NAME}-static
install(TARGETS ${TARGET_NAME} ${TARGET_NAME}
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/tim/vx DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tim/)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/tim/vx
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tim)
if(TIM_VX_ENABLE_LAYOUT_INFER)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/tim/transform DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tim/)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/tim/transform
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/tim)
endif()
if (TIM_VX_ENABLE_TEST)
if(TIM_VX_ENABLE_TEST)
include(GoogleTest)
add_executable(unit_test ${UT_SRC})
target_link_libraries(unit_test gtest gtest_main gmock gmock_main ${TARGET_NAME}-static)
add_executable(unit_test ${${TARGET_NAME}_TEST_SRCS})
target_link_libraries(unit_test PRIVATE gtest gtest_main gmock gmock_main ${TARGET_NAME})
target_include_directories(unit_test PRIVATE
${PROJECT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/vx
)
install(TARGETS unit_test DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/)
install(TARGETS unit_test DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
endif()
add_subdirectory("utils")

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/activations.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_ADDN_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_ADDN_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/addn.h"
namespace tim {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_ARG_OPS_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_ARG_OPS_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/arg.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/batch2space.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {
class Batch2SpaceLayoutInfer : public OpLayoutInfer {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/concat.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/conv2d.h"
#include "src/tim/vx/operation_private.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "operation_private.h"
#include "permute_vector.h"
#include "ops/op_layout_inference.h"
namespace tim {
namespace transform {

View File

@ -24,9 +24,9 @@
#ifndef TIM_LAYOUT_INFER_DECONV2D_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_DECONV2D_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
#include "tim/vx/ops/deconv.h"
namespace tim {

View File

@ -31,9 +31,9 @@
#include "tim/vx/ops/clip.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/depth2space.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/elementwise.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/fullyconnected.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_GATHER_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_GATHER_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/gather.h"
namespace tim {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_GATHER_ND_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_GATHER_ND_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/gathernd.h"
namespace tim {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_L2_NORMALIZATION_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_L2_NORMALIZATION_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/l2normalization.h"
namespace tim {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_LOGICAL_OPS_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_LOGICAL_OPS_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/logical.h"
namespace tim {

View File

@ -26,8 +26,8 @@
#include "tim/vx/ops/localresponsenormalization.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -23,10 +23,10 @@
*****************************************************************************/
#include "op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "permute_vector.h"
#include "operation_private.h"
#include "tim/vx/ops/transpose.h"
#include "src/tim/vx/type_utils.h"
#include "type_utils.h"
#include <algorithm>
#include <vector>

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/pad.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {
class PadLayoutInfer : public OpLayoutInfer {

View File

@ -24,9 +24,9 @@
#ifndef TIM_LAYOUT_INFER_POOL2D_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_POOL2D_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
#include "tim/vx/ops/pool2d.h"
namespace tim {

View File

@ -28,9 +28,9 @@
#include <set>
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/resize.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {
class ResizeLayoutInfer : public OpLayoutInfer {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_REVERSE_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_REVERSE_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/reverse.h"
namespace tim {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_SELECT_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_SELECT_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/select.h"
namespace tim {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/simple_operations.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -24,8 +24,8 @@
#ifndef TIM_LAYOUT_INFER_SLICE_LAYOUT_INFERENCE_H_
#define TIM_LAYOUT_INFER_SLICE_LAYOUT_INFERENCE_H_
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "operation_private.h"
#include "tim/vx/ops/slice.h"
namespace tim {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/softmax.h"
#include "src/tim/vx/operation_private.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "operation_private.h"
#include "permute_vector.h"
#include "ops/op_layout_inference.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/space2batch.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {
class Space2BatchLayoutInfer : public OpLayoutInfer {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/space2depth.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {
class SpaceToDepthLayoutInfer : public OpLayoutInfer {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/split.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/squeeze.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/stack.h"
#include "src/tim/vx/operation_private.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "operation_private.h"
#include "permute_vector.h"
#include "ops/op_layout_inference.h"
namespace tim {
namespace transform {

View File

@ -26,9 +26,9 @@
#include "tim/vx/ops/stridedslice.h"
#include "src/tim/transform/ops/op_layout_inference.h"
#include "src/tim/transform/permute_vector.h"
#include "src/tim/vx/operation_private.h"
#include "ops/op_layout_inference.h"
#include "permute_vector.h"
#include "operation_private.h"
namespace tim {
namespace transform {

View File

@ -1,6 +1,3 @@
if(TIM_VX_ENABLE_NB_PARSER_EXAMPLE)
aux_source_directory(./nbg_parser nbg_parser_src)
add_library(nbg_parser STATIC ${nbg_parser_src})
if(TIM_VX_ENABLE_NBG_PARSER)
add_subdirectory("nbg_parser")
endif()

View File

@ -0,0 +1,9 @@
message("src/tim/vx/utils/nbg_parser")
set(TARGET_NAME "nbg_parser")
aux_source_directory(. ${TARGET_NAME}_SRCS)
add_library(${TARGET_NAME} STATIC ${${TARGET_NAME}_SRCS})
target_include_directories(${TARGET_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/include
)

View File

@ -1,9 +1,8 @@
message("src/tim/vx/internal")
set(lib_name "tim_internal")
set(TARGET_NAME "tim_internal")
set(OVXLIB_API_ATTR "__attribute__\(\(visibility\(\"default\"\)\)\)")
add_definitions(-DOVXLIB_API=${OVXLIB_API_ATTR})
add_compile_options(-Wno-strict-aliasing -Wno-unused-but-set-variable -Wno-maybe-uninitialized)
aux_source_directory(src INTERNAL_SRC)
aux_source_directory(src/kernel INTERNAL_KERNEL)
@ -18,8 +17,8 @@ aux_source_directory(src/custom/ops INTERNAL_CUSTOM_OPS)
aux_source_directory(src/custom/ops/kernel INTERNAL_CUSTOM_OPS_KERNEL)
aux_source_directory(src/utils INTERNAL_UTILS)
set(SRC)
list(APPEND SRC
set(${TARGET_NAME}_SRCS)
list(APPEND ${TARGET_NAME}_SRCS
${INTERNAL_SRC}
${INTERNAL_KERNEL}
${INTERNAL_KERNEL_CL}
@ -34,8 +33,9 @@ list(APPEND SRC
${INTERNAL_UTILS}
)
include_directories(include)
include_directories(${OVXDRV_INCLUDE_DIRS})
add_library(${lib_name} ${SRC})
target_link_libraries(${lib_name} PRIVATE ${OVXDRV_LIBRARIES})
add_library(${TARGET_NAME} STATIC ${${TARGET_NAME}_SRCS})
target_link_libraries(${TARGET_NAME} PRIVATE ${OVXDRV_LIBRARIES})
target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${OVXDRV_INCLUDE_DIRS}
)

View File

@ -26,7 +26,7 @@
#include "tim/vx/ops/activations.h"
#include "gtest/gtest.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
TEST(Linear, shape_5_1_fp32) {
auto ctx = tim::vx::Context::Create();

View File

@ -25,7 +25,7 @@
#include "tim/vx/graph.h"
#include "tim/vx/ops/addn.h"
#include "tim/vx/types.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"

View File

@ -26,7 +26,7 @@
#include "tim/vx/ops/pool2d.h"
#include <iostream>
#include "gtest/gtest.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
TEST(AVG, shape_3_3_1_2_fp32_kernel_2_stride_1) {
auto ctx = tim::vx::Context::Create();

View File

@ -24,7 +24,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/conv1d.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(Conv1d, shape_3_6_1_float_ksize_1_stride_1_weights_3_no_bias_whcn) {

View File

@ -1,7 +1,7 @@
#include "tim/vx/ops/conv2d.h"
#include "gtest/gtest.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/types.h"

View File

@ -1,5 +1,5 @@
#include "gtest/gtest.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/conv2d.h"

View File

@ -24,7 +24,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/groupedconv2d.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(GroupedConv2d, shape_3_3_6_1_float_group_1_no_bias_whcn) {

View File

@ -24,7 +24,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/instancenormalization.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(InstanceNorm, shape_3_6_1_float) {

View File

@ -24,7 +24,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/layernormalization.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(LayerNorm, axis_0_shape_3_6_1_float) {

View File

@ -24,7 +24,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/logsoftmax.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(LogSoftmax, shape_6_1_float_axis_0) {

View File

@ -24,7 +24,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/matmul.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(Matmul, shape_2_6_shape_6_2_float) {

View File

@ -25,7 +25,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/moments.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(Moments, shape_6_3_1_float_axes_0_1) {

View File

@ -24,7 +24,7 @@
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/resize1d.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"
TEST(Resize1d, shape_4_2_1_float_nearest_whcn) {

View File

@ -25,7 +25,7 @@
#include "tim/vx/graph.h"
#include "tim/vx/ops/shuffle_channel.h"
#include "tim/vx/types.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "gtest/gtest.h"

View File

@ -1,6 +1,6 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "src/tim/vx/test_utils.h"
#include "test_utils.h"
#include "tim/vx/context.h"
#include "tim/vx/graph.h"
#include "tim/vx/ops/deconv.h"