SWDEV-558080 - Add recommended granularity (#1176)

* Add recommended granularity

* Improve granularity testing

* Update based on feedback
This commit is contained in:
AidanBeltonS
2025-11-26 16:10:58 +00:00
committed by GitHub
parent 422253f871
commit d849b88aef
7 changed files with 38 additions and 55 deletions
+10 -1
View File
@@ -792,13 +792,22 @@ hsa_status_t Device::iterateGpuMemoryPoolCallback(hsa_amd_memory_pool_t pool, vo
// Query the recommended granularity for this pool.
stat = Hsa::memory_pool_get_info(pool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_GRANULE,
&(dev->info_.virtualMemAllocGranularity_));
&(dev->info_.virtualMemAllocGranularityMinimum_));
if (stat != HSA_STATUS_SUCCESS) {
LogPrintfError(
"Cannot query HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_GRANULE info"
"failed with hsa_status: %d \n",
stat);
}
// Query the recommended granularity for this pool.
stat = Hsa::memory_pool_get_info(pool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE,
&(dev->info_.virtualMemAllocGranularityRecommended_));
if (stat != HSA_STATUS_SUCCESS) {
LogPrintfError(
"Cannot query HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE info"
"failed with hsa_status: %d \n",
stat);
}
}
if (dev->gpuvm_segment_.handle == 0) {