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

Method Instance

platforms/cuda/hal/src/level2/instrument.cpp:46–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46std::shared_ptr<InstrumentContext> InstrumentContext::Instance(CUcontext ctx)
47{
48 static std::mutex ctx_mtx;
49 static std::map<CUcontext, std::shared_ptr<InstrumentContext>> ctx_map;
50
51 std::lock_guard<std::mutex> lock(ctx_mtx);
52 auto it = ctx_map.find(ctx);
53 if (it != ctx_map.end()) return it->second;
54
55 auto instr_ctx = std::make_shared<InstrumentContext>(ctx);
56 ctx_map[ctx] = instr_ctx;
57 return instr_ctx;
58}
59
60CUresult InstrumentContext::Launch(std::shared_ptr<CudaKernelCommand> kernel,
61 CUstream stream, LaunchType type)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected