Remove hardcoded warp_size == 32 assumption from PME GPU
[alexxy/gromacs.git] / src / gromacs / gpu_utils / ocl_compiler.h
index c25e4d6c27143b8dd9d5ff20e12fe78c835a3347..54f0332fed6da121367ba820485466cd7953bca9 100644 (file)
@@ -53,6 +53,21 @@ namespace gmx
 namespace ocl
 {
 
+/*! \brief Get the warp size reported by device
+ *
+ *  This is platform implementation dependent and seems to only work on the Nvidia and AMD platforms!
+ *  Nvidia reports 32, AMD for GPU 64. Intel seems to report 16, but that is not correct,
+ *  as it execution width can be between 8-32 and it's picked per-kernel at compile-time.
+ *  Therefore, for Intel it should actually be queried separately for each kernel (Redmine #2520).
+ *
+ *  \param  context   Current OpenCL context
+ *  \param  deviceId OpenCL device with the context
+ *  \return cl_int value of the warp size
+ *
+ * \throws InternalError if an OpenCL error was encountered
+ */
+size_t getWarpSize(cl_context context, cl_device_id deviceId);
+
 /*! \brief Compile the specified kernel for the context and device.
  *
  * \param[out] fplog                 Open file pointer for log output