From ddd52360dd79c2ae09e58eeda3c2f8c9c115175d Mon Sep 17 00:00:00 2001 From: Chris Freehill Date: Mon, 13 May 2019 18:00:12 -0500 Subject: [PATCH] Correct return code of isAMDGpu() Also, correct some comments, whitespace. [ROCm/amdsmi commit: 53489c1f3d6b3c5edc94389645e2df324dbb0299] --- projects/amdsmi/include/rocm_smi/rocm_smi.h | 7 ++++++- projects/amdsmi/src/rocm_smi_main.cc | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/amdsmi/include/rocm_smi/rocm_smi.h b/projects/amdsmi/include/rocm_smi/rocm_smi.h index d36c67f9dd..4336a76d29 100755 --- a/projects/amdsmi/include/rocm_smi/rocm_smi.h +++ b/projects/amdsmi/include/rocm_smi/rocm_smi.h @@ -50,7 +50,6 @@ extern "C" { #include #endif // __cplusplus -#include #include /** \file rocm_smi.h @@ -113,6 +112,12 @@ typedef enum { RSMI_STATUS_UNKNOWN_ERROR = 0xFFFFFFFF, //!< An unknown error occurred } rsmi_status_t; +/** + * @brief Initialization flags + * + * Initialization flags may be OR'd together and passed to ::rsmi_init(). + */ + typedef enum { RSMI_INIT_FLAG_ALL_GPUS = 0x1, //!< Attempt to add all GPUs found //!< (including non-AMD) to the list diff --git a/projects/amdsmi/src/rocm_smi_main.cc b/projects/amdsmi/src/rocm_smi_main.cc index 2a2518a0a4..901d392b08 100755 --- a/projects/amdsmi/src/rocm_smi_main.cc +++ b/projects/amdsmi/src/rocm_smi_main.cc @@ -348,7 +348,7 @@ static bool isAMDGPU(std::string dev_path) { fs.open(vend_path); if (!fs.is_open()) { - return errno; + return false; } uint32_t vendor_id;