MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / GetDefaultSessionId

Function GetDefaultSessionId

oneflow/core/framework/session_util.cpp:40–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38} // namespace
39
40Maybe<int64_t> GetDefaultSessionId() {
41 std::unique_lock<std::mutex> lock(*GlobalSessionUtilMutex());
42 const auto& regsitered_ids = *(RegsiteredSessionIds());
43 CHECK_GT_OR_RETURN(regsitered_ids.size(), 0);
44 return regsitered_ids.back();
45}
46
47bool RegsterSessionId(int64_t session_id) {
48 std::unique_lock<std::mutex> lock(*GlobalSessionUtilMutex());

Callers 4

MakeScopeFunction · 0.85
MakeInitialScopeFunction · 0.85
session_util.cppFile · 0.85
~OneFlowEnvMethod · 0.85

Calls 3

GlobalSessionUtilMutexFunction · 0.85
RegsiteredSessionIdsFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected