APIs for the cache level and size

Read the cache level and size from topoogy sysfs file.

Change-Id: Id3c558c95bcb79139a19e4adbaa7ff333d06098f
Этот коммит содержится в:
Bill(Shuzhou) Liu
2023-10-03 11:25:33 -05:00
родитель 656f12e0f3
Коммит 1a233f93fb
7 изменённых файлов: 181 добавлений и 0 удалений
+24
Просмотреть файл
@@ -84,6 +84,7 @@ typedef enum {
#define AMDSMI_MAX_DRIVER_VERSION_LENGTH 80
#define AMDSMI_PRODUCT_NAME_LENGTH 128
#define AMDSMI_MAX_CONTAINER_TYPE 2
#define AMDSMI_MAX_CACHE_TYPES 10
#define AMDSMI_GPU_UUID_SIZE 38
@@ -415,6 +416,16 @@ typedef struct {
uint32_t reserved[16];
} amdsmi_vbios_info_t;
typedef struct {
uint32_t num_cache_types;
struct {
uint32_t cache_size_kb; /* In KB */
uint32_t cache_level;
uint32_t reserved[3];
} cache[AMDSMI_MAX_CACHE_TYPES];
uint32_t reserved[15];
} amdsmi_gpu_cache_info_t;
typedef struct {
uint8_t num_fw_info;
struct fw_info_list_ {
@@ -2158,6 +2169,19 @@ amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle
amdsmi_temperature_type_t sensor_type,
amdsmi_temperature_metric_t metric, int64_t *temperature);
/**
* @brief Returns gpu cache info.
*
* @param[in] processor_handle PF of a processor for which to query
*
* @param[out] info reference to the cache info struct.
* Must be allocated by user.
*
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
*/
amdsmi_status_t amdsmi_get_gpu_cache_info(
amdsmi_processor_handle processor_handle, amdsmi_gpu_cache_info_t *info);
/**
* @brief Get the voltage metric value for the specified metric, from the
* specified voltage sensor on the specified device. It is not supported on