Commit 5bf6c0ef authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CPU: Hook PCH and debuginfo support to the build system

parent c82d9e9e
...@@ -115,6 +115,10 @@ if(LLVM_INCLUDE_DIR) ...@@ -115,6 +115,10 @@ if(LLVM_INCLUDE_DIR)
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti") set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti")
set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS set_source_files_properties(codegen/compiler.cpp PROPERTIES COMPILE_DEFINITIONS
"EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\";CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.0/include\";NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\"") "EIGEN_HEADERS_PATH=\"${EIGEN_INCLUDE_DIR}\";CLANG_BUILTIN_HEADERS_PATH=\"${LLVM_LIB_DIR}/clang/5.0.0/include\";NGRAPH_HEADERS_PATH=\"${NGRAPH_INCLUDE_PATH}\"")
set(CPU_ENABLE_PCH 0 CACHE STRING "Enable pre-compiled headers in the CPU backend")
set(CPU_ENABLE_DEBUGINFO 0 CACHE STRING "Enable debuginfo in the CPU backend")
set_source_files_properties(runtime/cpu/external_function.cpp PROPERTIES COMPILE_DEFINITIONS
"NGCPU_PCH=${CPU_ENABLE_PCH};NGCPU_DEBUGINFO=${CPU_ENABLE_DEBUGINFO}")
endif() endif()
add_library(ngraph SHARED ${SRC}) add_library(ngraph SHARED ${SRC})
......
...@@ -59,11 +59,6 @@ ...@@ -59,11 +59,6 @@
#include "ngraph/runtime/cpu/external_function.hpp" #include "ngraph/runtime/cpu/external_function.hpp"
#include "ngraph/runtime/utils.hpp" #include "ngraph/runtime/utils.hpp"
// TODO: Decide if we want to ship this or
// just enable it for developer build-test cycles
//#define NGCPU_PCH
//#define NGCPU_DEBUGINFO
using namespace std; using namespace std;
using namespace ngraph::runtime::cpu; using namespace ngraph::runtime::cpu;
...@@ -249,11 +244,11 @@ extern "C" void __entrypoint(ngraph::runtime::cpu::CallFrame* call_frame, ...@@ -249,11 +244,11 @@ extern "C" void __entrypoint(ngraph::runtime::cpu::CallFrame* call_frame,
ngraph::codegen::execution_state estate; ngraph::codegen::execution_state estate;
#if defined(NGCPU_PCH) #if NGCPU_PCH
estate.enable_pch(); estate.enable_pch();
#endif #endif
#if defined(NGCPU_DEBUGINFO) #if NGCPU_DEBUGINFO
estate.enable_debuginfo(); estate.enable_debuginfo();
#endif #endif
......
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