mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/145672 Approved by: https://github.com/albanD
18 lines
402 B
C++
18 lines
402 B
C++
#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
|