MCPcopy Create free account
hub / github.com/XpuOS/xsched / Instance

Method Instance

platforms/cuda/hal/src/level3/interrupt.cpp:83–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83std::shared_ptr<InterruptContext> InterruptContext::Instance(CUcontext ctx)
84{
85 static std::mutex ctx_mtx;
86 static std::map<CUcontext, std::shared_ptr<InterruptContext>> ctx_map;
87
88 std::lock_guard<std::mutex> lock(ctx_mtx);
89 auto it = ctx_map.find(ctx);
90 if (it != ctx_map.end()) return it->second;
91
92 auto interrupt_ctx = std::make_shared<InterruptContext>(ctx);
93 ctx_map[ctx] = interrupt_ctx;
94 return interrupt_ctx;
95}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected