Recognize Intel GPU as compatible
[alexxy/gromacs.git] / src / gromacs / gpu_utils / gpu_utils_ocl.cpp
index 1936cc5937aad0f44131623a9eb37bd7e76433ae..68e74775cee0fa71fc8717d829f05601a1f03240 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "gmxpre.h"
 
+#include "config.h"
+
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -107,13 +109,15 @@ static int is_gmx_supported_gpu_id(gmx_device_info_t *ocl_gpu_device)
         return egpuCompatible;
     }
 
-    /* Only AMD and NVIDIA GPUs are supported for now */
+    /* Only AMD, Intel, and NVIDIA GPUs are supported for now */
     switch (ocl_gpu_device->vendor_e)
     {
         case OCL_VENDOR_NVIDIA:
             return egpuCompatible;
         case OCL_VENDOR_AMD:
             return runningOnCompatibleOSForAmd() ? egpuCompatible : egpuIncompatible;
+        case OCL_VENDOR_INTEL:
+            return GMX_OCL_NB_CLUSTER_SIZE == 4 ? egpuCompatible : egpuIncompatibleClusterSize;
         default:
             return egpuIncompatible;
     }
@@ -356,11 +360,10 @@ void get_gpu_device_info_string(char *s, const gmx_gpu_info_t &gpu_info, int ind
         return;
     }
 
-    gmx_device_info_t  *dinfo = &gpu_info.gpu_dev[index];
+    gmx_device_info_t *dinfo = &gpu_info.gpu_dev[index];
 
-    bool                bGpuExists =
-        dinfo->stat == egpuCompatible ||
-        dinfo->stat == egpuIncompatible;
+    bool               bGpuExists = (dinfo->stat != egpuNonexistent &&
+                                     dinfo->stat != egpuInsane);
 
     if (!bGpuExists)
     {