Browse Source

!10589 adapt return code of memory allocation fail when device is occupied

From: @laiyongqiang
Reviewed-by: @kisnwang,@zhoufeng54
Signed-off-by: @zhoufeng54
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
6dd5d2effd
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc

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

@@ -31,7 +31,7 @@ void AscendMemoryManager::MallocDeviceMemory() {
device_mem_size_ = context_mem == 0 ? kAscendDeviceMemSize : context_mem;
auto ret = rtMalloc(reinterpret_cast<void **>(&device_mem_base_), device_mem_size_, RT_MEMORY_HBM);
if (ret != ACL_RT_SUCCESS) {
if (ret == ACL_ERROR_RT_DRV_INTERNAL_ERROR) {
if (ret == ACL_ERROR_RT_MEMORY_ALLOCATION) {
auto context_ptr = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context_ptr);
unsigned int device_id = context_ptr->get_param<uint32_t>(MS_CTX_DEVICE_ID);


Loading…
Cancel
Save