From a9c1e4d7b7ce7c9dc5310cee1ed13fdef08e506e Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Thu, 23 Jun 2016 16:40:07 -0700 Subject: Return -1 from CurrentThreadId when called by thread outside the pool. --- unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 0af91fe64..34270730b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -172,6 +172,8 @@ struct ThreadPoolDevice { pool_->Schedule(func); } + // Returns a logical thread index between 0 and pool_->NumThreads() - 1 if + // called from one of the threads in pool_. Returns -1 otherwise. EIGEN_STRONG_INLINE int currentThreadId() const { return pool_->CurrentThreadId(); } -- cgit v1.2.3