| @@ -652,7 +652,7 @@ Status AicpuTfNodeTask::LaunchTask(TaskContext &context) { | |||
| return SUCCESS; | |||
| } | |||
| Status AicpuTfNodeTask::TaskCallback(TaskContext &context) { | |||
| Status AicpuNodeTaskBase::TaskCallback(TaskContext &context) { | |||
| GELOGD("Node[%s] task callback start. is_dynamic=%s, unknown_type=%d.", | |||
| node_name_.c_str(), node_item_->is_dynamic ? "true" : "false", unknown_type_); | |||
| Status callback_ret = SUCCESS; | |||
| @@ -904,14 +904,30 @@ Status AicpuNodeTask::UpdateIoAddr(TaskContext &context) { | |||
| GELOGD("Node[%s] input[%d] = %p, size = %zu", node_name_.c_str(), i, inputData->GetData(), inputData->GetSize()); | |||
| io_addrs.emplace_back(reinterpret_cast<uintptr_t>(inputData->GetData())); | |||
| } | |||
| // known shape or not depend compute | |||
| if (!node_item_->is_dynamic || unknown_type_ != DEPEND_COMPUTE) { | |||
| // unknown type 4 do this in call back. | |||
| GE_CHK_STATUS_RET_NOLOG(context.AllocateOutputs()); | |||
| for (auto j = 0; j < node_item_->num_outputs; ++j) { | |||
| auto outputData = context.GetOutput(j); | |||
| GE_CHECK_NOTNULL(outputData); | |||
| GELOGD("Node[%s] output[%d] addr = %p, size = %zu", | |||
| node_name_.c_str(), j, outputData->GetData(), outputData->GetSize()); | |||
| io_addrs.emplace_back(reinterpret_cast<uintptr_t>(outputData->GetData())); | |||
| } | |||
| } else { | |||
| // unknown type 4 use result summary update ioaddr. | |||
| GELOGD("Node[%s] is depend compute node, use result summary as out addr.", node_name_.c_str()); | |||
| GE_CHK_BOOL_RET_STATUS(output_summary_.size() == static_cast<std::size_t>(node_item_->num_outputs), | |||
| INTERNAL_ERROR, | |||
| "[Check][Size]Node[%s] has %d output but %zu output summary not equal.", | |||
| node_name_.c_str(), node_item_->num_outputs, output_summary_.size()); | |||
| GE_CHK_STATUS_RET_NOLOG(context.AllocateOutputs()); | |||
| for (auto j = 0; j < node_item_->num_outputs; ++j) { | |||
| auto outputData = context.GetOutput(j); | |||
| GE_CHECK_NOTNULL(outputData); | |||
| GELOGD("Node[%s] output[%d] addr = %p, size = %zu", node_name_.c_str(), j, | |||
| outputData->GetData(), outputData->GetSize()); | |||
| io_addrs.emplace_back(reinterpret_cast<uintptr_t>(outputData->GetData())); | |||
| for (auto j = 0; j < node_item_->num_outputs; ++j) { | |||
| void *summary_addr = output_summary_[j]->GetData(); | |||
| io_addrs.emplace_back(reinterpret_cast<uintptr_t>(summary_addr)); | |||
| } | |||
| } | |||
| auto io_addr = args_.get() + sizeof(aicpu::AicpuParamHead); | |||
| @@ -949,23 +965,6 @@ Status AicpuNodeTask::LaunchTask(TaskContext &context) { | |||
| return SUCCESS; | |||
| } | |||
| Status AicpuNodeTask::TaskCallback(TaskContext &context) { | |||
| GELOGD("Node[%s] task callback start, is_dynamic = %s, unknown_type=%d.", | |||
| node_name_.c_str(), node_item_->is_dynamic ? "true" : "false", unknown_type_); | |||
| Status callback_ret = SUCCESS; | |||
| // check need update shape, call update shape. | |||
| if (node_item_->is_dynamic && unknown_type_ == DEPEND_SHAPE_RANGE) { | |||
| // check result | |||
| callback_ret = UpdateOutputShapeFromExtInfo(context); | |||
| } else { | |||
| GELOGD("Node[%s] unknown shape type is %d no need update output shape.", | |||
| node_name_.c_str(), unknown_type_); | |||
| } | |||
| GELOGD("Node[%s] task callback end.", node_name_.c_str()); | |||
| return callback_ret; | |||
| } | |||
| Status AiCpuNodeExecutor::PrepareTask(NodeTask &task, TaskContext &context) const { | |||
| // malloc HBM memory at Init, here just update them | |||
| RECORD_EXECUTION_EVENT(context.GetExecutionContext(), context.GetNodeName(), "[AiCpuNodeExecutorPrepareTask] Start"); | |||