diff --git a/example/rocm_smi_example.cc b/example/rocm_smi_example.cc index 5bec1a426d..5e881b5f70 100755 --- a/example/rocm_smi_example.cc +++ b/example/rocm_smi_example.cc @@ -80,7 +80,7 @@ static void print_test_header(const char *str, uint32_t dv_ind) { } static const char * -power_profile_string(rsmi_power_profile_preset_masks profile) { +power_profile_string(rsmi_power_profile_preset_masks_t profile) { switch (profile) { case RSMI_PWR_PROF_PRST_CUSTOM_MASK: return "CUSTOM"; @@ -100,7 +100,7 @@ power_profile_string(rsmi_power_profile_preset_masks profile) { } static const char * -perf_level_string(rsmi_dev_perf_level perf_lvl) { +perf_level_string(rsmi_dev_perf_level_t perf_lvl) { switch (perf_lvl) { case RSMI_DEV_PERF_LEVEL_AUTO: return "AUTO"; @@ -117,7 +117,7 @@ perf_level_string(rsmi_dev_perf_level perf_lvl) { static rsmi_status_t test_power_profile(uint32_t dv_ind) { rsmi_status_t ret; - rsmi_power_profile_status status; + rsmi_power_profile_status_t status; print_test_header("Power Profile", dv_ind); @@ -130,7 +130,7 @@ static rsmi_status_t test_power_profile(uint32_t dv_ind) { while (tmp <= RSMI_PWR_PROF_PRST_LAST) { if ((tmp & status.available_profiles) == tmp) { std::cout << "\t" << - power_profile_string((rsmi_power_profile_preset_masks)tmp) << std::endl; + power_profile_string((rsmi_power_profile_preset_masks_t)tmp) << std::endl; } tmp = tmp << 1; } @@ -138,8 +138,8 @@ static rsmi_status_t test_power_profile(uint32_t dv_ind) { power_profile_string(status.current) << std::endl; // Try setting the profile to a different power profile - rsmi_bit_field diff_profiles; - rsmi_power_profile_preset_masks new_prof; + rsmi_bit_field_t diff_profiles; + rsmi_power_profile_preset_masks_t new_prof; diff_profiles = status.available_profiles & (~status.current); if (diff_profiles & RSMI_PWR_PROF_PRST_COMPUTE_MASK) { @@ -162,7 +162,7 @@ static rsmi_status_t test_power_profile(uint32_t dv_ind) { ret = rsmi_dev_power_profile_set(dv_ind, 0, new_prof); CHK_RSMI_RET(ret) std::cout << "Done." << std::endl; - rsmi_dev_perf_level pfl; + rsmi_dev_perf_level_t pfl; ret = rsmi_dev_perf_level_get(dv_ind, &pfl); CHK_RSMI_RET(ret) std::cout << "Performance Level is now " << @@ -305,7 +305,7 @@ static rsmi_status_t test_set_fan_speed(uint32_t dv_ind) { static rsmi_status_t test_set_perf_level(uint32_t dv_ind) { rsmi_status_t ret; - rsmi_dev_perf_level pfl, orig_pfl; + rsmi_dev_perf_level_t pfl, orig_pfl; print_test_header("Performance Level Control", dv_ind); @@ -314,7 +314,8 @@ static rsmi_status_t test_set_perf_level(uint32_t dv_ind) { std::cout << "\t**Original Perf Level:" << perf_level_string(orig_pfl) << std::endl; - pfl = (rsmi_dev_perf_level)((orig_pfl + 1) % (RSMI_DEV_PERF_LEVEL_LAST + 1)); + pfl = + (rsmi_dev_perf_level_t)((orig_pfl + 1) % (RSMI_DEV_PERF_LEVEL_LAST + 1)); std::cout << "Set Performance Level to " << (uint32_t)pfl << " ..." << std::endl; @@ -334,7 +335,7 @@ static rsmi_status_t test_set_perf_level(uint32_t dv_ind) { static rsmi_status_t test_set_freq(uint32_t dv_ind) { rsmi_status_t ret; - rsmi_frequencies f; + rsmi_frequencies_t f; uint32_t freq_bitmask; rsmi_clk_type rsmi_clk; @@ -379,7 +380,7 @@ static rsmi_status_t test_set_freq(uint32_t dv_ind) { return RSMI_STATUS_SUCCESS; } -static void print_frequencies(rsmi_frequencies *f) { +static void print_frequencies(rsmi_frequencies_t *f) { assert(f != nullptr); for (uint32_t j = 0; j < f->num_supported; ++j) { std::cout << "\t** " << j << ": " << f->frequency[j]; @@ -400,8 +401,8 @@ int main() { uint64_t val_ui64, val2_ui64; int64_t val_i64; uint32_t val_ui32; - rsmi_dev_perf_level pfl; - rsmi_frequencies f; + rsmi_dev_perf_level_t pfl; + rsmi_frequencies_t f; uint32_t num_monitor_devs = 0; rsmi_num_monitor_devices(&num_monitor_devs); diff --git a/include/rocm_smi/rocm_smi.h b/include/rocm_smi/rocm_smi.h index 303607e4b0..0656591a6e 100755 --- a/include/rocm_smi/rocm_smi.h +++ b/include/rocm_smi/rocm_smi.h @@ -135,8 +135,10 @@ typedef enum { RSMI_DEV_PERF_LEVEL_LAST = RSMI_DEV_PERF_LEVEL_STABLE_MIN_SCLK, RSMI_DEV_PERF_LEVEL_UNKNOWN = 0x100 //!< Unknown performance level -} rsmi_dev_perf_level; - +} rsmi_dev_perf_level_t; +/// \cond Ignore in docs. +typedef rsmi_dev_perf_level_t rsmi_dev_perf_level; +/// \endcond /** * @brief Available clock types. */ @@ -146,7 +148,10 @@ typedef enum { RSMI_CLK_TYPE_MEM, //!< Memory clock RSMI_CLK_TYPE_LAST = RSMI_CLK_TYPE_MEM -} rsmi_clk_type; +} rsmi_clk_type_t; +/// \cond Ignore in docs. +typedef rsmi_clk_type_t rsmi_clk_type; +/// \endcond /** * @brief Temperature Metrics. This enum is used to identify various @@ -182,11 +187,14 @@ typedef enum { RSMI_TEMP_HIGHEST, //!< Historical maximum temperature. RSMI_TEMP_LAST = RSMI_TEMP_HIGHEST -} rsmi_temperature_metric; +} rsmi_temperature_metric_t; +/// \cond Ignore in docs. +typedef rsmi_temperature_metric_t rsmi_temperature_metric; +/// \endcond /** * @brief Pre-set Profile Selections. These bitmasks can be AND'd with the - * ::rsmi_power_profile_status.available_profiles returned from + * ::rsmi_power_profile_status_t.available_profiles returned from * ::rsmi_dev_power_profile_presets_get() to determine which power profiles * are supported by the system. */ @@ -204,7 +212,10 @@ typedef enum { //!< Invalid power profile RSMI_PWR_PROF_PRST_INVALID = 0xFFFFFFFFFFFFFFFF -} rsmi_power_profile_preset_masks; +} rsmi_power_profile_preset_masks_t; +/// \cond Ignore in docs. +typedef rsmi_power_profile_preset_masks_t rsmi_power_profile_preset_masks; +/// \endcond /** * @brief This enum is used to identify different GPU blocks. @@ -217,8 +228,13 @@ typedef enum { RSMI_GPU_BLOCK_GFX, RSMI_GPU_BLOCK_LAST = RSMI_GPU_BLOCK_GFX, -} rsmi_gpu_block; +} rsmi_gpu_block_t; +/// \cond Ignore in docs. +typedef rsmi_gpu_block_t rsmi_gpu_block; +/// \endcond +typedef struct { +} rsmi_memory_type_t; /** * @brief This values of this enum are used as frequency identifiers. */ @@ -226,17 +242,23 @@ typedef enum { RSMI_FREQ_IND_MIN = 0, //!< Index used for the minimum frequency value RSMI_FREQ_IND_MAX = 1, //!< Index used for the maximum frequency value RSMI_FREQ_IND_INVALID = 0xFFFFFFFF //!< An invalid frequency index -} rsmi_freq_ind; +} rsmi_freq_ind_t; +/// \cond Ignore in docs. +typedef rsmi_freq_ind_t rsmi_freq_ind; +/// \endcond /** * @brief Bitfield used in various RSMI calls */ -typedef uint64_t rsmi_bit_field; +typedef uint64_t rsmi_bit_field_t; +/// \cond Ignore in docs. +typedef rsmi_bit_field_t rsmi_bit_field; +/// \endcond /** * @brief Number of possible power profiles that a system could support */ -#define RSMI_MAX_NUM_POWER_PROFILES (sizeof(rsmi_bit_field) * 8) +#define RSMI_MAX_NUM_POWER_PROFILES (sizeof(rsmi_bit_field_t) * 8) /** * @brief This structure contains information about which power profiles are @@ -247,18 +269,21 @@ typedef struct { /** * Which profiles are supported by this system */ - rsmi_bit_field available_profiles; + rsmi_bit_field_t available_profiles; /** * Which power profile is currently active */ - rsmi_power_profile_preset_masks current; + rsmi_power_profile_preset_masks_t current; /** * How many power profiles are available */ uint32_t num_profiles; -} rsmi_power_profile_status; +} rsmi_power_profile_status_t; +/// \cond Ignore in docs. +typedef rsmi_power_profile_status_t rsmi_power_profile_status; +/// \endcond /** * @brief This structure holds information about clock frequencies. @@ -279,7 +304,10 @@ typedef struct { * Only the first num_supported frequencies are valid. */ uint64_t frequency[RSMI_MAX_NUM_FREQUENCIES]; -} rsmi_frequencies; +} rsmi_frequencies_t; +/// \cond Ignore in docs. +typedef rsmi_frequencies_t rsmi_frequencies; +/// \endcond /** * @brief This structure holds information about the possible PCIe @@ -290,14 +318,18 @@ typedef struct { /** * Transfer rates (T/s) that are possible */ - rsmi_frequencies transfer_rate; + rsmi_frequencies_t transfer_rate; /** * List of lanes for corresponding transfer rate. * Only the first num_supported bandwidths are valid. */ uint32_t lanes[RSMI_MAX_NUM_FREQUENCIES]; -} rsmi_pcie_bandwidth; +} rsmi_pcie_bandwidth_t; + +/// \cond Ignore in docs. +typedef rsmi_pcie_bandwidth_t rsmi_pcie_bandwidth; +/// \endcond /** * @brief This structure holds version information. @@ -307,15 +339,20 @@ typedef struct { uint32_t minor; //!< Minor version uint32_t patch; //!< Patch, build or stepping version const char *build; //!< Build string -} rsmi_version; - +} rsmi_version_t; +/// \cond Ignore in docs. +typedef rsmi_version_t rsmi_version; +/// \endcond /** * @brief This structure represents a range (e.g., frequencies or voltages). */ typedef struct { uint64_t lower_bound; //!< Lower bound of range uint64_t upper_bound; //!< Upper bound of range -} rsmi_range; +} rsmi_range_t; +/// \cond Ignore in docs. +typedef rsmi_range_t rsmi_range; +/// \endcond /** * @brief This structure represents a point on the frequency-voltage plane. @@ -323,45 +360,57 @@ typedef struct { typedef struct { uint64_t frequency; //!< Frequency coordinate (in Hz) uint64_t voltage; //!< Voltage coordinate (in mV) -} rsmi_od_vddc_point; +} rsmi_od_vddc_point_t; +/// \cond Ignore in docs. +typedef rsmi_od_vddc_point_t rsmi_od_vddc_point; +/// \endcond /** - * @brief This structure holds 2 ::rsmi_range's, one for frequency and one for + * @brief This structure holds 2 ::rsmi_range_t's, one for frequency and one for * voltage. These 2 ranges indicate the range of possible values for the - * corresponding ::rsmi_od_vddc_point. + * corresponding ::rsmi_od_vddc_point_t. */ typedef struct { - rsmi_range freq_range; //!< The frequency range for this VDDC Curve point - rsmi_range volt_range; //!< The voltage range for this VDDC Curve point -} rsmi_freq_volt_region; + rsmi_range_t freq_range; //!< The frequency range for this VDDC Curve point + rsmi_range_t volt_range; //!< The voltage range for this VDDC Curve point +} rsmi_freq_volt_region_t; +/// \cond Ignore in docs. +typedef rsmi_freq_volt_region_t rsmi_freq_volt_region; +/// \endcond /** - * ::RSMI_NUM_VOLTAGE_CURVE_POINTS number of ::rsmi_od_vddc_point's + * ::RSMI_NUM_VOLTAGE_CURVE_POINTS number of ::rsmi_od_vddc_point_t's */ typedef struct { /** - * Array of ::RSMI_NUM_VOLTAGE_CURVE_POINTS ::rsmi_od_vddc_point's that + * Array of ::RSMI_NUM_VOLTAGE_CURVE_POINTS ::rsmi_od_vddc_point_t's that * make up the voltage frequency curve points. */ - rsmi_od_vddc_point vc_points[RSMI_NUM_VOLTAGE_CURVE_POINTS]; -} rsmi_od_volt_curve; + rsmi_od_vddc_point_t vc_points[RSMI_NUM_VOLTAGE_CURVE_POINTS]; +} rsmi_od_volt_curve_t; +/// \cond Ignore in docs. +typedef rsmi_od_volt_curve_t rsmi_od_volt_curve; +/// \endcond /** * @brief This structure holds the frequency-voltage values for a device. */ typedef struct { - rsmi_range curr_sclk_range; //!< The current SCLK frequency range - rsmi_range curr_mclk_range; //!< The current MCLK frequency range; + rsmi_range_t curr_sclk_range; //!< The current SCLK frequency range + rsmi_range_t curr_mclk_range; //!< The current MCLK frequency range; //!< (upper bound only) - rsmi_range sclk_freq_limits; //!< The range possible of SCLK values - rsmi_range mclk_freq_limits; //!< The range possible of MCLK values + rsmi_range_t sclk_freq_limits; //!< The range possible of SCLK values + rsmi_range_t mclk_freq_limits; //!< The range possible of MCLK values /** * @brief The current voltage curve */ - rsmi_od_volt_curve curve; + rsmi_od_volt_curve_t curve; uint32_t num_regions; //!< The number of voltage curve regions -} rsmi_od_volt_freq_data; +} rsmi_od_volt_freq_data_t; +/// \cond Ignore in docs. +typedef rsmi_od_volt_freq_data_t rsmi_od_volt_freq_data; +/// \endcond /** * @brief This structure holds error counts. @@ -410,21 +459,21 @@ rsmi_status_t rsmi_num_monitor_devices(uint32_t *num_devices); * @brief Get the list of possible PCIe bandwidths that are available. * * @details Given a device index @p dv_ind and a pointer to a to an - * ::rsmi_pcie_bandwidth structure @p bandwidth, this function will fill in + * ::rsmi_pcie_bandwidth_t structure @p bandwidth, this function will fill in * @p bandwidth with the possible T/s values and associated number of lanes, * and indication of the current selection. * * @param[in] dv_ind a device index * * @param[inout] bandwidth a pointer to a caller provided - * ::rsmi_pcie_bandwidth structure to which the frequency information will be + * ::rsmi_pcie_bandwidth_t structure to which the frequency information will be * written * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. * */ rsmi_status_t -rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth *bandwidth); +rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth_t *bandwidth); /** * @brief Get percentage of time device is busy doing any processing @@ -451,7 +500,7 @@ rsmi_dev_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent); * @details Given a device index @p dv_ind and a 64 bit bitmask @p bw_bitmask, * this function will limit the set of allowable bandwidths. If a bit in @p * bw_bitmask has a value of 1, then the frequency (as ordered in an - * ::rsmi_frequencies returned by ::rsmi_dev_gpu_clk_freq_get()) corresponding + * ::rsmi_frequencies_t returned by ::rsmi_dev_gpu_clk_freq_get()) corresponding * to that bit index will be allowed. * * This function will change the performance level to @@ -460,14 +509,14 @@ rsmi_dev_busy_percent_get(uint32_t dv_ind, uint32_t *busy_percent); * to get back to default state. * * All bits with indices greater than or equal to the value of the - * ::rsmi_frequencies::num_supported field of ::rsmi_pcie_bandwidth will be + * ::rsmi_frequencies_t::num_supported field of ::rsmi_pcie_bandwidth_t will be * ignored. * * @param[in] dv_ind a device index * * @param[in] bw_bitmask A bitmask indicating the indices of the * bandwidths that are to be enabled (1) and disabled (0). Only the lowest - * ::rsmi_frequencies::num_supported (of ::rsmi_pcie_bandwidth) bits of + * ::rsmi_frequencies_t::num_supported (of ::rsmi_pcie_bandwidth_t) bits of * this mask are relevant. */ rsmi_status_t rsmi_dev_pci_bandwidth_set(uint32_t dv_ind, uint64_t bw_bitmask); @@ -497,7 +546,7 @@ rsmi_status_t rsmi_dev_pci_id_get(uint32_t dv_ind, uint64_t *bdfid); * sent, @p received and @p max_pkt_sz, this function will write the number * of bytes sent and received in 1 second to @p sent and @p received, * respectively. The maximum possible packet size will be written to - * @max_pkt_size. + * @max_pkt_sz. * * @param[in] dv_ind a device index * @@ -543,25 +592,25 @@ rsmi_status_t rsmi_dev_id_get(uint32_t dv_ind, uint64_t *id); * device index. * * @details Given a device index @p dv_ind and a pointer to a uint32_t @p - * perf, this function will write the ::rsmi_dev_perf_level to the uint32_t + * perf, this function will write the ::rsmi_dev_perf_level_t to the uint32_t * pointed to by @p perf * * @param[in] dv_ind a device index * - * @param[inout] perf a pointer to ::rsmi_dev_perf_level to which the + * @param[inout] perf a pointer to ::rsmi_dev_perf_level_t to which the * performance level will be written * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. * */ rsmi_status_t rsmi_dev_perf_level_get(uint32_t dv_ind, - rsmi_dev_perf_level *perf); + rsmi_dev_perf_level_t *perf); /** * @brief Set the PowerPlay performance level associated with the device with * provided device index with the provided value. * - * @details Given a device index @p dv_ind and an ::rsmi_dev_perf_level @p + * @details Given a device index @p dv_ind and an ::rsmi_dev_perf_level_t @p * perf_level, this function will set the PowerPlay performance level for the * device to the value @p perf_lvl. * @@ -573,7 +622,7 @@ rsmi_status_t rsmi_dev_perf_level_get(uint32_t dv_ind, * */ rsmi_status_t -rsmi_dev_perf_level_set(int32_t dv_ind, rsmi_dev_perf_level perf_lvl); +rsmi_dev_perf_level_set(int32_t dv_ind, rsmi_dev_perf_level_t perf_lvl); /** * @brief Get the overdrive percent associated with the device with provided @@ -637,7 +686,7 @@ rsmi_status_t rsmi_dev_overdrive_level_set(int32_t dv_ind, uint32_t od); * specified clock type. * * @details Given a device index @p dv_ind, a clock type @p clk_type, and a - * pointer to a to an ::rsmi_frequencies structure @p f, this function will + * pointer to a to an ::rsmi_frequencies_t structure @p f, this function will * fill in @p f with the possible clock speeds, and indication of the current * clock speed selection. * @@ -645,14 +694,14 @@ rsmi_status_t rsmi_dev_overdrive_level_set(int32_t dv_ind, uint32_t od); * * @param[in] clk_type the type of clock for which the frequency is desired * - * @param[inout] f a pointer to a caller provided ::rsmi_frequencies structure + * @param[inout] f a pointer to a caller provided ::rsmi_frequencies_t structure * to which the frequency information will be written * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. * */ rsmi_status_t rsmi_dev_gpu_clk_freq_get(uint32_t dv_ind, - rsmi_clk_type clk_type, rsmi_frequencies *f); + rsmi_clk_type_t clk_type, rsmi_frequencies_t *f); /** * @brief Control the set of allowed frequencies that can be used for the @@ -661,7 +710,7 @@ rsmi_status_t rsmi_dev_gpu_clk_freq_get(uint32_t dv_ind, * @details Given a device index @p dv_ind, a clock type @p clk_type, and a * 64 bit bitmask @p freq_bitmask, this function will limit the set of * allowable frequencies. If a bit in @p freq_bitmask has a value of 1, then - * the frequency (as ordered in an ::rsmi_frequencies returned by + * the frequency (as ordered in an ::rsmi_frequencies_t returned by * rsmi_dev_gpu_clk_freq_get()) corresponding to that bit index will be * allowed. * @@ -671,7 +720,7 @@ rsmi_status_t rsmi_dev_gpu_clk_freq_get(uint32_t dv_ind, * to get back to default state. * * All bits with indices greater than or equal to - * ::rsmi_frequencies::num_supported will be ignored. + * ::rsmi_frequencies_t::num_supported will be ignored. * * @param[in] dv_ind a device index * @@ -680,10 +729,10 @@ rsmi_status_t rsmi_dev_gpu_clk_freq_get(uint32_t dv_ind, * * @param[in] freq_bitmask A bitmask indicating the indices of the * frequencies that are to be enabled (1) and disabled (0). Only the lowest - * ::rsmi_frequencies.num_supported bits of this mask are relevant. + * ::rsmi_frequencies_t.num_supported bits of this mask are relevant. */ rsmi_status_t rsmi_dev_gpu_clk_freq_set(uint32_t dv_ind, - rsmi_clk_type clk_type, uint64_t freq_bitmask); + rsmi_clk_type_t clk_type, uint64_t freq_bitmask); /** * @brief Get the name of a gpu device. * @@ -708,7 +757,7 @@ rsmi_status_t rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len); * specified temperature sensor on the specified device. * * @details Given a device index @p dv_ind, a 0-based sensor index - * @p sensor_ind, a ::rsmi_temperature_metric @p metric and a pointer to an + * @p sensor_ind, a ::rsmi_temperature_metric_t @p metric and a pointer to an * int64_t @p temperature, this function will write the value of the metric * indicated by @p metric to the memory location @p temperature. * @@ -727,12 +776,12 @@ rsmi_status_t rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len); * */ rsmi_status_t rsmi_dev_temp_metric_get(uint32_t dv_ind, uint32_t sensor_ind, - rsmi_temperature_metric metric, int64_t *temperature); + rsmi_temperature_metric_t metric, int64_t *temperature); /** * @brief Retrieve the error counts for a GPU block * - * @details Given a device index @p dv_ind, an ::rsmi_gpu_block @p block and a + * @details Given a device index @p dv_ind, an ::rsmi_gpu_block_t @p block and a * pointer to an ::rsmi_error_count_t @p ec, this function will write the error * count values for the GPU block indicated by @p block to memory pointed to by * @p ec. @@ -748,7 +797,7 @@ rsmi_status_t rsmi_dev_temp_metric_get(uint32_t dv_ind, uint32_t sensor_ind, * */ rsmi_status_t rsmi_dev_error_count_get(uint32_t dv_ind, - rsmi_gpu_block block, rsmi_error_count_t *ec); + rsmi_gpu_block_t block, rsmi_error_count_t *ec); /** * @brief Reset the fan to automatic driver control * @@ -857,23 +906,23 @@ rsmi_status_t rsmi_dev_fan_speed_set(uint32_t dv_ind, uint32_t sensor_ind, * @brief This function retrieves the voltage/frequency curve information * * @details Given a device index @p dv_ind and a pointer to a - * ::rsmi_od_volt_freq_data structure @p odv, this function will populate @p - * odv. See ::rsmi_od_volt_freq_data for more details. + * ::rsmi_od_volt_freq_data_t structure @p odv, this function will populate @p + * odv. See ::rsmi_od_volt_freq_data_t for more details. * * @param[in] dv_ind a device index * - * @param[in] odv a pointer to an ::rsmi_od_volt_freq_data structure + * @param[in] odv a pointer to an ::rsmi_od_volt_freq_data_t structure * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. */ rsmi_status_t rsmi_dev_od_volt_info_get(uint32_t dv_ind, - rsmi_od_volt_freq_data *odv); + rsmi_od_volt_freq_data_t *odv); /** * @brief Set the frequency limits for the specified clock * - * @details Given a device index @p dv_ind, a clock type (::rsmi_clk_type) - * @p clk, and a pointer to a ::rsmi_range @p range containing the desired + * @details Given a device index @p dv_ind, a clock type (::rsmi_clk_type_t) + * @p clk, and a pointer to a ::rsmi_range_t @p range containing the desired * upper and lower frequency limits, this function will attempt to set the * frequency limits to those specified in @p range. * @@ -881,23 +930,23 @@ rsmi_status_t rsmi_dev_od_volt_info_get(uint32_t dv_ind, * * @param[in] clk The clock type for which the limits should be imposed. * - * @param[in] range A pointer to the ::rsmi_range containing the desired limits + * @param[in] range A pointer to the ::rsmi_range_t containing the desired limits * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. */ -rsmi_status_t rsmi_dev_od_freq_range_set(uint32_t dv_ind, rsmi_clk_type clk, - rsmi_range *range); +rsmi_status_t rsmi_dev_od_freq_range_set(uint32_t dv_ind, rsmi_clk_type_t clk, + rsmi_range_t *range); /** * @brief This function will retrieve the current valid regions in the * frequency/voltage space. * * @details Given a device index @p dv_ind, a pointer to an unsigned integer - * @p num_regions and a buffer of ::rsmi_freq_volt_region structures, @p + * @p num_regions and a buffer of ::rsmi_freq_volt_region_t structures, @p * buffer, this function will populate @p buffer with the current * frequency-volt space regions. The caller should assign @p buffer to memory * that can be written to by this function. The caller should also - * indicate the number of ::rsmi_freq_volt_region structures that can safely + * indicate the number of ::rsmi_freq_volt_region_t structures that can safely * be written to @p buffer in @p num_regions. * * The number of regions to expect this function provide (@p num_regions) can @@ -906,17 +955,17 @@ rsmi_status_t rsmi_dev_od_freq_range_set(uint32_t dv_ind, rsmi_clk_type clk, * @param[in] dv_ind a device index * * @param[inout] num_regions As input, this is the number of - * ::rsmi_freq_volt_region structures that can be written to @p buffer. As - * output, this is the number of ::rsmi_freq_volt_region structures that were + * ::rsmi_freq_volt_region_t structures that can be written to @p buffer. As + * output, this is the number of ::rsmi_freq_volt_region_t structures that were * actually written. * * @param[inout] buffer a caller provided buffer to which - * ::rsmi_freq_volt_region structures will be written + * ::rsmi_freq_volt_region_t structures will be written * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. */ rsmi_status_t rsmi_dev_od_volt_curve_regions_get(uint32_t dv_ind, - uint32_t *num_regions, rsmi_freq_volt_region *buffer); + uint32_t *num_regions, rsmi_freq_volt_region_t *buffer); /** * @brief Get the average power consumption of the device with provided @@ -1014,24 +1063,24 @@ rsmi_dev_power_cap_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t cap); * which profile is currently active. * * @details Given a device index @p dv_ind and a pointer to a - * ::rsmi_power_profile_status @p status, this function will set the bits of - * the ::rsmi_power_profile_status.available_profiles bit field of @p status to + * ::rsmi_power_profile_status_t @p status, this function will set the bits of + * the ::rsmi_power_profile_status_t.available_profiles bit field of @p status to * 1 if the profile corresponding to the respective - * ::rsmi_power_profile_preset_masks profiles are enabled. For example, if both + * ::rsmi_power_profile_preset_masks_t profiles are enabled. For example, if both * the VIDEO and VR power profiles are available selections, then * ::RSMI_PWR_PROF_PRST_VIDEO_MASK AND'ed with - * ::rsmi_power_profile_status.available_profiles will be non-zero as will + * ::rsmi_power_profile_status_t.available_profiles will be non-zero as will * ::RSMI_PWR_PROF_PRST_VR_MASK AND'ed with - * ::rsmi_power_profile_status.available_profiles. Additionally, - * ::rsmi_power_profile_status.current will be set to the - * ::rsmi_power_profile_preset_masks of the profile that is currently active. + * ::rsmi_power_profile_status_t.available_profiles. Additionally, + * ::rsmi_power_profile_status_t.current will be set to the + * ::rsmi_power_profile_preset_masks_t of the profile that is currently active. * * @param[in] dv_ind a device index * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. * - * @param[inout] status a pointer to ::rsmi_power_profile_status that will be + * @param[inout] status a pointer to ::rsmi_power_profile_status_t that will be * populated by a call to this function * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. @@ -1039,7 +1088,7 @@ rsmi_dev_power_cap_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t cap); */ rsmi_status_t rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind, - rsmi_power_profile_status *status); + rsmi_power_profile_status_t *status); /** * @brief Set the power profile @@ -1055,7 +1104,7 @@ rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind, * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. * - * @param[in] profile a ::rsmi_power_profile_preset_masks that hold the mask + * @param[in] profile a ::rsmi_power_profile_preset_masks_t that hold the mask * of the desired new power profile * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call. @@ -1063,7 +1112,7 @@ rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind, */ rsmi_status_t rsmi_dev_power_profile_set(uint32_t dv_ind, uint32_t sensor_ind, - rsmi_power_profile_preset_masks profile); + rsmi_power_profile_preset_masks_t profile); /** * @brief Get the VBIOS identifer string @@ -1111,14 +1160,14 @@ rsmi_status_string(rsmi_status_t status, const char **status_string); * @details Get the major, minor, patch and build string for RSMI build * currently in use through @p version * - * @param[inout] version A pointer to an ::rsmi_version structure that will + * @param[inout] version A pointer to an ::rsmi_version_t structure that will * be updated with the version information upon return. * * @retval ::RSMI_STATUS_SUCCESS is returned upon successful call * */ rsmi_status_t -rsmi_version_get(rsmi_version *version); +rsmi_version_get(rsmi_version_t *version); #ifdef __cplusplus } diff --git a/src/rocm_smi.cc b/src/rocm_smi.cc index 382533c1ea..7c2ecd7ad6 100755 --- a/src/rocm_smi.cc +++ b/src/rocm_smi.cc @@ -175,7 +175,7 @@ static uint64_t freq_string_to_int(const std::vector &freq_lines, } static void freq_volt_string_to_point(std::string in_line, - rsmi_od_vddc_point *pt) { + rsmi_od_vddc_point_t *pt) { std::istringstream fs_vlt(in_line); assert(pt != nullptr); @@ -204,7 +204,7 @@ static void freq_volt_string_to_point(std::string in_line, return; } -static void od_value_pair_str_to_range(std::string in_line, rsmi_range *rg) { +static void od_value_pair_str_to_range(std::string in_line, rsmi_range_t *rg) { std::istringstream fs_rng(in_line); assert(rg != nullptr); @@ -242,7 +242,7 @@ power_prof_string_to_int(std::string pow_prof_line, bool *is_curr, std::string mode; size_t tmp; - rsmi_power_profile_preset_masks ret = RSMI_PWR_PROF_PRST_INVALID; + rsmi_power_profile_preset_masks_t ret = RSMI_PWR_PROF_PRST_INVALID; fs >> *prof_ind; fs >> mode; @@ -432,7 +432,7 @@ rsmi_num_monitor_devices(uint32_t *num_devices) { } rsmi_status_t -rsmi_dev_error_count_get(uint32_t dv_ind, rsmi_gpu_block block, +rsmi_dev_error_count_get(uint32_t dv_ind, rsmi_gpu_block_t block, rsmi_error_count_t *ec) { std::vector val_vec; rsmi_status_t ret; @@ -520,7 +520,7 @@ rsmi_dev_id_get(uint32_t dv_ind, uint64_t *id) { } rsmi_status_t -rsmi_dev_perf_level_get(uint32_t dv_ind, rsmi_dev_perf_level *perf) { +rsmi_dev_perf_level_get(uint32_t dv_ind, rsmi_dev_perf_level_t *perf) { TRY std::string val_str; rsmi_status_t ret = get_dev_value_str(amd::smi::kDevPerfLevel, dv_ind, @@ -565,7 +565,7 @@ rsmi_dev_overdrive_level_set(int32_t dv_ind, uint32_t od) { } rsmi_status_t -rsmi_dev_perf_level_set(int32_t dv_ind, rsmi_dev_perf_level perf_level) { +rsmi_dev_perf_level_set(int32_t dv_ind, rsmi_dev_perf_level_t perf_level) { TRY if (perf_level > RSMI_DEV_PERF_LEVEL_LAST) { return RSMI_STATUS_INVALID_ARGS; @@ -576,7 +576,7 @@ rsmi_dev_perf_level_set(int32_t dv_ind, rsmi_dev_perf_level perf_level) { } static rsmi_status_t get_frequencies(amd::smi::DevInfoTypes type, - uint32_t dv_ind, rsmi_frequencies *f, uint32_t *lanes = nullptr) { + uint32_t dv_ind, rsmi_frequencies_t *f, uint32_t *lanes = nullptr) { TRY std::vector val_vec; rsmi_status_t ret; @@ -625,8 +625,8 @@ static rsmi_status_t get_frequencies(amd::smi::DevInfoTypes type, } static rsmi_status_t get_power_profiles(uint32_t dv_ind, - rsmi_power_profile_status *p, - std::map *ind_map) { + rsmi_power_profile_status_t *p, + std::map *ind_map) { TRY std::vector val_vec; rsmi_status_t ret; @@ -646,7 +646,7 @@ static rsmi_status_t get_power_profiles(uint32_t dv_ind, p->current = RSMI_PWR_PROF_PRST_INVALID; // init to an invalid value p->available_profiles = 0; - rsmi_power_profile_preset_masks prof; + rsmi_power_profile_preset_masks_t prof; uint32_t prof_ind; for (uint32_t i = 1; i < val_vec.size(); ++i) { @@ -706,7 +706,7 @@ static const uint32_t kOD_VDDC_CURVE_num_lines = kOD_VDDC_CURVE_start_index + 4; static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind, - rsmi_od_volt_freq_data *p) { + rsmi_od_volt_freq_data_t *p) { TRY std::vector val_vec; rsmi_status_t ret; @@ -762,7 +762,7 @@ static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind, } static void get_vc_region(uint32_t start_ind, - std::vector *val_vec, rsmi_freq_volt_region *p) { + std::vector *val_vec, rsmi_freq_volt_region_t *p) { assert(p != nullptr); assert(val_vec != nullptr); // There must be at least 1 region to read in @@ -783,7 +783,7 @@ static void get_vc_region(uint32_t start_ind, * *num_regions regions. On */ static rsmi_status_t get_od_clk_volt_curve_regions(uint32_t dv_ind, - uint32_t *num_regions, rsmi_freq_volt_region *p) { + uint32_t *num_regions, rsmi_freq_volt_region_t *p) { TRY std::vector val_vec; rsmi_status_t ret; @@ -820,18 +820,19 @@ static bool is_power_of_2(uint64_t n) { return n && !(n & (n - 1)); } static rsmi_status_t set_power_profile(uint32_t dv_ind, - rsmi_power_profile_preset_masks profile) { + rsmi_power_profile_preset_masks_t profile) { TRY rsmi_status_t ret; - rsmi_power_profile_status avail_profiles = {0, RSMI_PWR_PROF_PRST_INVALID, 0}; + rsmi_power_profile_status_t avail_profiles = + {0, RSMI_PWR_PROF_PRST_INVALID, 0}; // Determine if the provided profile is valid if (!is_power_of_2(profile)) { return RSMI_STATUS_INPUT_OUT_OF_BOUNDS; } - std::map ind_map; + std::map ind_map; ret = get_power_profiles(dv_ind, &avail_profiles, &ind_map); if (ret != RSMI_STATUS_SUCCESS) { @@ -858,8 +859,8 @@ static rsmi_status_t set_power_profile(uint32_t dv_ind, } rsmi_status_t -rsmi_dev_gpu_clk_freq_get(uint32_t dv_ind, rsmi_clk_type clk_type, - rsmi_frequencies *f) { +rsmi_dev_gpu_clk_freq_get(uint32_t dv_ind, rsmi_clk_type_t clk_type, + rsmi_frequencies_t *f) { TRY switch (clk_type) { case RSMI_CLK_TYPE_SYS: @@ -890,9 +891,9 @@ static std::string bitfield_to_freq_string(uint64_t bitf, rsmi_status_t rsmi_dev_gpu_clk_freq_set(uint32_t dv_ind, - rsmi_clk_type clk_type, uint64_t freq_bitmask) { + rsmi_clk_type_t clk_type, uint64_t freq_bitmask) { rsmi_status_t ret; - rsmi_frequencies freqs; + rsmi_frequencies_t freqs; TRY ret = rsmi_dev_gpu_clk_freq_get(dv_ind, clk_type, &freqs); @@ -965,7 +966,7 @@ rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len) { } rsmi_status_t -rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth *b) { +rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth_t *b) { TRY assert(b != nullptr); @@ -982,7 +983,7 @@ rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth *b) { rsmi_status_t rsmi_dev_pci_bandwidth_set(uint32_t dv_ind, uint64_t bw_bitmask) { rsmi_status_t ret; - rsmi_pcie_bandwidth bws; + rsmi_pcie_bandwidth_t bws; TRY ret = rsmi_dev_pci_bandwidth_get(dv_ind, &bws); @@ -1049,7 +1050,7 @@ rsmi_dev_pci_throughput_get(uint32_t dv_ind, uint64_t *sent, rsmi_status_t rsmi_dev_temp_metric_get(uint32_t dv_ind, uint32_t sensor_ind, - rsmi_temperature_metric metric, int64_t *temperature) { + rsmi_temperature_metric_t metric, int64_t *temperature) { TRY if (temperature == nullptr) { @@ -1228,7 +1229,7 @@ rsmi_dev_fan_speed_max_get(uint32_t dv_ind, uint32_t sensor_ind, } rsmi_status_t -rsmi_dev_od_volt_info_get(uint32_t dv_ind, rsmi_od_volt_freq_data *odv) { +rsmi_dev_od_volt_info_get(uint32_t dv_ind, rsmi_od_volt_freq_data_t *odv) { TRY rsmi_status_t ret = get_od_clk_volt_info(dv_ind, odv); @@ -1237,7 +1238,7 @@ rsmi_dev_od_volt_info_get(uint32_t dv_ind, rsmi_od_volt_freq_data *odv) { } rsmi_status_t rsmi_dev_od_volt_curve_regions_get(uint32_t dv_ind, - uint32_t *num_regions, rsmi_freq_volt_region *buffer) { + uint32_t *num_regions, rsmi_freq_volt_region_t *buffer) { TRY if (buffer == nullptr || num_regions == nullptr || *num_regions == 0) { @@ -1352,7 +1353,7 @@ rsmi_dev_power_cap_set(uint32_t dv_ind, uint32_t sensor_ind, uint64_t cap) { rsmi_status_t rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind, - rsmi_power_profile_status *status) { + rsmi_power_profile_status_t *status) { TRY ++sensor_ind; // power sysfs files have 1-based indices @@ -1364,7 +1365,7 @@ rsmi_dev_power_profile_presets_get(uint32_t dv_ind, uint32_t sensor_ind, rsmi_status_t rsmi_dev_power_profile_set(uint32_t dv_ind, uint32_t sensor_ind, - rsmi_power_profile_preset_masks profile) { + rsmi_power_profile_preset_masks_t profile) { TRY ++sensor_ind; // power sysfs files have 1-based indices @@ -1481,7 +1482,7 @@ rsmi_dev_vbios_version_get(uint32_t dv_ind, char *vbios, uint32_t len) { } rsmi_status_t -rsmi_version_get(rsmi_version *version) { +rsmi_version_get(rsmi_version_t *version) { TRY if (version == nullptr) { diff --git a/tests/rocm_smi_test/functional/err_cnt_read.cc b/tests/rocm_smi_test/functional/err_cnt_read.cc index efa0f2e520..cde2f6de85 100755 --- a/tests/rocm_smi_test/functional/err_cnt_read.cc +++ b/tests/rocm_smi_test/functional/err_cnt_read.cc @@ -93,17 +93,17 @@ void TestErrCntRead::Run(void) { PrintDeviceHeader(i); for (uint32_t b = RSMI_GPU_BLOCK_FIRST; b <= RSMI_GPU_BLOCK_LAST; ++b) { - err = rsmi_dev_error_count_get(i, static_cast(b), &ec); + err = rsmi_dev_error_count_get(i, static_cast(b), &ec); if (err == RSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Error Count for " << - GetBlockNameStr(static_cast(b)) << + GetBlockNameStr(static_cast(b)) << ": Not supported on this machine" << std::endl; } else { CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Error counts for " << - GetBlockNameStr(static_cast(b)) << " block: " + GetBlockNameStr(static_cast(b)) << " block: " << std::endl; std::cout << "\t\tCorrectable errors: " << ec.correctable_err << std::endl; diff --git a/tests/rocm_smi_test/functional/frequencies_read.cc b/tests/rocm_smi_test/functional/frequencies_read.cc index bcdc68f39c..755cfb5901 100755 --- a/tests/rocm_smi_test/functional/frequencies_read.cc +++ b/tests/rocm_smi_test/functional/frequencies_read.cc @@ -85,7 +85,7 @@ void TestFrequenciesRead::Close() { } -static void print_frequencies(rsmi_frequencies *f, uint32_t *l = nullptr) { +static void print_frequencies(rsmi_frequencies_t *f, uint32_t *l = nullptr) { assert(f != nullptr); for (uint32_t j = 0; j < f->num_supported; ++j) { std::cout << "\t** " << j << ": " << f->frequency[j]; @@ -104,8 +104,8 @@ static void print_frequencies(rsmi_frequencies *f, uint32_t *l = nullptr) { void TestFrequenciesRead::Run(void) { rsmi_status_t err; - rsmi_frequencies f; - rsmi_pcie_bandwidth b; + rsmi_frequencies_t f; + rsmi_pcie_bandwidth_t b; TestBase::Run(); diff --git a/tests/rocm_smi_test/functional/frequencies_read_write.cc b/tests/rocm_smi_test/functional/frequencies_read_write.cc index c52357aa27..3b8f8999f1 100755 --- a/tests/rocm_smi_test/functional/frequencies_read_write.cc +++ b/tests/rocm_smi_test/functional/frequencies_read_write.cc @@ -91,7 +91,7 @@ void TestFrequenciesReadWrite::Close() { void TestFrequenciesReadWrite::Run(void) { rsmi_status_t ret; - rsmi_frequencies f; + rsmi_frequencies_t f; uint32_t freq_bitmask; rsmi_clk_type rsmi_clk; diff --git a/tests/rocm_smi_test/functional/pci_read_write.cc b/tests/rocm_smi_test/functional/pci_read_write.cc index c69abfa952..6e63e495a4 100755 --- a/tests/rocm_smi_test/functional/pci_read_write.cc +++ b/tests/rocm_smi_test/functional/pci_read_write.cc @@ -87,7 +87,7 @@ void TestPciReadWrite::Close() { void TestPciReadWrite::Run(void) { rsmi_status_t ret; - rsmi_pcie_bandwidth bw; + rsmi_pcie_bandwidth_t bw; uint32_t freq_bitmask; uint64_t sent, received, max_pkt_sz; diff --git a/tests/rocm_smi_test/functional/perf_level_read.cc b/tests/rocm_smi_test/functional/perf_level_read.cc index 303bdd1592..4dfb78c54e 100755 --- a/tests/rocm_smi_test/functional/perf_level_read.cc +++ b/tests/rocm_smi_test/functional/perf_level_read.cc @@ -87,7 +87,7 @@ void TestPerfLevelRead::Close() { void TestPerfLevelRead::Run(void) { rsmi_status_t err; - rsmi_dev_perf_level pfl; + rsmi_dev_perf_level_t pfl; TestBase::Run(); diff --git a/tests/rocm_smi_test/functional/perf_level_read_write.cc b/tests/rocm_smi_test/functional/perf_level_read_write.cc index 8d3ca30016..d36b486103 100755 --- a/tests/rocm_smi_test/functional/perf_level_read_write.cc +++ b/tests/rocm_smi_test/functional/perf_level_read_write.cc @@ -54,7 +54,7 @@ #include "rocm_smi_test/functional/perf_level_read_write.h" #include "rocm_smi_test/test_common.h" -static const std::map kDevPerfLvlNameMap = { +static const std::map kDevPerfLvlNameMap = { {RSMI_DEV_PERF_LEVEL_AUTO, "RSMI_DEV_PERF_LEVEL_AUTO"}, {RSMI_DEV_PERF_LEVEL_LOW, "RSMI_DEV_PERF_LEVEL_LOW"}, {RSMI_DEV_PERF_LEVEL_HIGH, "RSMI_DEV_PERF_LEVEL_HIGH"}, @@ -102,7 +102,7 @@ void TestPerfLevelReadWrite::Close() { void TestPerfLevelReadWrite::Run(void) { rsmi_status_t ret; - rsmi_dev_perf_level pfl, orig_pfl; + rsmi_dev_perf_level_t pfl, orig_pfl; TestBase::Run(); @@ -125,11 +125,11 @@ void TestPerfLevelReadWrite::Run(void) { IF_VERB(STANDARD) { std::cout << "Set Performance Level to " << - kDevPerfLvlNameMap.at(static_cast(pfl_i)) << + kDevPerfLvlNameMap.at(static_cast(pfl_i)) << " ..." << std::endl; } ret = rsmi_dev_perf_level_set(dv_ind, - static_cast(pfl_i)); + static_cast(pfl_i)); CHK_ERR_ASRT(ret) ret = rsmi_dev_perf_level_get(dv_ind, &pfl); CHK_ERR_ASRT(ret) diff --git a/tests/rocm_smi_test/functional/power_read_write.cc b/tests/rocm_smi_test/functional/power_read_write.cc index cf29e8f069..32fbc32454 100755 --- a/tests/rocm_smi_test/functional/power_read_write.cc +++ b/tests/rocm_smi_test/functional/power_read_write.cc @@ -88,7 +88,7 @@ void TestPowerReadWrite::Close() { } static const char * -power_profile_string(rsmi_power_profile_preset_masks profile) { +power_profile_string(rsmi_power_profile_preset_masks_t profile) { switch (profile) { case RSMI_PWR_PROF_PRST_CUSTOM_MASK: return "CUSTOM"; @@ -111,7 +111,7 @@ power_profile_string(rsmi_power_profile_preset_masks profile) { void TestPowerReadWrite::Run(void) { rsmi_status_t ret; - rsmi_power_profile_status status; + rsmi_power_profile_status_t status; TestBase::Run(); @@ -127,7 +127,7 @@ void TestPowerReadWrite::Run(void) { while (tmp <= RSMI_PWR_PROF_PRST_LAST) { if ((tmp & status.available_profiles) == tmp) { std::cout << "\t" << - power_profile_string((rsmi_power_profile_preset_masks)tmp) << + power_profile_string((rsmi_power_profile_preset_masks_t)tmp) << std::endl; } tmp = tmp << 1; @@ -136,11 +136,11 @@ void TestPowerReadWrite::Run(void) { power_profile_string(status.current) << std::endl; } - rsmi_power_profile_preset_masks orig_profile = status.current; + rsmi_power_profile_preset_masks_t orig_profile = status.current; // Try setting the profile to a different power profile - rsmi_bit_field diff_profiles; - rsmi_power_profile_preset_masks new_prof; + rsmi_bit_field_t diff_profiles; + rsmi_power_profile_preset_masks_t new_prof; diff_profiles = status.available_profiles & (~status.current); if (diff_profiles & RSMI_PWR_PROF_PRST_COMPUTE_MASK) { @@ -162,7 +162,7 @@ void TestPowerReadWrite::Run(void) { ret = rsmi_dev_power_profile_set(dv_ind, 0, new_prof); CHK_ERR_ASRT(ret) - rsmi_dev_perf_level pfl; + rsmi_dev_perf_level_t pfl; ret = rsmi_dev_perf_level_get(dv_ind, &pfl); CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, RSMI_DEV_PERF_LEVEL_MANUAL); diff --git a/tests/rocm_smi_test/functional/sys_info_read.cc b/tests/rocm_smi_test/functional/sys_info_read.cc index e4047f9679..50bd97a0bf 100755 --- a/tests/rocm_smi_test/functional/sys_info_read.cc +++ b/tests/rocm_smi_test/functional/sys_info_read.cc @@ -89,7 +89,7 @@ void TestSysInfoRead::Run(void) { rsmi_status_t err; uint64_t val_ui64; char buffer[80]; - rsmi_version ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr}; + rsmi_version_t ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr}; TestBase::Run(); diff --git a/tests/rocm_smi_test/functional/temp_read.cc b/tests/rocm_smi_test/functional/temp_read.cc index f85baa101b..9f04a0deeb 100755 --- a/tests/rocm_smi_test/functional/temp_read.cc +++ b/tests/rocm_smi_test/functional/temp_read.cc @@ -94,7 +94,7 @@ void TestTempRead::Run(void) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { PrintDeviceHeader(i); - auto print_temp_metric = [&](rsmi_temperature_metric met, + auto print_temp_metric = [&](rsmi_temperature_metric_t met, std::string label) { err = rsmi_dev_temp_metric_get(i, 0, met, &val_i64); diff --git a/tests/rocm_smi_test/functional/version_read.cc b/tests/rocm_smi_test/functional/version_read.cc index 15e8eaa516..5e819a19bd 100755 --- a/tests/rocm_smi_test/functional/version_read.cc +++ b/tests/rocm_smi_test/functional/version_read.cc @@ -86,7 +86,7 @@ void TestVersionRead::Close() { void TestVersionRead::Run(void) { rsmi_status_t err; - rsmi_version ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr}; + rsmi_version_t ver = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, nullptr}; TestBase::Run(); diff --git a/tests/rocm_smi_test/functional/volt_freq_curv_read.cc b/tests/rocm_smi_test/functional/volt_freq_curv_read.cc index 0039158d7b..4f99880c2d 100755 --- a/tests/rocm_smi_test/functional/volt_freq_curv_read.cc +++ b/tests/rocm_smi_test/functional/volt_freq_curv_read.cc @@ -100,7 +100,7 @@ static void pt_rng_mV(std::string title, rsmi_range *r) { " mV" << std::endl; } -static void print_pnt(rsmi_od_vddc_point *pt) { +static void print_pnt(rsmi_od_vddc_point_t *pt) { std::cout << "\t\t** Frequency: " << pt->frequency/1000000 << "MHz" << std::endl; std::cout << "\t\t** Voltage: " << pt->voltage << "mV" << std::endl; @@ -113,7 +113,7 @@ static void pt_vddc_curve(rsmi_od_volt_curve *c) { } } -static void print_rsmi_od_volt_freq_data(rsmi_od_volt_freq_data *odv) { +static void print_rsmi_od_volt_freq_data_t(rsmi_od_volt_freq_data_t *odv) { assert(odv != nullptr); std::cout.setf(std::ios::dec, std::ios::basefield); @@ -131,13 +131,13 @@ static void print_rsmi_od_volt_freq_data(rsmi_od_volt_freq_data *odv) { odv->num_regions << std::endl; } -static void print_odv_region(rsmi_freq_volt_region *region) { +static void print_odv_region(rsmi_freq_volt_region_t *region) { pt_rng_Mhz("\t\tFrequency range:", ®ion->freq_range); pt_rng_mV("\t\tVoltage range:", ®ion->volt_range); } static void print_rsmi_od_volt_freq_regions(uint32_t num_regions, - rsmi_freq_volt_region *regions) { + rsmi_freq_volt_region_t *regions) { for (uint32_t i = 0; i < num_regions; ++i) { std::cout << "\tRegion " << i << ":" << std::endl; print_odv_region(®ions[i]); @@ -146,7 +146,7 @@ static void print_rsmi_od_volt_freq_regions(uint32_t num_regions, void TestVoltCurvRead::Run(void) { rsmi_status_t err; - rsmi_od_volt_freq_data odv; + rsmi_od_volt_freq_data_t odv; TestBase::Run(); @@ -167,11 +167,11 @@ void TestVoltCurvRead::Run(void) { if (err == RSMI_STATUS_SUCCESS) { std::cout << "\t**Frequency-voltage curve data:" << std::endl; - print_rsmi_od_volt_freq_data(&odv); + print_rsmi_od_volt_freq_data_t(&odv); - rsmi_freq_volt_region *regions; + rsmi_freq_volt_region_t *regions; uint32_t num_regions; - regions = new rsmi_freq_volt_region[odv.num_regions]; + regions = new rsmi_freq_volt_region_t[odv.num_regions]; ASSERT_TRUE(regions != nullptr); num_regions = odv.num_regions; diff --git a/tests/rocm_smi_test/test_common.cc b/tests/rocm_smi_test/test_common.cc index b662dc9c12..39a4ad7aa3 100755 --- a/tests/rocm_smi_test/test_common.cc +++ b/tests/rocm_smi_test/test_common.cc @@ -55,7 +55,7 @@ #include "rocm_smi_test/test_common.h" #include "rocm_smi/rocm_smi.h" -static const std::map kBlockNameMap = { +static const std::map kBlockNameMap = { {RSMI_GPU_BLOCK_UMC, "UMC"}, {RSMI_GPU_BLOCK_SDMA, "SDMA"}, {RSMI_GPU_BLOCK_GFX, "GFX"}, @@ -131,7 +131,7 @@ uint32_t ProcessCmdline(RSMITstGlobals* test, int arg_cnt, char** arg_list) { return 0; } -const char *GetBlockNameStr(rsmi_gpu_block id) { +const char *GetBlockNameStr(rsmi_gpu_block_t id) { return kBlockNameMap.at(id); } diff --git a/tests/rocm_smi_test/test_common.h b/tests/rocm_smi_test/test_common.h index 58368beb83..5228ff441c 100755 --- a/tests/rocm_smi_test/test_common.h +++ b/tests/rocm_smi_test/test_common.h @@ -61,7 +61,7 @@ struct RSMITstGlobals { uint32_t ProcessCmdline(RSMITstGlobals* test, int arg_cnt, char** arg_list); void PrintTestHeader(uint32_t dv_ind); -const char *GetBlockNameStr(rsmi_gpu_block id); +const char *GetBlockNameStr(rsmi_gpu_block_t id); #if ENABLE_SMI void DumpMonitorInfo(const TestBase *test);