Add CurrentThreadId and NumThreads methods to Eigen threadpools and TensorDeviceThreadPool.

This commit is contained in:
Rasmus Munk Larsen
2016-06-03 16:28:58 -07:00
parent 8d97ba6b22
commit 76308e7fd2
5 changed files with 65 additions and 9 deletions

View File

@@ -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