MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RunAsync

Method RunAsync

tensorflow/core/common_runtime/executor.cc:586–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584
585template <class PropagatorStateType>
586void ExecutorState<PropagatorStateType>::RunAsync(Executor::DoneCallback done) {
587 MaybeCollectKernelStats();
588
589 TaggedNodeSeq ready;
590
591 // Ask the device to fill in the device context map.
592 Device* device = immutable_state_.params().device;
593 const Status get_context_status =
594 device->TryGetDeviceContext(&device_context_);
595 if (!get_context_status.ok()) {
596 delete this;
597 done(get_context_status);
598 return;
599 }
600
601 // Initialize the ready queue.
602 ready.reserve(immutable_state_.root_nodes().size());
603 propagator_.ActivateRoots(immutable_state_.root_nodes(), &ready);
604 num_outstanding_ops_ = ready.size();
605 if (ready.empty()) {
606 delete this;
607 done(Status::OK());
608 } else {
609 done_cb_ = std::move(done);
610 // Schedule to run all the ready ops in thread pool.
611 ScheduleReady(&ready, nullptr);
612 }
613}
614
615// State kept alive for executing an asynchronous node in another
616// thread. NOTE: We need to make a copy of p.input and p.input_alloc_attrs for

Callers 5

RunInternalMethod · 0.45
PRunSetupMethod · 0.45
RunRemoteMethod · 0.45
RunMethod · 0.45

Calls 8

paramsMethod · 0.80
TryGetDeviceContextMethod · 0.45
okMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
ActivateRootsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected