OpenCL Context Info in Utility

This patch returns labelled indices of the available OpenCL compute devices on the system.

This patch can be used together with the OpenCL Device Info patch to adjust the execution of OpenCL kernels to the machines they are run on.

For instance, one can detect if multiple compute GPUs are available and load balance OpenCL kernel execution accordingly or detect if only the CPU is available.

Input Attributes
  • Devices - Labelled indices of the available compute devices.
Output Attributes
  • Device Count - Number of available compute devices.
  • Device Type - The OpenCL device type. Currently supported values are: CL_DEVICE_TYPE_CPU, CL_DEVICE_TYPE_GPU.
  • Name - Device name string.
  • Vendor - Vendor name string.
  • Version - Device version string in the form major_number.minor_number.
  • Max Compute Units - The number of parallel compute cores on the compute device. The minimum value is one. .
  • Max Work Item Dimensions - Maximum dimensions that specify the global and local work-item IDs used by the data-parallel execution model. The minimum value is 3.
  • Max Work Group Size - Maximum number of work-items in a work-group executing a kernel using the data-parallel execution model.
  • Max Read Image Args - Max number of simultaneous image objects that can be read by a kernel. The minimum value is 128 if the supported list of image formats > zero.
  • Max Write Image Args - Max number of simultaneous image objects that can be written to by a kernel. The minimum value is 8 if the supported list of image formats > zero.
  • Max Samplers - Maximum number of samplers that can be used in a kernel. Refer to section 6.11.8 for a detailed description on samplers. The minimum value is 16.
  • Max Constant Args - Max number of arguments declared with the __constant qualifer in a kernel. The minimum value is 8.
  • Max Constant Buffer Size - Max size in bytes of a constant buffer allocation. The minimum value is 64 KB.
  • Global Mem Size - Size of global device memory in bytes.
  • Local Mem Size - Size of local memory arena in bytes. The minimum value is 16 KB.
  • Image2D Max Width - Max width of 2D image in pixels. The minimum value is 8192.
  • Image2D Max Height - Max height of 2D image in pixels. The minimum value is 8192.
0 videos
0 comments
Bf9a01b6ccc05dea53134f59ff712fee