diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp index 427a3afc7b..02b829c5fb 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_memory_region.cpp @@ -420,21 +420,6 @@ 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; @@ -452,7 +437,6 @@ 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(attribute), value); case HSA_AMD_MEMORY_POOL_INFO_ACCESSIBLE_BY_ALL: @@ -480,6 +464,22 @@ hsa_status_t MemoryRegion::GetPoolInfo(hsa_amd_memory_pool_info_t attribute, else return HSA_STATUS_ERROR_INVALID_ARGUMENT; 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; } diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h index 86ed70795a..1bcbc3c757 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ext_amd.h @@ -1104,14 +1104,6 @@ typedef enum { * must be a power of 2. The type of this attribute is size_t. */ HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALIGNMENT = 7, - /** - * Internal block size for allocations. This would also be the recommended - * granularity size for allocations as this prevents internal fragmentation. - * The value of this attribute is only defined if - * ::HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED is true for this pool. - * The size of this attribute is size_t. - */ - HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE = 8, /** * This memory_pool can be made directly accessible by all the agents in the * system (::hsa_amd_agent_memory_pool_get_info does not return @@ -1129,7 +1121,14 @@ typedef enum { * is hsa_amd_memory_pool_location_t. */ HSA_AMD_MEMORY_POOL_INFO_LOCATION = 17, - + /** + * Internal block size for allocations. This would also be the recommended + * granularity size for allocations as this prevents internal fragmentation. + * The value of this attribute is only defined if + * ::HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED is true for this pool. + * The size of this attribute is size_t. + */ + HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE = 18, } hsa_amd_memory_pool_info_t; /** @@ -2780,7 +2779,7 @@ typedef enum { * @p size must be a aligned to allocation granule size for this memory pool, see * HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_GRANULE * To minimize internal memory fragmentation, align the size to the recommended allocation granule - * size, see HSA_AMD_REGION_INFO_RUNTIME_ALLOC_RECOMMENDED_GRANULE + * size, see HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_REC_GRANULE * * @param[in] pool memory to use * @param[in] size of the memory allocation