MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / WarnIfInCallback

Function WarnIfInCallback

tensorflow/core/common_runtime/gpu/gpu_event_mgr.cc:46–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44thread_local const char* ThreadLabel::value_ = "";
45
46void WarnIfInCallback(std::function<void()> f) {
47 const char* label = ThreadLabel::GetValue();
48 if (label && !strcmp(label, "gpu_event_mgr")) {
49 if (f) {
50 f();
51 } else {
52 LOG(WARNING) << "Executing inside EventMgr callback thread: "
53 << CurrentStackTrace();
54 }
55 }
56}
57
58void InitThreadpoolLabels(thread::ThreadPool* threadpool) {
59 static const char* label = "gpu_event_mgr";

Callers 1

TESTFunction · 0.85

Calls 3

CurrentStackTraceFunction · 0.85
GetValueFunction · 0.50
fFunction · 0.50

Tested by 1

TESTFunction · 0.68