Browse Source

opt get_func by uniforming format

tags/v1.2.0-rc1
liangzelang 5 years ago
parent
commit
a97ac180ba
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      mindspore/ccsrc/backend/optimizer/mem_reuse/mem_dynamic_allocator.h
  2. +1
    -1
      mindspore/ccsrc/runtime/device/ascend/ascend_memory_pool.cc

+ 2
- 1
mindspore/ccsrc/backend/optimizer/mem_reuse/mem_dynamic_allocator.h View File

@@ -87,7 +87,8 @@ class DynamicMemPoolBestFit {
void ReleaseDeviceRes();
// Display the information of memory block and memory buf.
void DumpDynamicMemPoolInfo();
SizeMapMemBuf GetIdleMemBufMap() { return global_idle_mem_buf_map_; }
// Get the map of global idle mem buf and size.
SizeMapMemBuf global_idle_mem_buf_map() const { return global_idle_mem_buf_map_; }
// Get the related memory statistics information.
size_t total_mem_statistics() const { return total_mem_statistics_; }


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

@@ -63,7 +63,7 @@ bool AscendMemoryPool::FreeDeviceMem(const DeviceMemPtr &addr) {
}

void AscendMemoryPool::ResetIdleMemBuf() {
auto idle_mem_buf_map = DynamicMemPoolBestFit::GetIdleMemBufMap();
auto idle_mem_buf_map = DynamicMemPoolBestFit::global_idle_mem_buf_map();
for (auto &it : idle_mem_buf_map) {
rtMemset(it.second->device_addr_, it.first, 0, it.first);
}


Loading…
Cancel
Save