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

Method rotate

imperative/src/impl/proxy_graph/mini_graph.h:553–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551 size_t tail = 0; // events[tail] is not finished
552
553 void rotate() {
554 while (tail < head && events[tail % bucket_count]->finished()) {
555 ++tail;
556 }
557 auto& ev = events[head % bucket_count];
558 if (head == tail + bucket_count) {
559 // do not wait if head == tail
560 ev->host_wait();
561 ++tail;
562 }
563 ev->record();
564 ++head;
565 free_slots = bucket_size;
566 }
567
568public:
569 CompNodeTracker(CompNode cn) : comp_node(cn) {

Callers

nothing calls this directly

Calls 3

finishedMethod · 0.80
host_waitMethod · 0.80
recordMethod · 0.45

Tested by

no test coverage detected