MCPcopy Create free account
hub / github.com/Niko1221/Strata / end

Method end

engine/src/core/graph.cpp:54–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54bool CapturedGraph::end(void* stream, std::string& err) {
55 cudaError_t e = cudaStreamEndCapture((cudaStream_t) stream, &graph_);
56 if (e != cudaSuccess) { graph_ = nullptr; return fail(err, "cudaStreamEndCapture", e); }
57
58 nodes_ = 0;
59 e = cudaGraphGetNodes(graph_, nullptr, &nodes_);
60 if (e != cudaSuccess) return fail(err, "cudaGraphGetNodes", e);
61 // A capture that recorded NOTHING is a wiring mistake, and a graph that replays nothing produces no error
62 // and no output - the silent kind of failure this project keeps paying for.
63 if (nodes_ == 0) { err = "end: the capture recorded ZERO nodes - the body launched nothing"; reset(); return false; }
64
65 e = cudaGraphInstantiate(&exec_, graph_, nullptr, nullptr, 0);
66 if (e != cudaSuccess) return fail(err, "cudaGraphInstantiate", e);
67
68 // The completion event is recorded ONCE and reused: `launch` records it again after each replay, which is
69 // what makes `wait_ms` a query rather than a sync.
70 e = cudaEventCreateWithFlags(&done_, cudaEventDisableTiming);
71 if (e != cudaSuccess) return fail(err, "cudaEventCreateWithFlags", e);
72 return true;
73}
74
75bool CapturedGraph::launch(void* stream, std::string& err) const {
76 if (!exec_) { err = "launch: not recorded"; return false; }

Callers 15

find_tensorMethod · 0.45
open_intoMethod · 0.45
try_pin_residentMethod · 0.45
demand_beginMethod · 0.45
prefetch_hintMethod · 0.45
insert_from_copybackMethod · 0.45
bind_prefetch_slotMethod · 0.45
findMethod · 0.45
putMethod · 0.45
findMethod · 0.45
vision_probeFunction · 0.45
prepare_pictureFunction · 0.45

Calls 6

cudaGraphGetNodesFunction · 0.85
failFunction · 0.70
cudaStreamEndCaptureFunction · 0.50
resetFunction · 0.50
cudaGraphInstantiateFunction · 0.50
cudaEventCreateWithFlagsFunction · 0.50

Tested by 15

bodyFunction · 0.36
run_typeFunction · 0.36
mainFunction · 0.36
chain_listFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
testsFunction · 0.36
mainFunction · 0.36
fixtureFunction · 0.36
check_historyFunction · 0.36
mainFunction · 0.36
chain_listFunction · 0.36