Move DeviceInfo into GPU traits
[alexxy/gromacs.git] / src / gromacs / gpu_utils / gputraits_ocl.h
index c4a421f3a9fa001e02944995cad377ab714493a2..00d9cba90d95de2b2e52a8b5055aeea07ed2d371 100644 (file)
@@ -55,6 +55,28 @@ enum class DeviceVendor : int
     Count   = 4
 };
 
+/*! \internal
+ * \brief OpenCL device information.
+ *
+ * The OpenCL device information is queried and set at detection and contains
+ * both information about the device/hardware returned by the runtime as well
+ * as additional data like support status.
+ */
+struct DeviceInformation
+{
+    cl_platform_id oclPlatformId;       //!< OpenCL Platform ID.
+    cl_device_id   oclDeviceId;         //!< OpenCL Device ID.
+    char           device_name[256];    //!< Device name.
+    char           device_version[256]; //!< Device version.
+    char           vendorName[256];     //!< Device vendor name.
+    int            compute_units;       //!< Number of compute units.
+    int            adress_bits;         //!< Number of address bits the device is capable of.
+    int            stat;                //!< Device status takes values of e_gpu_detect_res_t.
+    DeviceVendor   deviceVendor;        //!< Device vendor.
+    size_t         maxWorkItemSizes[3]; //!< Workgroup size limits (CL_DEVICE_MAX_WORK_ITEM_SIZES).
+    size_t maxWorkGroupSize; //!< Workgroup total size limit (CL_DEVICE_MAX_WORK_GROUP_SIZE).
+};
+
 //! \brief GPU command stream
 using CommandStream = cl_command_queue;
 //! \brief Single GPU call timing event