Browse Source

use host_type vs deprecated type_id

pull/15732/head
John Tzanakakis 4 years ago
parent
commit
89c78069ce
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc
  2. +1
    -1
      mindspore/ccsrc/runtime/device/gpu/gpu_device_address.cc

+ 1
- 1
mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc View File

@@ -706,7 +706,7 @@ bool AscendDeviceAddress::LoadMemToHost(const std::string &tensor_name, int exec
tensor_data->SetName(tensor_name);
tensor_data->SetExecutionOrder(execution_order);
tensor_data->SetSlot(slot);
mindspore::tensor::TensorPtr out_tensor = std::make_shared<tensor::Tensor>(type_id_, host_shape);
mindspore::tensor::TensorPtr out_tensor = std::make_shared<tensor::Tensor>(host_type, host_shape);
size_t host_size = out_tensor->data().nbytes();
auto ret_rt_memcpy = rtMemcpy(out_tensor->data_c(), host_size, ptr_, host_size, RT_MEMCPY_DEVICE_TO_HOST);
if (ret_rt_memcpy != RT_ERROR_NONE) {


+ 1
- 1
mindspore/ccsrc/runtime/device/gpu/gpu_device_address.cc View File

@@ -107,7 +107,7 @@ bool GPUDeviceAddress::LoadMemToHost(const std::string &tensor_name, int executi
return true;
}

mindspore::tensor::TensorPtr out_tensor = std::make_shared<tensor::Tensor>(type_id_, host_shape);
mindspore::tensor::TensorPtr out_tensor = std::make_shared<tensor::Tensor>(host_type, host_shape);
size_t host_size = out_tensor->data().nbytes();
auto ret_rt_memcpy = SyncDeviceToHost(host_shape, host_size, host_type, out_tensor->data_c());
if (!ret_rt_memcpy) {


Loading…
Cancel
Save