Merge branch release-2019 into release-2020
[alexxy/gromacs.git] / src / gromacs / hardware / gpu_hw_info.h
index b13934a02da54d5619583cdf8c684144256dde22..a8b3144ee5b32f88c52a24a30d4e8eda8f7fb569 100644 (file)
 
 #include "gromacs/utility/basedefinitions.h"
 
-#if 0
-} /* fixes auto-indentation problems */
-#endif
-
 struct gmx_device_info_t;
 
-/* Possible results of the GPU detection/check.
+/*! \brief Possible results of the GPU detection/check.
  *
  * The egpuInsane value means that during the sanity checks an error
  * occurred that indicates malfunctioning of the device, driver, or
@@ -53,20 +49,36 @@ struct gmx_device_info_t;
  */
 typedef enum
 {
-    egpuCompatible = 0,  egpuNonexistent,  egpuIncompatible, egpuIncompatibleClusterSize, egpuInsane, egpuUnavailable, egpuNR
+    egpuCompatible = 0,
+    egpuNonexistent,
+    egpuIncompatible,
+    egpuIncompatibleClusterSize,
+    egpuInsane,
+    egpuUnavailable,
+    egpuNR
 } e_gpu_detect_res_t;
 
-/* Names of the GPU detection/check results */
-extern const char * const gpu_detect_res_str[egpuNR];
+/*! \brief Names of the GPU detection/check results
+ *
+ * \todo Make a proper class enumeration with helper string */
+extern const char* const gpu_detect_res_str[egpuNR];
 
-/* GPU device information -- includes either CUDA or OpenCL devices.
- * The gmx_hardware_detect module initializes it. */
+/*! \brief Information about GPU devices on this physical node.
+ *
+ * Includes either CUDA or OpenCL devices.  The gmx_hardware_detect
+ * module initializes it.
+ *
+ * \todo Use a std::vector */
 struct gmx_gpu_info_t
 {
-    gmx_bool                  bDetectGPUs;      /* Did we try to detect GPUs? */
-    int                       n_dev;            /* total number of GPU devices detected */
-    struct gmx_device_info_t *gpu_dev;          /* GPU devices detected in the system (per node) */
-    int                       n_dev_compatible; /* number of compatible GPUs */
+    //! Did we attempt GPU detection?
+    gmx_bool bDetectGPUs;
+    //! Total number of GPU devices detected on this physical node
+    int n_dev;
+    //! Information about each GPU device detected on this physical node
+    gmx_device_info_t* gpu_dev;
+    //! Number of GPU devices detected on this physical node that are compatible.
+    int n_dev_compatible;
 };
 
 #endif