Improved diagnostics when PME cannot run on GPUs
[alexxy/gromacs.git] / src / gromacs / ewald / tests / testhardwarecontexts.cpp
index b4486fc7caa3d467153ce6f1ea6a170b3d8f7771..5cbbcc311951ab6a4620288092dbdabd36c00943 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019, 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.
@@ -112,7 +112,8 @@ void PmeTestEnvironment::SetUp()
     hardwareContexts_.emplace_back(compat::make_unique<TestHardwareContext>(CodePath::CPU, "", nullptr));
 
     hardwareInfo_ = hardwareInit();
-    if (!pme_gpu_supports_build(*hardwareInfo_, nullptr))
+    if (!pme_gpu_supports_build(nullptr) ||
+        !pme_gpu_supports_hardware(*hardwareInfo_, nullptr))
     {
         // PME can only run on the CPU, so don't make any more test contexts.
         return;