PTThreadPool.h 391 B

1234567891011121314151617
  1. #pragma once
  2. #include <ATen/Parallel.h>
  3. #include <c10/core/thread_pool.h>
  4. namespace at {
  5. class TORCH_API PTThreadPool : public c10::ThreadPool {
  6. public:
  7. explicit PTThreadPool(int pool_size, int numa_node_id = -1)
  8. : c10::ThreadPool(pool_size, numa_node_id, []() {
  9. c10::setThreadName("PTThreadPool");
  10. at::init_num_threads();
  11. }) {}
  12. };
  13. } // namespace at