mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
It is time to enable nested namespaces in the code. Pull Request resolved: https://github.com/pytorch/pytorch/pull/118506 Approved by: https://github.com/albanD
19 lines
425 B
C++
19 lines
425 B
C++
#include <c10/core/impl/GPUTrace.h>
|
|
#include <c10/util/CallOnce.h>
|
|
|
|
namespace c10::impl {
|
|
|
|
std::atomic<const PyInterpreter*> GPUTrace::gpuTraceState{nullptr};
|
|
|
|
bool GPUTrace::haveState{false};
|
|
|
|
void GPUTrace::set_trace(const PyInterpreter* trace) {
|
|
static c10::once_flag flag;
|
|
c10::call_once(flag, [&]() {
|
|
gpuTraceState.store(trace, std::memory_order_release);
|
|
haveState = true;
|
|
});
|
|
}
|
|
|
|
} // namespace c10::impl
|