Add rsmi_dev_memory_total_get()and rsmi_dev_memory_usage_get()

This commit is contained in:
Chris Freehill committed 2019-03-04 18:26:11 -06:00
1 förälder 89fb40fbe5
incheckning ddd292f1b5
10 files changed
+375 -18

No files matched your search

+56
Visa fil
@@ -245,6 +245,7 @@ typedef enum {
RSMI_MEM_TYPE_LAST = RSMI_MEM_TYPE_GTT
} rsmi_memory_type_t;
/**
* @brief This values of this enum are used as frequency identifiers.
*/
@@ -752,6 +753,61 @@ rsmi_dev_power_profile_set(uint32_t dv_ind, uint32_t sensor_ind,
/** @} */ // end of PowerCont
/*****************************************************************************/
/*****************************************************************************/
/** @defgroup MemQuer Memory Queries
* These functions provide information about memory systems.
* @{
*/
/**
* @brief Get the total amount of memory that exists
*
* @details Given a device index @p dv_ind, a type of memory @p mem_type, and
* a pointer to a uint64_t @p total, this function will write the total amount
* of @p mem_type memory that exists to the location pointed to by @p total.
*
* @param[in] dv_ind a device index
*
* @param[in] mem_type The type of memory for which the total amount will be
* found
*
* @param[inout] total a pointer to uint64_t to which the total amount of
* memory will be written
*
* @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.
*
*/
rsmi_status_t
rsmi_dev_memory_total_get(uint32_t dv_ind, rsmi_memory_type_t mem_type,
uint64_t *total);
/**
* @brief Get the current memory usage
*
* @details Given a device index @p dv_ind, a type of memory @p mem_type, and
* a pointer to a uint64_t @p usage, this function will write the amount of
* @p mem_type memory that that is currently being used to the location
* pointed to by @p total.
*
* @param[in] dv_ind a device index
*
* @param[in] mem_type The type of memory for which the amount being used will
* be found
*
* @param[inout] used a pointer to uint64_t to which the amount of memory
* currently being used will be written
*
* @retval ::RSMI_STATUS_SUCCESS is returned upon successful call.
*
*/
rsmi_status_t
rsmi_dev_memory_usage_get(uint32_t dv_ind, rsmi_memory_type_t mem_type,
uint64_t *used);
/** @} */ // end of MemQuer
/** @defgroup PhysQuer Physcial State Queries
* These functions provide information about the physical characteristics of
* the device.
+7 -7
Visa fil
@@ -1,6 +1,4 @@
/*
* =============================================================================
* ROC Runtime Conformance Release License
* =============================================================================
* The University of Illinois/NCSA
* Open Source License (NCSA)
@@ -73,8 +71,12 @@ enum DevInfoTypes {
kDevErrCntSDMA,
kDevErrCntUMC,
kDevErrCntGFX,
// Reserve spots for future ErrCnt blocks.
// Next, non-ErrCnt device enum should start at 100
kDevMemTotGTT,
kDevMemTotVisVRAM,
kDevMemTotVRAM,
kDevMemUsedGTT,
kDevMemUsedVisVRAM,
kDevMemUsedVRAM,
};
class Device {
@@ -88,9 +90,7 @@ class Device {
const std::shared_ptr<PowerMon>& power_monitor() {return power_monitor_;}
void set_power_monitor(std::shared_ptr<PowerMon> pm) {power_monitor_ = pm;}
#if 0 // This is not being used right now.
int readDevInfo(DevInfoTypes type, uint32_t *val);
#endif
int readDevInfo(DevInfoTypes type, uint64_t *val);
int readDevInfoLine(DevInfoTypes type, std::string *line);
int readDevInfo(DevInfoTypes type, std::string *val);
int readDevInfo(DevInfoTypes type, std::vector<std::string> *retVec);