MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / init_backtrace_tss_key

Function init_backtrace_tss_key

imperative/python/src/backtrace.cpp:78–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76static bool support_tss = false;
77
78void init_backtrace_tss_key() {
79#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 6
80 int result = PyThread_tss_create(&tss_key);
81 support_tss = result == 0;
82#else
83 tss_key = PyThread_create_key();
84 support_tss = tss_key != -1;
85#endif
86}
87
88FrameInfoCache* FrameInfoCache::get_instance() {
89 mgb_assert(support_tss);

Callers 1

init_tensorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected