Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / gpu_utils / gpu_utils.cpp
index d47abb3b176bb8aedadfbfa06d7680445969e414..51622063a7a967689ce8f4bf2d0e12d577fa45e1 100644 (file)
@@ -51,7 +51,7 @@
 #include "gromacs/utility/stringutil.h"
 
 #ifdef _MSC_VER
-#pragma warning(disable: 6237)
+#    pragma warning(disable : 6237)
 #endif
 
 //! Constant used to help minimize preprocessed code
@@ -59,8 +59,7 @@ static constexpr bool c_binarySupportsGpus = (GMX_GPU != GMX_GPU_NONE);
 
 bool canPerformGpuDetection()
 {
-    if (c_binarySupportsGpus &&
-        getenv("GMX_DISABLE_GPU_DETECTION") == nullptr)
+    if (c_binarySupportsGpus && getenv("GMX_DISABLE_GPU_DETECTION") == nullptr)
     {
         return isGpuDetectionFunctional(nullptr);
     }
@@ -71,18 +70,18 @@ bool canPerformGpuDetection()
 }
 
 #if GMX_GPU == GMX_GPU_NONE
-int gpu_info_get_stat(const gmx_gpu_info_t & /*unused*/, int /*unused*/)
+int gpu_info_get_stat(const gmx_gpu_info_t& /*unused*/, int /*unused*/)
 {
     return egpuNonexistent;
 }
 #endif
 
-void free_gpu_info(const gmx_gpu_info_t *gpu_info)
+void free_gpu_info(const gmx_gpu_info_tgpu_info)
 {
-    sfree(static_cast<void*>(gpu_info->gpu_dev)); //circumvent is_pod check in sfree
+    sfree(static_cast<void*>(gpu_info->gpu_dev)); // circumvent is_pod check in sfree
 }
 
-std::vector<int> getCompatibleGpus(const gmx_gpu_info_t &gpu_info)
+std::vector<int> getCompatibleGpus(const gmx_gpu_info_tgpu_info)
 {
     // Possible minor over-allocation here, but not important for anything
     std::vector<int> compatibleGpus;
@@ -98,31 +97,27 @@ std::vector<int> getCompatibleGpus(const gmx_gpu_info_t &gpu_info)
     return compatibleGpus;
 }
 
-const char *getGpuCompatibilityDescription(const gmx_gpu_info_t &gpu_info,
-                                           int                   index)
+const char* getGpuCompatibilityDescription(const gmx_gpu_info_t& gpu_info, int index)
 {
-    return (index >= gpu_info.n_dev ?
-            gpu_detect_res_str[egpuNonexistent] :
-            gpu_detect_res_str[gpu_info_get_stat(gpu_info, index)]);
+    return (index >= gpu_info.n_dev ? gpu_detect_res_str[egpuNonexistent]
+                                    : gpu_detect_res_str[gpu_info_get_stat(gpu_info, index)]);
 }
 /*! \brief Help build a descriptive message in \c error if there are
  * \c errorReasons why nonbondeds on a GPU are not supported.
  *
  * \returns Whether the lack of errorReasons indicate there is support. */
-static bool
-addMessageIfNotSupported(gmx::ArrayRef <const std::string> errorReasons,
-                         std::string                      *error)
+static bool addMessageIfNotSupported(gmx::ArrayRef<const std::string> errorReasons, std::string* error)
 {
     bool isSupported = errorReasons.empty();
     if (!isSupported && error)
     {
-        *error  = "Nonbonded interactions cannot run on GPUs: ";
+        *error = "Nonbonded interactions cannot run on GPUs: ";
         *error += joinStrings(errorReasons, "; ") + ".";
     }
     return isSupported;
 }
 
-bool buildSupportsNonbondedOnGpu(std::string *error)
+bool buildSupportsNonbondedOnGpu(std::stringerror)
 {
     std::vector<std::string> errorReasons;
     if (GMX_DOUBLE)