Merge branch release-2018
[alexxy/gromacs.git] / src / programs / mdrun / tests / pmetest.cpp
index 57ae23e152f422767b151c97c2ca13806a624c37..5a8cc48b38189c0a9bc01678327b392821001580 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -75,7 +75,9 @@ namespace test
 namespace
 {
 
-//! A basic PME runner
+/*! \brief A basic PME runner
+ *
+ * \todo Consider also using GpuTest class. */
 class PmeTest : public MdrunTestFixture
 {
     public:
@@ -90,16 +92,16 @@ bool PmeTest::s_hasCompatibleCudaGpus = false;
 void PmeTest::SetUpTestCase()
 {
     gmx_gpu_info_t gpuInfo {};
-    char           detection_error[STRLEN];
-    GMX_UNUSED_VALUE(detection_error); //TODO
     // It would be nicer to do this detection once and have mdrun
     // re-use it, but this is OK. Note that this also caters for when
     // there is no GPU support in the build.
+    //
+    // TODO report any error messages gracefully.
     if (GMX_GPU == GMX_GPU_CUDA &&
-        (detect_gpus(&gpuInfo, detection_error) >= 0) &&
-        gpuInfo.n_dev_compatible > 0)
+        canDetectGpus(nullptr))
     {
-        s_hasCompatibleCudaGpus = true;
+        findGpus(&gpuInfo);
+        s_hasCompatibleCudaGpus = (gpuInfo.n_dev_compatible > 0);
     }
     free_gpu_info(&gpuInfo);
 }