Commit 202fc714 authored by Jaikrishnan Menon's avatar Jaikrishnan Menon Committed by Robert Kimball

Switch to the OpenMP threadpool (#1638)

* Use the Eigen OpenMP thread pool device

* CMake: Work around ancient non-compliant compilers used by the CI system

* Work around the broken CI system by making OpenMP optional
parent b5f43973
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# limitations under the License. # limitations under the License.
# ****************************************************************************** # ******************************************************************************
include(FindOpenMP)
set(SRC set(SRC
cpu_backend.cpp cpu_backend.cpp
cpu_builder.cpp cpu_builder.cpp
...@@ -154,6 +156,13 @@ if (NGRAPH_CPU_ENABLE) ...@@ -154,6 +156,13 @@ if (NGRAPH_CPU_ENABLE)
target_compile_definitions(cpu_backend PRIVATE "NGRAPH_DEX_ONLY") target_compile_definitions(cpu_backend PRIVATE "NGRAPH_DEX_ONLY")
endif() endif()
if(OPENMP_FOUND)
target_compile_options(cpu_backend PRIVATE "${OpenMP_CXX_FLAGS}")
target_compile_definitions(cpu_backend PRIVATE EIGEN_OPENMP)
else()
message(WARNING "The build toolset doesn't support OpenMP. This will impact performance and lead to slowdowns.")
endif()
if(NGRAPH_DISTRIBUTED_ENABLE) if(NGRAPH_DISTRIBUTED_ENABLE)
find_package(MPI REQUIRED) find_package(MPI REQUIRED)
add_definitions(-DNGRAPH_DISTRIBUTED) add_definitions(-DNGRAPH_DISTRIBUTED)
......
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