Merge amd-staging into amd-master 20230317
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: Iad8075d8aae2e0577dd6a36ce789d4f07741a448
[ROCm/rocm_smi_lib commit: 74c96dbbff]
This commit is contained in:
@@ -148,6 +148,21 @@ add_subdirectory("oam")
|
||||
|
||||
option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorg with backward compatibility" ON)
|
||||
if(FILE_REORG_BACKWARD_COMPATIBILITY)
|
||||
# To enable/disable #error in wrapper header files
|
||||
if(NOT DEFINED ROCM_HEADER_WRAPPER_WERROR)
|
||||
if(DEFINED ENV{ROCM_HEADER_WRAPPER_WERROR})
|
||||
set(ROCM_HEADER_WRAPPER_WERROR "$ENV{ROCM_HEADER_WRAPPER_WERROR}"
|
||||
CACHE STRING "Header wrapper warnings as errors.")
|
||||
else()
|
||||
set(ROCM_HEADER_WRAPPER_WERROR "ON" CACHE STRING "Header wrapper warnings as errors.")
|
||||
endif()
|
||||
endif()
|
||||
if(ROCM_HEADER_WRAPPER_WERROR)
|
||||
set(deprecated_error 1)
|
||||
else()
|
||||
set(deprecated_error 0)
|
||||
endif()
|
||||
|
||||
include(rocm_smi-backward-compat.cmake)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ int main()
|
||||
|
||||
// amd_oam_ops.get_mapi_version(&version);
|
||||
if (!amd_oam_ops.discover_devices(&dev_cnt))
|
||||
printf("%d AMD devices are discovered\n", dev_cnt);
|
||||
printf("%u AMD devices are discovered\n", dev_cnt);
|
||||
if (!dev_cnt) {
|
||||
printf("No devices are found.\n");
|
||||
return amd_oam_ops.free();
|
||||
|
||||
@@ -250,7 +250,7 @@ int amdoam_get_sensors_info(uint32_t device_id, oam_sensor_type_t type,
|
||||
case OAM_SENSOR_TYPE_POWER:
|
||||
for (i = 0; i < num_sensors; i++) {
|
||||
snprintf(sensor_info[i].sensor_name, OAM_SENSOR_NAME_MAX,
|
||||
"POWER_SENSOR_%d", i+1);
|
||||
"POWER_SENSOR_%u", i+1);
|
||||
sensor_info[i].sensor_type = type;
|
||||
status = rsmi_dev_power_ave_get(device_id, i,
|
||||
reinterpret_cast<uint64_t*>(&sensor_info[i].value));
|
||||
@@ -262,7 +262,7 @@ int amdoam_get_sensors_info(uint32_t device_id, oam_sensor_type_t type,
|
||||
case OAM_SENSOR_TYPE_VOLTAGE:
|
||||
for (i = 0; i < num_sensors; i++) {
|
||||
snprintf(sensor_info[i].sensor_name, OAM_SENSOR_NAME_MAX,
|
||||
"VOLTAGE_SENSOR_%d", i);
|
||||
"VOLTAGE_SENSOR_%u", i);
|
||||
sensor_info[i].sensor_type = type;
|
||||
status = rsmi_dev_volt_metric_get(device_id, RSMI_VOLT_TYPE_VDDGFX,
|
||||
RSMI_VOLT_CURRENT, &sensor_info[i].value);
|
||||
@@ -274,7 +274,7 @@ int amdoam_get_sensors_info(uint32_t device_id, oam_sensor_type_t type,
|
||||
case OAM_SENSOR_TYPE_TEMP:
|
||||
for (i = 0; i < num_sensors; i++) {
|
||||
snprintf(sensor_info[i].sensor_name, OAM_SENSOR_NAME_MAX,
|
||||
"TEMP_SENSOR_%d", i+1);
|
||||
"TEMP_SENSOR_%u", i+1);
|
||||
sensor_info[i].sensor_type = type;
|
||||
status = rsmi_dev_temp_metric_get(device_id, i, RSMI_TEMP_CURRENT,
|
||||
&sensor_info[i].value);
|
||||
@@ -286,7 +286,7 @@ int amdoam_get_sensors_info(uint32_t device_id, oam_sensor_type_t type,
|
||||
case OAM_SENSOR_TYPE_FAN_SPEED:
|
||||
for (i = 0; i < num_sensors; i++) {
|
||||
snprintf(sensor_info[i].sensor_name, OAM_SENSOR_NAME_MAX,
|
||||
"FAN_SENSOR_%d", i+1);
|
||||
"FAN_SENSOR_%u", i+1);
|
||||
sensor_info[i].sensor_type = type;
|
||||
status = rsmi_dev_fan_speed_get(device_id, i, &sensor_info[i].value);
|
||||
if (status != RSMI_STATUS_SUCCESS)
|
||||
|
||||
@@ -62,11 +62,18 @@ function(create_header_template)
|
||||
#ifndef @include_guard@
|
||||
#define @include_guard@
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#ifndef ROCM_HEADER_WRAPPER_WERROR
|
||||
#define ROCM_HEADER_WRAPPER_WERROR @deprecated_error@
|
||||
#endif
|
||||
#if ROCM_HEADER_WRAPPER_WERROR /* ROCM_HEADER_WRAPPER_WERROR 1 */
|
||||
#error \"This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with @prefix_name@\"
|
||||
#else /* ROCM_HEADER_WRAPPER_WERROR 0 */
|
||||
#if defined(__GNUC__)
|
||||
#warning \"This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with @prefix_name@\"
|
||||
#else
|
||||
#pragma message(\"This file is deprecated. Use file from include path /opt/rocm-ver/include/ and prefix with @prefix_name@\")
|
||||
#endif
|
||||
#endif /* ROCM_HEADER_WRAPPER_WERROR */
|
||||
|
||||
@include_statements@
|
||||
|
||||
|
||||
Verwijs in nieuw issue
Block a user