Commit d98771f8 authored by Robert Kimball's avatar Robert Kimball

put back NGRAPH_CPU_ENABLE flag so that CPU build can be disabled

parent be13ab7c
...@@ -87,6 +87,11 @@ endif() ...@@ -87,6 +87,11 @@ endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
# Set true if CPU backend is built by default
if (NOT DEFINED NGRAPH_CPU_ENABLE)
SET(NGRAPH_CPU_ENABLE TRUE)
endif()
#----------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------
# External projects install directory # External projects install directory
#----------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
include(ExternalProject) include(ExternalProject)
if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND if(NGRAPH_CPU_ENABLE AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND
(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")) (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows"))
message(STATUS "Fetching LLVM from llvm.org") message(STATUS "Fetching LLVM from llvm.org")
set(LLVM_RELEASE_URL http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu16.04.tar.xz) set(LLVM_RELEASE_URL http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-linux-x86_64-ubuntu16.04.tar.xz)
......
...@@ -95,7 +95,7 @@ include_directories( ...@@ -95,7 +95,7 @@ include_directories(
"${EIGEN_INCLUDE_DIR}" "${EIGEN_INCLUDE_DIR}"
) )
if (LLVM_INCLUDE_DIR AND if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
MKLDNN_INCLUDE_DIR) MKLDNN_INCLUDE_DIR)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
...@@ -162,7 +162,7 @@ message(STATUS "LIBRARY_OUTPUT_DIRECTORY set to: ${COMMON_LIBRARY_OUTPUT_DIRECTO ...@@ -162,7 +162,7 @@ message(STATUS "LIBRARY_OUTPUT_DIRECTORY set to: ${COMMON_LIBRARY_OUTPUT_DIRECTO
target_include_directories(ngraph PUBLIC "${NGRAPH_INCLUDE_PATH}") target_include_directories(ngraph PUBLIC "${NGRAPH_INCLUDE_PATH}")
if(LLVM_LINK_LIBS) if(NGRAPH_CPU_ENABLE AND LLVM_LINK_LIBS)
target_link_libraries(ngraph PRIVATE ${LLVM_LINK_LIBS}) target_link_libraries(ngraph PRIVATE ${LLVM_LINK_LIBS})
endif() endif()
...@@ -172,7 +172,7 @@ if (APPLE) ...@@ -172,7 +172,7 @@ if (APPLE)
set_property(TARGET ngraph PROPERTY SUFFIX "") set_property(TARGET ngraph PROPERTY SUFFIX "")
endif() endif()
if(MKLDNN_LIB_DIR) if(NGRAPH_CPU_ENABLE AND MKLDNN_LIB_DIR)
target_link_libraries(ngraph PRIVATE mkldnn) target_link_libraries(ngraph PRIVATE mkldnn)
endif() endif()
...@@ -211,7 +211,7 @@ install(DIRECTORY ...@@ -211,7 +211,7 @@ install(DIRECTORY
DESTINATION "${NGRAPH_INSTALL_LIB}" DESTINATION "${NGRAPH_INSTALL_LIB}"
) )
endif() endif()
if (LLVM_INCLUDE_DIR AND if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
MKLDNN_INCLUDE_DIR) MKLDNN_INCLUDE_DIR)
# Currently this is required for Argon codegen. To avoid this, we'll need to decouple LLVM from # Currently this is required for Argon codegen. To avoid this, we'll need to decouple LLVM from
# compiler.hpp # compiler.hpp
...@@ -227,10 +227,10 @@ endif() ...@@ -227,10 +227,10 @@ endif()
add_dependencies(ngraph eigen) add_dependencies(ngraph eigen)
if(LLVM_INCLUDE_DIR) if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
add_dependencies(ngraph ext_llvm) add_dependencies(ngraph ext_llvm)
endif() endif()
if(MKLDNN_INCLUDE_DIR) if(NGRAPH_CPU_ENABLE AND MKLDNN_INCLUDE_DIR)
add_dependencies(ngraph ext_mkldnn) add_dependencies(ngraph ext_mkldnn)
endif() endif()
...@@ -57,7 +57,7 @@ if(MKLDNN_INCLUDE_DIR) ...@@ -57,7 +57,7 @@ if(MKLDNN_INCLUDE_DIR)
set(SRC ${SRC} mkldnn.cpp) set(SRC ${SRC} mkldnn.cpp)
endif() endif()
if(LLVM_INCLUDE_DIR) if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR}) include_directories(SYSTEM ${LLVM_INCLUDE_DIR})
link_directories(${LLVM_LIB_DIR}) link_directories(${LLVM_LIB_DIR})
set(SRC ${SRC} codegen.cpp) set(SRC ${SRC} codegen.cpp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment