diff --git a/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.cc b/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.cc index 6851b1bc..d22cd85d 100755 --- a/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.cc +++ b/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.cc @@ -47,6 +47,7 @@ Status MemcpyAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da kind_ = RT_MEMCPY_ADDR_DEVICE_TO_DEVICE; GELOGI("MemcpyAsyncTaskInfo op name %s, src_ %p, dst_ %p, args_offset %u.", op_desc->GetName().c_str(), src_, dst_, args_offset_); + SetIoAddrs(op_desc); return SUCCESS; } @@ -77,15 +78,7 @@ Status MemcpyAsyncTaskInfo::Init(const domi::TaskDef &task_def, DavinciModel *da davinci_model_->DisableZeroCopy(src_); davinci_model_->DisableZeroCopy(dst_); - - io_addrs_.emplace_back(reinterpret_cast(src_)); - if (op_desc->HasAttr(ATTR_DYNAMIC_SHAPE_FIXED_ADDR)) { - void *fixed_addr = davinci_model_->GetCurrentFixedAddr(fixed_addr_offset_); - io_addrs_.emplace_back(fixed_addr); - } else { - io_addrs_.emplace_back(reinterpret_cast(dst_)); - } - + SetIoAddrs(op_desc); return SUCCESS; } @@ -123,6 +116,16 @@ Status MemcpyAsyncTaskInfo::CalculateArgs(const domi::TaskDef &task_def, Davinci return SUCCESS; } +void MemcpyAsyncTaskInfo::SetIoAddrs(const OpDescPtr &op_desc) { + io_addrs_.emplace_back(reinterpret_cast(src_)); + if (op_desc->HasAttr(ATTR_DYNAMIC_SHAPE_FIXED_ADDR)) { + void *fixed_addr = davinci_model_->GetCurrentFixedAddr(fixed_addr_offset_); + io_addrs_.emplace_back(fixed_addr); + } else { + io_addrs_.emplace_back(reinterpret_cast(dst_)); + } +} + Status MemcpyAsyncTaskInfo::UpdateArgs() { GELOGI("MemcpyAsyncTaskInfo::UpdateArgs in."); GE_CHECK_NOTNULL(davinci_model_); diff --git a/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.h b/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.h index d7506840..601a4aec 100755 --- a/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.h +++ b/ge/graph/load/new_model_manager/task_info/memcpy_async_task_info.h @@ -38,6 +38,9 @@ class MemcpyAsyncTaskInfo : public TaskInfo { Status CalculateArgs(const domi::TaskDef &task_def, DavinciModel *davinci_model) override; + private: + void SetIoAddrs(const OpDescPtr &op_desc); + private: uint8_t *dst_; uint64_t dst_max_;