Browse Source

!5083 [bugfix]LSTM SyncDeviceToHost failed

Merge pull request !5083 from zyli2020/r0.7
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
e9f2aae73d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mindspore/ccsrc/runtime/device/gpu/gpu_device_address.cc

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

@@ -32,7 +32,7 @@ namespace device {
namespace gpu {
bool GPUDeviceAddress::SyncDeviceToHost(const std::vector<int> &, size_t size, TypeId, void *host_ptr) const {
MS_EXCEPTION_IF_NULL(host_ptr);
bool need_sync = (size != 0) && (size_ != 0);
bool need_sync = (size != 0) && (size_ != 0) && (size <= size_);
if (!need_sync) {
return true;
}
@@ -52,7 +52,7 @@ bool GPUDeviceAddress::SyncDeviceToHost(const std::vector<int> &, size_t size, T

bool GPUDeviceAddress::SyncHostToDevice(const std::vector<int> &, size_t size, TypeId, const void *host_ptr) const {
MS_EXCEPTION_IF_NULL(host_ptr);
bool need_sync = (size != 0) && (size_ != 0);
bool need_sync = (size != 0) && (size_ != 0) && (size <= size_);
if (!need_sync) {
return true;
}


Loading…
Cancel
Save