| @@ -325,7 +325,7 @@ rtError_t rtSetTaskFailCallback(rtTaskFailCallback callback) | |||||
| } | } | ||||
| rtError_t rtMallocHostSharedMemory(rtMallocHostSharedMemoryIn *in, | rtError_t rtMallocHostSharedMemory(rtMallocHostSharedMemoryIn *in, | ||||
| rtMallocHostSharedMemoryOut *out) | |||||
| rtMallocHostSharedMemoryOut *out) | |||||
| { | { | ||||
| out->ptr = new uint8_t[in->size]; | out->ptr = new uint8_t[in->size]; | ||||
| out->devPtr = new uint8_t[in->size]; | out->devPtr = new uint8_t[in->size]; | ||||
| @@ -194,7 +194,7 @@ class UtestLogicalStreamAllocator : public testing::Test { | |||||
| SchedulerConf scheduler_conf; | SchedulerConf scheduler_conf; | ||||
| if (confs.empty()) { | if (confs.empty()) { | ||||
| for (const auto &subgraph_pair : subgraph_map) { | for (const auto &subgraph_pair : subgraph_map) { | ||||
| for (const auto &sub_graph : subgraph_pair.second) { | |||||
| for (const auto &sub_graph : subgraph_pair.second) { | |||||
| EngineConfPtr conf = make_shared<EngineConf>(); | EngineConfPtr conf = make_shared<EngineConf>(); | ||||
| conf->id = sub_graph->GetEngineName(); | conf->id = sub_graph->GetEngineName(); | ||||
| if (conf->id == "ge_local") { | if (conf->id == "ge_local") { | ||||
| @@ -202,7 +202,7 @@ class UtestLogicalStreamAllocator : public testing::Test { | |||||
| conf->attach = true; | conf->attach = true; | ||||
| } | } | ||||
| scheduler_conf.cal_engines[conf->id] = conf; | scheduler_conf.cal_engines[conf->id] = conf; | ||||
| } | |||||
| } | |||||
| } | } | ||||
| } else { | } else { | ||||
| for (auto &conf : confs) { | for (auto &conf : confs) { | ||||
| @@ -223,17 +223,17 @@ class UtestLogicalStreamAllocator : public testing::Test { | |||||
| } | } | ||||
| Status AssignLogicalStreams(vector<SubGraphInfoPtr> subgraphs, | Status AssignLogicalStreams(vector<SubGraphInfoPtr> subgraphs, | ||||
| vector<EngineConfPtr> &confs, | |||||
| std::map<std::string, int> &max_parallel_num, | |||||
| ComputeGraphPtr &whole_graph) { | |||||
| vector<EngineConfPtr> &confs, | |||||
| std::map<std::string, int> &max_parallel_num, | |||||
| ComputeGraphPtr &whole_graph) { | |||||
| Graph2SubGraphInfoList subgraph_map; | Graph2SubGraphInfoList subgraph_map; | ||||
| subgraph_map[whole_graph] = subgraphs; | subgraph_map[whole_graph] = subgraphs; | ||||
| return AssignLogicalStreams(subgraph_map, confs, max_parallel_num, whole_graph); | return AssignLogicalStreams(subgraph_map, confs, max_parallel_num, whole_graph); | ||||
| } | } | ||||
| Status AssignLogicalStreams(vector<SubGraphInfoPtr> subgraphs, | Status AssignLogicalStreams(vector<SubGraphInfoPtr> subgraphs, | ||||
| vector<EngineConfPtr>& confs, | |||||
| std::map<std::string, int> &max_parallel_num) { | |||||
| vector<EngineConfPtr>& confs, | |||||
| std::map<std::string, int> &max_parallel_num) { | |||||
| ComputeGraphPtr whole_graph = make_shared<ComputeGraph>("whole_graph"); | ComputeGraphPtr whole_graph = make_shared<ComputeGraph>("whole_graph"); | ||||
| return AssignLogicalStreams(subgraphs, confs, max_parallel_num, whole_graph); | return AssignLogicalStreams(subgraphs, confs, max_parallel_num, whole_graph); | ||||
| } | } | ||||
| @@ -154,13 +154,13 @@ class OmeTestOpUtils { | |||||
| if (model->HasAttr(MODEL_ATTR_TASKS)) { | if (model->HasAttr(MODEL_ATTR_TASKS)) { | ||||
| ge::Buffer task_buffer; | ge::Buffer task_buffer; | ||||
| GE_CHK_BOOL_RET_STATUS(ge::AttrUtils::GetZeroCopyBytes(model, MODEL_ATTR_TASKS, task_buffer), FAILED, | GE_CHK_BOOL_RET_STATUS(ge::AttrUtils::GetZeroCopyBytes(model, MODEL_ATTR_TASKS, task_buffer), FAILED, | ||||
| "Get bytes failed."); | |||||
| "Get bytes failed."); | |||||
| std::shared_ptr<ModelTaskDef> task = ge::MakeShared<ModelTaskDef>(); | std::shared_ptr<ModelTaskDef> task = ge::MakeShared<ModelTaskDef>(); | ||||
| GE_CHECK_NOTNULL(task); | GE_CHECK_NOTNULL(task); | ||||
| GE_IF_BOOL_EXEC(task_buffer.GetData() == nullptr, GELOGE(FAILED, "Get data fail"); return FAILED); | GE_IF_BOOL_EXEC(task_buffer.GetData() == nullptr, GELOGE(FAILED, "Get data fail"); return FAILED); | ||||
| GE_IF_BOOL_EXEC(task_buffer.GetSize() == 0, GELOGE(FAILED, "Get size fail"); return FAILED); | GE_IF_BOOL_EXEC(task_buffer.GetSize() == 0, GELOGE(FAILED, "Get size fail"); return FAILED); | ||||
| GE_CHK_BOOL_EXEC(ReadProtoFromArray(task_buffer.GetData(), static_cast<int>(task_buffer.GetSize()), task.get()), | GE_CHK_BOOL_EXEC(ReadProtoFromArray(task_buffer.GetData(), static_cast<int>(task_buffer.GetSize()), task.get()), | ||||
| return INTERNAL_ERROR, "ReadProtoFromArray failed."); | |||||
| return INTERNAL_ERROR, "ReadProtoFromArray failed."); | |||||
| ge_model->SetModelTaskDef(task); | ge_model->SetModelTaskDef(task); | ||||
| } | } | ||||
| @@ -168,11 +168,11 @@ class OmeTestOpUtils { | |||||
| if (compute_graph != nullptr && compute_graph->GetDirectNodesSize() != 0) { | if (compute_graph != nullptr && compute_graph->GetDirectNodesSize() != 0) { | ||||
| for (const ge::NodePtr &n : compute_graph->GetDirectNode()) { | for (const ge::NodePtr &n : compute_graph->GetDirectNode()) { | ||||
| auto node_op_desc = n->GetOpDesc(); | auto node_op_desc = n->GetOpDesc(); | ||||
| GE_IF_BOOL_EXEC(node_op_desc == nullptr, continue); | |||||
| TBEKernelPtr tbe_kernel = node_op_desc->TryGetExtAttr(ge::OP_EXTATTR_NAME_TBE_KERNEL, TBEKernelPtr()); | |||||
| GE_IF_BOOL_EXEC(tbe_kernel == nullptr, continue); | |||||
| kernel_store.AddTBEKernel(tbe_kernel); | |||||
| GELOGI("Add tbe kernel bin %s", tbe_kernel->GetName().c_str()); | |||||
| GE_IF_BOOL_EXEC(node_op_desc == nullptr, continue); | |||||
| TBEKernelPtr tbe_kernel = node_op_desc->TryGetExtAttr(ge::OP_EXTATTR_NAME_TBE_KERNEL, TBEKernelPtr()); | |||||
| GE_IF_BOOL_EXEC(tbe_kernel == nullptr, continue); | |||||
| kernel_store.AddTBEKernel(tbe_kernel); | |||||
| GELOGI("Add tbe kernel bin %s", tbe_kernel->GetName().c_str()); | |||||
| } | } | ||||
| } | } | ||||
| if (!kernel_store.Build()) { | if (!kernel_store.Build()) { | ||||