!11176 Opt get_func by uniforming format

From: @liangzelang
Reviewed-by: @limingqi107,@kisnwang
Signed-off-by: @kisnwang
This commit is contained in:
mindspore-ci-bot 2021-01-12 16:36:10 +08:00 committed by Gitee
commit bc276774e3
2 changed files with 3 additions and 2 deletions

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_; }

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);
}