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

Method AsyncLaunchKernel

oneflow/core/lazy/actor/actor.cpp:570–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570void Actor::AsyncLaunchKernel(std::function<Regst*(int64_t)> Regst4RegstDescId) {
571 for (const ExecKernel& ek : exec_kernel_vec_) {
572 CHECK_NOTNULL(dynamic_cast<KernelContextImpl*>(ek.kernel_ctx.get()))
573 ->UpdateBnInOp2BlobFn([&](const std::string& bn_in_op) -> Blob* {
574 const auto blob_info_it = ek.bn_in_op2blob_info.find(bn_in_op);
575 if (blob_info_it == ek.bn_in_op2blob_info.cend()) { return nullptr; }
576 const BlobInfo& info = blob_info_it->second;
577 if (info.regst_desc_id == -1) { return nullptr; }
578 Regst* regst = nullptr;
579 if (info.rs != nullptr) {
580 regst = info.rs->Front(info.regst_desc_id);
581 } else {
582 regst = Regst4RegstDescId(info.regst_desc_id);
583 }
584 if (regst == nullptr) { return nullptr; }
585 if (info.ordinal >= 0) {
586 return regst->GetBlobByOrdinal(info.ordinal);
587 } else {
588 return regst->GetBlobByLbi(info.lbi);
589 }
590 });
591 ek.kernel->Launch(ek.kernel_ctx.get());
592 }
593}
594
595void Actor::AsyncLaunchKernel() {
596 AsyncLaunchKernel([](int64_t) -> Regst* {

Callers

nothing calls this directly

Calls 8

UpdateBnInOp2BlobFnMethod · 0.80
findMethod · 0.80
cendMethod · 0.80
FrontMethod · 0.80
GetBlobByOrdinalMethod · 0.80
GetBlobByLbiMethod · 0.80
getMethod · 0.45
LaunchMethod · 0.45

Tested by

no test coverage detected