1 #ifndef CAFFE2_UTILS_THREADPOOL_H_ 2 #define CAFFE2_UTILS_THREADPOOL_H_ 4 #include "ThreadPoolCommon.h" 20 constexpr
size_t kCacheLineSize = 64;
30 static std::unique_ptr<ThreadPool> defaultThreadPool();
34 int getNumThreads()
const;
39 void setMinWorkSize(
size_t size);
40 size_t getMinWorkSize()
const {
return minWorkSize_; }
41 void run(
const std::function<
void(
int,
size_t)>& fn,
size_t range);
45 void withPool(
const std::function<
void(
WorkersPool*)>& fn);
48 mutable std::mutex executionMutex_;
51 std::shared_ptr<WorkersPool> workersPool_;
52 std::vector<std::shared_ptr<Task>> tasks_;
57 #endif // CAFFE2_UTILS_THREADPOOL_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...