aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
diff options
context:
space:
mode:
authorGravatar Penporn Koanantakool <penporn@google.com>2018-06-02 12:07:49 -0700
committerGravatar Penporn Koanantakool <penporn@google.com>2018-06-02 12:07:49 -0700
commite2ed0cf8abfe275bd147f3228e4c59f5242993f6 (patch)
treefb2f0bae997d454420044482ace4bb207245bc38 /unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
parent84868da904ac8d07342983b9bb78cf3360142363 (diff)
Add a ThreadPoolInterface* getter for ThreadPoolDevice.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
index ec6802e85..ca9ba402e 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h
@@ -169,7 +169,7 @@ struct ThreadPoolDevice {
// 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
+ // Block size is chosen based on the iteration cost and resulting parallel
// efficiency. If block_align is not nullptr, it is called to round up the
// block size.
void parallelFor(Index n, const TensorOpCost& cost,
@@ -261,6 +261,9 @@ struct ThreadPoolDevice {
parallelFor(n, cost, nullptr, std::move(f));
}
+ // Thread pool accessor.
+ ThreadPoolInterface* getPool() const { return pool_; }
+
private:
ThreadPoolInterface* pool_;
int num_threads_;