Browse Source

!1369 Fix bug of rtMemcpy input 0.

From: @zhao_zhixuan
Reviewed-by: @xchu42,@ji_chen
Signed-off-by: @ji_chen
tags/v1.3.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
b7dd89761a
1 changed files with 13 additions and 12 deletions
  1. +13
    -12
      ge/hybrid/executor/hybrid_model_async_executor.cc

+ 13
- 12
ge/hybrid/executor/hybrid_model_async_executor.cc View File

@@ -297,19 +297,20 @@ Status HybridModelAsyncExecutor::PrepareInputs(const InputData &current_data, Hy
data_buf.length,
mem_size);

GELOGI("[IMAS]CopyPlainData memcpy graph_%u type[F] output[%zu] memaddr[%p] mem_size[%zu] datasize[%lu]",
model_->root_runtime_param_.graph_id,
input_index,
args.inputs[input_index].GetData(),
mem_size,
data_buf.length);
GE_CHK_RT_RET(rtMemcpy(args.inputs[input_index].MutableData(),
mem_size,
data_buf.data,
data_buf.length,
RT_MEMCPY_HOST_TO_DEVICE));
if (data_buf.length > 0) {
GELOGI("[IMAS]CopyPlainData memcpy graph_%u type[F] output[%zu] memaddr[%p] mem_size[%zu] datasize[%lu]",
model_->root_runtime_param_.graph_id,
input_index,
args.inputs[input_index].GetData(),
mem_size,
data_buf.length);
GE_CHK_RT_RET(rtMemcpy(args.inputs[input_index].MutableData(),
mem_size,
data_buf.data,
data_buf.length,
RT_MEMCPY_HOST_TO_DEVICE));
}
}

return SUCCESS;
}



Loading…
Cancel
Save