| 81 | } |
| 82 | |
| 83 | std::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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected