Implemented LJ-PME nbnxn kernels
[alexxy/gromacs.git] / src / programs / mdrun / runner.c
index cf51f5c375bc8dbe5cc29ae291c409b349a764bd..57792ae2a7df34f2c7bd45c6b6e0d30cba663207 100644 (file)
@@ -1148,10 +1148,19 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
             bUseGPU = (hwinfo->gpu_info.ncuda_dev_compatible > 0 ||
                        getenv("GMX_EMULATE_GPU") != NULL);
 
-            if (bUseGPU && (inputrec->vdw_modifier == eintmodFORCESWITCH ||
-                            inputrec->vdw_modifier == eintmodPOTSWITCH))
+            /* TODO add GPU kernels for this and replace this check by:
+             * (bUseGPU && (ir->vdwtype == evdwPME &&
+             *               ir->ljpme_combination_rule == eljpmeLB))
+             * update the message text and the content of nbnxn_acceleration_supported.
+             */
+            if (bUseGPU &&
+                !nbnxn_acceleration_supported(fplog, cr, inputrec, bUseGPU))
             {
-                md_print_warn(cr, fplog, "LJ switch functions are not yet supported on the GPU, falling back to CPU-only");
+                /* Fallback message printed by nbnxn_acceleration_supported */
+                if (bForceUseGPU)
+                {
+                    gmx_fatal(FARGS, "GPU acceleration requested, but not supported with the given input settings");
+                }
                 bUseGPU = FALSE;
             }