mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Follows #151070. Pull Request resolved: https://github.com/pytorch/pytorch/pull/151297 Approved by: https://github.com/Skylion007
16 lines
337 B
C++
16 lines
337 B
C++
#include <caffe2/utils/threadpool/thread_pool_guard.h>
|
|
|
|
namespace caffe2 {
|
|
|
|
static thread_local bool _NoPThreadPoolGuard_enabled = false;
|
|
|
|
bool _NoPThreadPoolGuard::is_enabled() {
|
|
return _NoPThreadPoolGuard_enabled;
|
|
}
|
|
|
|
void _NoPThreadPoolGuard::set_enabled(bool enabled) {
|
|
_NoPThreadPoolGuard_enabled = enabled;
|
|
}
|
|
|
|
} // namespace at
|