diff options
author | James Reed <jamesreed@fb.com> | 2019-02-05 00:03:53 -0800 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-02-05 00:15:56 -0800 |
commit | ce15ae8f23180c703929969b07bf5d04437e65e7 (patch) | |
tree | fe5769d4ed364a4ebc1bc6c1f2c8b43dc1897979 /caffe2/utils | |
parent | 3796cbaf7ab4c4c30cb99191d55a8b9c50b398dc (diff) | |
download | pytorch-ce15ae8f23180c703929969b07bf5d04437e65e7.tar.gz pytorch-ce15ae8f23180c703929969b07bf5d04437e65e7.tar.bz2 pytorch-ce15ae8f23180c703929969b07bf5d04437e65e7.zip |
Add an API to set the number of threads in C10 thread pool (#16669)
Summary:
Tested locally on machine translation service
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16669
Differential Revision: D13927858
Pulled By: jamesr66a
fbshipit-source-id: efcb8c21e0c2f76ac37967e6f52967da515595c3
Diffstat (limited to 'caffe2/utils')
-rw-r--r-- | caffe2/utils/thread_pool.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/caffe2/utils/thread_pool.h b/caffe2/utils/thread_pool.h index cd8ba2c49a..7047dc3d43 100644 --- a/caffe2/utils/thread_pool.h +++ b/caffe2/utils/thread_pool.h @@ -9,7 +9,9 @@ namespace caffe2 { class CAFFE2_API TaskThreadPool : public c10::ThreadPool { public: - explicit TaskThreadPool(std::size_t pool_size, int numa_node_id = -1) + explicit TaskThreadPool( + std::size_t pool_size, + int numa_node_id = -1) : ThreadPool(pool_size, numa_node_id) {} // TODO move this to ATen/core/thread_pool.h |