MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / wait

Method wait

imperative/src/impl/transformations/trace.cpp:859–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859void CompiledTransformation::wait() {
860 try {
861 trace_assert(m_pc == m_seq.size(), "mismature end");
862 } catch (...) {
863 }
864 if (!m_imperative) {
865 wait_worker();
866 }
867 for (auto&& box : m_boxes) {
868 box->reset();
869 }
870 m_pc = 0;
871 std::exception_ptr graph_exc;
872 std::swap(m_graph_exc, graph_exc);
873 m_setted_extern.clear();
874 if (graph_exc) {
875 // graph with exception cannot be reused
876 recompile();
877 std::rethrow_exception(graph_exc);
878 }
879}
880
881void CompiledTransformation::wait_worker() {
882 mgb_assert(m_executable != nullptr);

Callers 7

runMethod · 0.45
wait_tensorMethod · 0.45
wait_workerMethod · 0.45
on_unregisterMethod · 0.45
start_workerMethod · 0.45

Calls 4

swapFunction · 0.85
sizeMethod · 0.45
resetMethod · 0.45
clearMethod · 0.45

Tested by 1

runMethod · 0.36