From a432fc102df1fc9b0f14b2abda5f57ed3993de16 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Mon, 12 Dec 2016 15:24:16 -0800 Subject: [PATCH] Moved the choice of ThreadPool to unsupported/Eigen/CXX11/ThreadPool --- unsupported/Eigen/CXX11/ThreadPool | 12 ++++++++++++ .../Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/unsupported/Eigen/CXX11/ThreadPool b/unsupported/Eigen/CXX11/ThreadPool index 141372f63..c34614194 100644 --- a/unsupported/Eigen/CXX11/ThreadPool +++ b/unsupported/Eigen/CXX11/ThreadPool @@ -58,6 +58,18 @@ #include "src/ThreadPool/SimpleThreadPool.h" #include "src/ThreadPool/NonBlockingThreadPool.h" + +// Use the more efficient NonBlockingThreadPool by default. +namespace Eigen { +#ifndef EIGEN_USE_SIMPLE_THREAD_POOL +template using ThreadPoolTempl = NonBlockingThreadPoolTempl; +typedef NonBlockingThreadPool ThreadPool; +#else +template using ThreadPoolTempl = SimpleThreadPoolTempl; +typedef SimpleThreadPool ThreadPool; +#endif +} // namespace Eigen + #endif #include diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 210ae1368..16180ca69 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -12,17 +12,6 @@ namespace Eigen { -// Use the SimpleThreadPool by default. We'll switch to the new non blocking -// thread pool later. -#ifndef EIGEN_USE_SIMPLE_THREAD_POOL -template using ThreadPoolTempl = NonBlockingThreadPoolTempl; -typedef NonBlockingThreadPool ThreadPool; -#else -template using ThreadPoolTempl = SimpleThreadPoolTempl; -typedef SimpleThreadPool ThreadPool; -#endif - - // Barrier is an object that allows one or more threads to wait until // Notify has been called a specified number of times. class Barrier {