Add memory pool query to return location

Change-Id: I240b77119d7b8ccfc5ff6a3190d6669d69f243e8


[ROCm/ROCR-Runtime commit: 722794e258]
Este commit está contenido en:
David Yat Sin
2023-01-10 15:08:51 +00:00
padre 523bdde26f
commit 580ce4fd25
Se han modificado 2 ficheros con 25 adiciones y 0 borrados
@@ -420,6 +420,14 @@ hsa_status_t MemoryRegion::GetPoolInfo(hsa_amd_memory_pool_info_t attribute,
*((size_t*)value) = 0;
}
break;
case HSA_AMD_MEMORY_POOL_INFO_LOCATION:
if (IsLocalMemory())
*((hsa_amd_memory_pool_location_t*)value) = HSA_AMD_MEMORY_POOL_LOCATION_GPU;
else if (IsSystem())
*((hsa_amd_memory_pool_location_t*)value) = HSA_AMD_MEMORY_POOL_LOCATION_CPU;
else
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
break;
default:
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}
@@ -956,6 +956,17 @@ typedef enum hsa_amd_memory_pool_global_flag_s {
HSA_AMD_MEMORY_POOL_GLOBAL_FLAG_COARSE_GRAINED = 4
} hsa_amd_memory_pool_global_flag_t;
typedef enum hsa_amd_memory_pool_location_s {
/**
* This memory pool resides on the host (CPU)
*/
HSA_AMD_MEMORY_POOL_LOCATION_CPU = 0,
/**
* This memory pool resides on a GPU
*/
HSA_AMD_MEMORY_POOL_LOCATION_GPU = 1
} hsa_amd_memory_pool_location_t;
/**
* @brief Memory pool features.
*/
@@ -1014,6 +1025,12 @@ typedef enum {
* is size_t.
*/
HSA_AMD_MEMORY_POOL_INFO_ALLOC_MAX_SIZE = 16,
/**
* Location of this memory pool. The type of this attribute
* is hsa_amd_memory_pool_location_t.
*/
HSA_AMD_MEMORY_POOL_INFO_LOCATION = 17,
} hsa_amd_memory_pool_info_t;
/**