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

Function GetHostInputLbis4OpNode

oneflow/core/graph/task_graph.cpp:485–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485void GetHostInputLbis4OpNode(const OpNode* op_node,
486 std::vector<LogicalBlobId>* host_mem_input_lbis) {
487 host_mem_input_lbis->clear();
488 if (op_node->op().op_conf().has_user_conf()) {
489 const auto& user_conf = op_node->op().op_conf().user_conf();
490 const auto& op_type_name = user_conf.op_type_name();
491 if (user_op::UserOpHostMemoryInputRegistry::Get().HasHostMemoryInput(op_type_name)) {
492 const auto& inputs = [&]() -> std::vector<std::pair<std::string, int32_t>> {
493 const auto& arg_map = op_node->op().op_conf().user_conf().input();
494 std::vector<std::pair<std::string, int32_t>> arg_vec;
495 for (auto it = arg_map.begin(); it != arg_map.end(); ++it) {
496 for (int32_t i = 0; i < it->second.s_size(); ++i) {
497 arg_vec.emplace_back(std::make_pair(it->first, i));
498 }
499 }
500 return arg_vec;
501 }();
502 for (const auto& pair : inputs) {
503 if (user_op::UserOpHostMemoryInputRegistry::Get().IsHostMemoryInput4Op(
504 op_type_name, pair.first, pair.second)) {
505 const LogicalBlobId& host_input_lbi =
506 GenLogicalBlobId(user_conf.input().at(pair.first).s(pair.second));
507 host_mem_input_lbis->emplace_back(host_input_lbi);
508 }
509 }
510 }
511 }
512}
513
514HashMap<DeviceType, CreateSubTskGphBuilderFn>* GlobalDeviceType2CreateSubTskGphBuilderFn() {
515 static HashMap<DeviceType, CreateSubTskGphBuilderFn>

Callers 1

Calls 10

GetFunction · 0.85
GenLogicalBlobIdFunction · 0.85
HasHostMemoryInputMethod · 0.80
IsHostMemoryInput4OpMethod · 0.80
clearMethod · 0.45
opMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emplace_backMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected