#include "gromacs/utility/stringutil.h"
#ifdef _MSC_VER
-#pragma warning(disable: 6237)
+# pragma warning(disable : 6237)
#endif
//! Constant used to help minimize preprocessed code
bool canPerformGpuDetection()
{
- if (c_binarySupportsGpus &&
- getenv("GMX_DISABLE_GPU_DETECTION") == nullptr)
+ if (c_binarySupportsGpus && getenv("GMX_DISABLE_GPU_DETECTION") == nullptr)
{
return isGpuDetectionFunctional(nullptr);
}
}
#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_t* gpu_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_t& gpu_info)
{
// Possible minor over-allocation here, but not important for anything
std::vector<int> compatibleGpus;
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::string* error)
{
std::vector<std::string> errorReasons;
if (GMX_DOUBLE)