aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
diff options
context:
space:
mode:
authorGravatar Rasmus Munk Larsen <rmlarsen@google.com>2017-10-13 15:58:12 -0700
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2017-10-13 15:58:12 -0700
commitf349507e02b7623d439d90006289d0d74a75898d (patch)
treeffa2620dba7af5d4e07a1e439fe322c32c73c5d7 /unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
parent1b7294f6fc5661ef196acf95f0eafa3242939be1 (diff)
Specialize ThreadPoolDevice::enqueueNotification for the case with no args. As an example this reduces binary size of an TensorFlow demo app for Android by about 2.5%.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
index 16180ca69..ec6802e85 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
@@ -154,7 +154,11 @@ struct ThreadPoolDevice {
template <class Function, class... Args>
EIGEN_STRONG_INLINE void enqueueNoNotification(Function&& f, Args&&... args) const {
- pool_->Schedule(std::bind(f, args...));
+ if (sizeof...(args) > 0) {
+ pool_->Schedule(std::bind(f, args...));
+ } else {
+ pool_->Schedule(f);
+ }
}
// Returns a logical thread index between 0 and pool_->NumThreads() - 1 if