Provide better defaults for GMX_GPU_NB_CLUSTER_SIZE with SYCL
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 13 Aug 2021 08:06:18 +0000 (08:06 +0000)
committerAndrey Alekseenko <al42and@gmail.com>
Fri, 13 Aug 2021 08:06:18 +0000 (08:06 +0000)
Now that we know whether a SYCL configuration targets hipSYCL and if
so for which hardware, we can provide a default non-bonded cluster
size that works well in all SYCL cases.

Refs #3965

CMakeLists.txt
src/gromacs/nbnxm/pairlistparams.h

index 344ac3428f109764d869afed37804f7aa4663d74..eb9fd66f4402016e1817a59e6bcd196cc9a10223 100644 (file)
@@ -579,8 +579,13 @@ if(GMX_GPU)
             # default cluster size is 8 with OpenCL and 4 with SYCL for now
             if(${_gmx_gpu_uppercase} STREQUAL "OPENCL")
                 set(_gmx_gpu_nb_cluster_size_value 8)
-            else()
-                set(_gmx_gpu_nb_cluster_size_value 4)
+            elseif(GMX_GPU_SYCL)
+                if (GMX_SYCL_HIPSYCL AND NOT GMX_HIPSYCL_HAVE_LEVELZERO_TARGET)
+                    set(_gmx_gpu_nb_cluster_size_value 8)
+                else()
+                    # Either DPCPP or hipSYCL targeting Intel Level0
+                    set(_gmx_gpu_nb_cluster_size_value 4)
+                endif()
             endif()
         endif()
         set(GMX_GPU_NB_CLUSTER_SIZE ${_gmx_gpu_nb_cluster_size_value} CACHE STRING "Cluster size used by the nonbonded kernel. Set to 4 for Intel GPUs.")
index a204a3eeda2a7652e8d71242be57a9b18922c030..e1df6bbfbda11ded100646920f2fd1ad4f70b993 100644 (file)
@@ -59,7 +59,7 @@ enum class KernelType;
 //! The i-cluster size for CPU kernels, always 4 atoms
 static constexpr int c_nbnxnCpuIClusterSize = 4;
 
-//! The i- and j-cluster size for GPU lists, 8 atoms for CUDA, set at compile time for OpenCL and SYCL
+//! The i- and j-cluster size for GPU lists, 8 atoms for CUDA, set at configure time for OpenCL and SYCL
 #if GMX_GPU_OPENCL || GMX_GPU_SYCL
 static constexpr int c_nbnxnGpuClusterSize = GMX_GPU_NB_CLUSTER_SIZE;
 #else