MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / SingleThreadScheduleCtx

Class SingleThreadScheduleCtx

oneflow/core/vm/virtual_machine.cpp:155–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153namespace {
154
155class SingleThreadScheduleCtx : public vm::ScheduleCtx {
156 public:
157 SingleThreadScheduleCtx() = default;
158 ~SingleThreadScheduleCtx() = default;
159
160 void OnWorkerLoadPending(vm::ThreadCtx* thread_ctx) const override {
161 while (thread_ctx->TryReceiveAndRun() > 0) {}
162 }
163};
164
165void ScheduleUntilVMEmpty(vm::VirtualMachineEngine* vm, const vm::ScheduleCtx& schedule_ctx) {
166 do { vm->Schedule(schedule_ctx); } while (!(vm->SchedulerEmpty()));

Callers 3

BlockingRunProbeFuncMethod · 0.85
NotifyOrRunSchedulerMethod · 0.85
RunInCurrentThreadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected