Unverified Commit 521d2223 authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

Merge pull request #244 from NervanaSystems/jmenon/fix_cpu

CPU: Minor fixes
parents 7ba8f533 004aab51
...@@ -121,10 +121,10 @@ if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND ...@@ -121,10 +121,10 @@ if (NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR AND
# This must be kept in sync with the LLVM + Clang version in use # This must be kept in sync with the LLVM + Clang version in use
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(NGRAPH_CPU_PCH_ENABLE 0 CACHE STRING "Enable pre-compiled headers in the CPU backend") set(NGRAPH_CPU_PCH_ENABLE 0 CACHE STRING "Enable pre-compiled headers in the CPU backend")
set(NGRAPH_CPU_DEBUGINFO_ENABLE 0 CACHE STRING "Enable debuginfo in the CPU backend") set(NGRAPH_CPU_DEBUGINFO_ENABLE 0 CACHE STRING "Enable debuginfo in the CPU backend")
set_source_files_properties(runtime/cpu/external_function.cpp PROPERTIES COMPILE_DEFINITIONS set_property(SOURCE codegen/compiler.cpp APPEND_STRING PROPERTY COMPILE_DEFINITIONS
"NGCPU_PCH=${NGRAPH_CPU_PCH_ENABLE};NGCPU_DEBUGINFO=${NGRAPH_CPU_DEBUGINFO_ENABLE}") "NGCPU_PCH=${NGRAPH_CPU_PCH_ENABLE};NGCPU_DEBUGINFO=${NGRAPH_CPU_DEBUGINFO_ENABLE}")
endif() endif()
......
...@@ -92,6 +92,14 @@ StaticCompiler::StaticCompiler() ...@@ -92,6 +92,14 @@ StaticCompiler::StaticCompiler()
, m_debuginfo_enabled(false) , m_debuginfo_enabled(false)
, m_source_name("code.cpp") , m_source_name("code.cpp")
{ {
#if NGCPU_PCH
m_precompiled_headers_enabled = true;
#endif
#if NGCPU_DEBUGINFO
m_debuginfo_enabled = true;
#endif
llvm::InitializeAllTargets(); llvm::InitializeAllTargets();
llvm::InitializeAllTargetMCs(); llvm::InitializeAllTargetMCs();
llvm::InitializeAllAsmPrinters(); llvm::InitializeAllAsmPrinters();
......
...@@ -1384,7 +1384,7 @@ void Emitter::generate_call(const std::vector<TensorViewInfo>& inputs, ...@@ -1384,7 +1384,7 @@ void Emitter::generate_call(const std::vector<TensorViewInfo>& inputs,
static string format_name(const string& name) static string format_name(const string& name)
{ {
string rc; string rc;
if (name.empty()) if (!name.empty())
{ {
rc = " " + name; rc = " " + name;
} }
......
...@@ -318,14 +318,6 @@ using namespace ngraph::runtime::cpu::eigen; ...@@ -318,14 +318,6 @@ using namespace ngraph::runtime::cpu::eigen;
codegen::Compiler compiler; codegen::Compiler compiler;
codegen::ExecutionEngine execution_engine; codegen::ExecutionEngine execution_engine;
#if NGCPU_PCH
compiler.set_precompiled_headers_enabled(true);
#endif
#if NGCPU_DEBUGINFO
compiler.set_debuginfo_enabled(true);
#endif
auto llvm_module = compiler.compile(code); auto llvm_module = compiler.compile(code);
if (llvm_module == nullptr) if (llvm_module == nullptr)
{ {
......
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