Add NGRAPH_UNIT_TEST_ENABLE cmake key to control backends build in unit-test target (#6232)

This commit is contained in:
Gleb Kazantaev 2021-06-18 17:59:43 +03:00 committed by GitHub
parent ac01777166
commit 72c8743a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -84,6 +84,7 @@ if (APPLE)
endif()
option(NGRAPH_UNIT_TEST_ENABLE "Control the building of unit tests" ON)
option(NGRAPH_UNIT_TEST_BACKENDS_ENABLE "Control the building of unit tests using backends" ON)
option(NGRAPH_INTERPRETER_ENABLE "Control the building of the INTERPRETER backend" ON)
option(NGRAPH_DEBUG_ENABLE "Enable output for NGRAPH_DEBUG statements" OFF)
option(NGRAPH_ONNX_IMPORT_ENABLE "Enable ONNX importer" OFF)
@ -117,6 +118,7 @@ message(STATUS "NGRAPH_THREAD_SANITIZER_ENABLE: ${NGRAPH_THREAD_SANITIZER_
message(STATUS "NGRAPH_UB_SANITIZER_ENABLE: ${NGRAPH_UB_SANITIZER_ENABLE}")
message(STATUS "NGRAPH_USE_PROTOBUF_LITE: ${NGRAPH_USE_PROTOBUF_LITE}")
message(STATUS "NGRAPH_UNIT_TEST_ENABLE: ${NGRAPH_UNIT_TEST_ENABLE}")
message(STATUS "NGRAPH_UNIT_TEST_BACKENDS_ENABLE: ${NGRAPH_UNIT_TEST_BACKENDS_ENABLE}")
# Setup CMAKE_ARGS to be forwarded to External Projects
set(NGRAPH_FORWARD_CMAKE_ARGS

View File

@ -304,7 +304,7 @@ set(SRC
set_source_files_properties(includes.cpp PROPERTIES COMPILE_DEFINITIONS
NGRAPH_INCLUDES="${PROJECT_SOURCE_DIR}/src/ngraph")
if (ENABLE_MKL_DNN)
if (ENABLE_MKL_DNN AND NGRAPH_UNIT_TEST_BACKENDS_ENABLE)
message(STATUS "NGRAPH_TESTS: IE:CPU enabled")
set(ACTIVE_BACKEND_LIST ${ACTIVE_BACKEND_LIST} "IE:CPU")
if (ENABLE_STRICT_DEPENDENCIES)
@ -314,7 +314,7 @@ if (ENABLE_MKL_DNN)
endif()
endif()
if (ENABLE_CLDNN)
if (ENABLE_CLDNN AND NGRAPH_UNIT_TEST_BACKENDS_ENABLE)
message(STATUS "NGRAPH_TESTS: IE:GPU enabled")
set(ACTIVE_BACKEND_LIST ${ACTIVE_BACKEND_LIST} "IE:GPU")
if (ENABLE_STRICT_DEPENDENCIES)
@ -324,7 +324,7 @@ if (ENABLE_CLDNN)
endif()
endif()
if (NGRAPH_INTERPRETER_ENABLE)
if (NGRAPH_INTERPRETER_ENABLE AND NGRAPH_UNIT_TEST_BACKENDS_ENABLE)
list(APPEND SRC
builder.cpp
backend_api.cpp)