From 4bb13008b4348eda4e86f342b917869dbf49170b Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 25 Aug 2023 01:04:34 +0000 Subject: [PATCH] Add recommended granule query Change-Id: I7eb10e267d0272759321ee30feddf2d6464d9443 [ROCm/rocminfo commit: f1f463d818490ac1ec13b8b14a231951ee30cd43] --- projects/rocminfo/rocminfo.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/rocminfo/rocminfo.cc b/projects/rocminfo/rocminfo.cc index 1d6cfbfcfb..f3c8e89d64 100755 --- a/projects/rocminfo/rocminfo.cc +++ b/projects/rocminfo/rocminfo.cc @@ -151,6 +151,7 @@ typedef struct { size_t pool_size; bool alloc_allowed; size_t alloc_granule; + size_t alloc_rec_granule; size_t pool_alloc_alignment; bool pl_access; uint32_t global_flag; @@ -705,6 +706,11 @@ static hsa_status_t AcquirePoolInfo(hsa_amd_memory_pool_t pool, &pool_i->alloc_granule); RET_IF_HSA_ERR(err); + err = hsa_amd_memory_pool_get_info(pool, + HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE, + &pool_i->alloc_rec_granule); + RET_IF_HSA_ERR(err); + err = hsa_amd_memory_pool_get_info(pool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALIGNMENT, &pool_i->pool_alloc_alignment); @@ -790,6 +796,9 @@ static void DisplayPoolInfo(pool_info_t *pool_i, uint32_t indent) { std::string gr_str = std::to_string(pool_i->alloc_granule/1024)+"KB"; printLabelStr("Alloc Granule:", gr_str.c_str(), indent); + std::string rgr_str = std::to_string(pool_i->alloc_rec_granule / 1024) + "KB"; + printLabelStr("Alloc Recommended Granule:", rgr_str.c_str(), indent); + std::string al_str = std::to_string(pool_i->pool_alloc_alignment/1024)+"KB"; printLabelStr("Alloc Alignment:", al_str.c_str(), indent);