Skip to content

Commit

Permalink
Add NGRAPH_UNIT_TEST_ENABLE cmake key to control backends build in un…
Browse files Browse the repository at this point in the history
…it-test target (#6232)
  • Loading branch information
Gleb Kazantaev authored Jun 18, 2021
1 parent ac01777 commit 72c8743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ngraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ngraph/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 72c8743

Please sign in to comment.