aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
diff options
context:
space:
mode:
authorGravatar Rasmus Munk Larsen <rmlarsen@google.com>2016-06-03 16:28:58 -0700
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2016-06-03 16:28:58 -0700
commit76308e7fd277ad962a87724040670da827a27db4 (patch)
treea4b431787f1b826e3660c85eb4b8b1e044a9d750 /unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
parent8d97ba6b2251aabf325ff74f24959ceaa85cf11e (diff)
Add CurrentThreadId and NumThreads methods to Eigen threadpools and TensorDeviceThreadPool.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
index d31b0ad38..90fded8ad 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
@@ -172,6 +172,10 @@ struct ThreadPoolDevice {
pool_->Schedule(func);
}
+ EIGEN_STRONG_INLINE size_t currentThreadId() const {
+ return pool_->CurrentThreadId();
+ }
+
// parallelFor executes f with [0, n) arguments in parallel and waits for
// completion. F accepts a half-open interval [first, last).
// Block size is choosen based on the iteration cost and resulting parallel