Skip to content

Commit

Permalink
[infra/onert] Update coverage and strict build target
Browse files Browse the repository at this point in the history
This commit updates coverage and strict build target
- Remove coverage build for test and contrib
- Add coverage and strict build for release libraries (python, cl_common)
- Fix build error by strict build option

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh committed Dec 17, 2024
1 parent 913cfa9 commit ddf115c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion runtime/contrib/gpu_cl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ target_link_libraries(${LIB_ONERT_BACKEND_GPU_CL} PRIVATE tflite-gpu-delegate)
target_link_libraries(${LIB_ONERT_BACKEND_GPU_CL} PRIVATE onert_core)
target_link_libraries(${LIB_ONERT_BACKEND_GPU_CL} PRIVATE ${LIB_ONERT_BACKEND_CL_COMMON})
target_link_libraries(${LIB_ONERT_BACKEND_GPU_CL} PRIVATE nnfw_common)
target_link_libraries(${LIB_ONERT_BACKEND_GPU_CL} PRIVATE nnfw_coverage)

set_target_properties(${LIB_ONERT_BACKEND_GPU_CL} PROPERTIES OUTPUT_NAME backend_gpu_cl)

Expand Down
1 change: 1 addition & 0 deletions runtime/onert/api/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ file(GLOB_RECURSE NNFW_API_PYBIND_SOURCES "src/*.cc")
pybind11_add_module(nnfw_api_pybind ${NNFW_API_PYBIND_SOURCES})
target_include_directories(nnfw_api_pybind PRIVATE include)
target_link_libraries(nnfw_api_pybind PRIVATE nnfw-dev)
target_link_libraries(nnfw_api_pybind PRIVATE nnfw_common nnfw_coverage)

# Install the Python module
install(TARGETS nnfw_api_pybind DESTINATION lib)
5 changes: 4 additions & 1 deletion runtime/onert/api/python/src/nnfw_api_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ void ensure_status(NNFW_STATUS status)
case NNFW_STATUS::NNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE:
std::cout << "[ERROR]\tNNFW_STATUS_INSUFFICIENT_OUTPUT_SIZE\n";
exit(1);
case NNFW_STATUS::NNFW_STATUS_DEPRECATED_API:
std::cout << "[ERROR]\tNNFW_STATUS_DEPRECATED_API\n";
exit(1);
}
}

Expand Down Expand Up @@ -129,7 +132,7 @@ const char *getStringType(NNFW_TYPE type)
uint64_t num_elems(const nnfw_tensorinfo *tensor_info)
{
uint64_t n = 1;
for (uint32_t i = 0; i < tensor_info->rank; ++i)
for (int32_t i = 0; i < tensor_info->rank; ++i)
{
n *= tensor_info->dims[i];
}
Expand Down
1 change: 1 addition & 0 deletions runtime/onert/backend/cl_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ add_library(${LIB_ONERT_BACKEND_CL_COMMON} STATIC ${SOURCES})
target_include_directories(${LIB_ONERT_BACKEND_CL_COMMON} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
set_target_properties(${LIB_ONERT_BACKEND_CL_COMMON} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(${LIB_ONERT_BACKEND_CL_COMMON} PUBLIC onert_core)
target_link_libraries(${LIB_ONERT_BACKEND_CL_COMMON} PRIVATE nnfw_common nnfw_coverage)
1 change: 0 additions & 1 deletion tests/libs/nnapi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_library(${LIB_NNAPI} STATIC ${SOURCES_FRONTEND})
target_include_directories(${LIB_NNAPI} PUBLIC include)
target_link_libraries(${LIB_NNAPI} PUBLIC onert_core) # TODO Link PRIVATE onert_core
target_link_libraries(${LIB_NNAPI} PRIVATE nnfw_common)
target_link_libraries(${LIB_NNAPI} PRIVATE nnfw_coverage)

if(NOT ENABLE_TEST)
return()
Expand Down

0 comments on commit ddf115c

Please sign in to comment.