Add query for recommended granularity size
Add new query for recommended granularity size. This is the internal blocksize used. While the existing query for granularity size returns the minimum size possible, it is recommended that allocations and mappings are multiple of the recommended granularity size to minimise internal memory fragmentation. This is part of patch series for Virtual Memory API. Change-Id: Ia82c8f073b2a2c47ecd26fbb0aba27b8b7cd965f
Este cometimento está contido em:
@@ -420,6 +420,21 @@ hsa_status_t MemoryRegion::GetInfo(hsa_region_info_t attribute,
|
||||
case HSA_AMD_REGION_INFO_MAX_CLOCK_FREQUENCY:
|
||||
*((uint32_t*)value) = MaxMemCloc();
|
||||
break;
|
||||
case HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE:
|
||||
switch (mem_props_.HeapType) {
|
||||
case HSA_HEAPTYPE_SYSTEM:
|
||||
*((size_t*)value) = kPageSize_;
|
||||
break;
|
||||
case HSA_HEAPTYPE_FRAME_BUFFER_PRIVATE:
|
||||
case HSA_HEAPTYPE_FRAME_BUFFER_PUBLIC:
|
||||
*((size_t*)value) = core::Runtime::runtime_singleton_->flag().disable_fragment_alloc()
|
||||
? kPageSize_ : fragment_allocator_.default_block_size();
|
||||
break;
|
||||
default:
|
||||
*((size_t*)value) = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
|
||||
break;
|
||||
@@ -437,6 +452,7 @@ hsa_status_t MemoryRegion::GetPoolInfo(hsa_amd_memory_pool_info_t attribute,
|
||||
case HSA_AMD_MEMORY_POOL_INFO_SIZE:
|
||||
case HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED:
|
||||
case HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_GRANULE:
|
||||
case HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE:
|
||||
case HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALIGNMENT:
|
||||
return GetInfo(static_cast<hsa_region_info_t>(attribute), value);
|
||||
case HSA_AMD_MEMORY_POOL_INFO_ACCESSIBLE_BY_ALL:
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador