pytorch/c10/core/impl/GPUTrace.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
402 B
C++
Raw Normal View History

#include <c10/core/impl/GPUTrace.h>
namespace c10::impl {
std::atomic<const PyInterpreter*> GPUTrace::gpuTraceState{nullptr};
bool GPUTrace::haveState{false};
void GPUTrace::set_trace(const PyInterpreter* trace) {
static bool once_flag [[maybe_unused]] = [&]() {
gpuTraceState.store(trace, std::memory_order_release);
haveState = true;
return true;
}();
}
} // namespace c10::impl