!39906 Fix using void issue

Merge pull request !39906 from ZPaC/rpc-performance
This commit is contained in:
i-robot 2022-08-07 12:57:41 +00:00 committed by Gitee
commit 63a598dea6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 9 additions and 2 deletions

View File

@ -50,8 +50,7 @@ class RpcRecvKernelMod : public RpcKernelMod {
}
for (size_t i = 0; i < inputs.size(); i++) {
MS_EXCEPTION_IF_NULL(inputs[i]->addr);
int ret = memcpy_s(inputs[i]->addr, inputs[i]->size, remote_input_->Body().data() + real_data_offset_[i],
inputs[i]->size);
int ret = memcpy_s(inputs[i]->addr, inputs[i]->size, data_ptr + real_data_offset_[i], inputs[i]->size);
if (ret != 0) {
MS_LOG(EXCEPTION) << "memcpy_s for recv output " << i << " failed, ret code: " << ret;
}

View File

@ -225,6 +225,14 @@ void SendActor::SerializeDynamicShapeMessage(MessageBase *message, const kernel:
offset += serialized_data_size;
}
}
if (!common::GetEnv("use_void").empty()) {
if (workspace_addr->size != offset) {
MS_LOG(EXCEPTION) << "Send void data size is not the same as workspace size.";
}
message->data = workspace_addr->addr;
message->size = workspace_addr->size;
}
}
void SendActor::SerializeCommonMessage(MessageBase *message, const kernel::AddressPtrList &data_list,