CLGETDEVICEINFO(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

πŸ’– CLGETDEVICEINFO πŸ’–

okay bestie, welcome to the OpenCL Manual corner of the group chat, where today's main character is clGetDeviceInfo from section 3clc. she's the one you call when you wanna know literally everything about a device. nosy? maybe. iconic? absolutely. πŸŽ€

✨ NAME ✨

clGetDeviceInfo β€” get information about an OpenCL device. that's it, that's the whole job, and she does it flawlessly. πŸ’…

cl_int clGetDeviceInfo(cl_device_id device, cl_device_info param_name,
                       size_t param_value_size, void *param_value,
                       size_t *param_value_size_ret);

🌸 PARAMETERS 🌸

  • device β€” this can be a device that clGetDeviceIDs(3clc) handed you, or a sub-device you made with clCreateSubDevices(3clc). and here's the tea: if device is a sub-device, you get the specific info for that sub-device, not the parent. the info you're allowed to query with clGetDeviceInfo is all listed in the table below. πŸ‘‘
  • param_value β€” a pointer to the memory spot where the appropriate values for whatever param_name you asked for (again, per the table below) get dropped off. if param_value is NULL, it's just ignored. no harm, no foul. πŸ™ˆ
  • param_value_size β€” the size, in bytes, of the memory that param_value points at. this size in bytes must be β‰₯ size of return type specified in the table below. do not play with her, she checks. πŸ’€
  • param_value_size_ret β€” returns the actual size in bytes of the data being queried by param_value. if param_value_size_ret is NULL, it is ignored. yes she's optional, yes she's still serving. ✨
  • param_name β€” an enumeration constant that identifies which piece of device info is being queried. it can be one of the values specified in the table below. pick your fighter. 🌈

πŸ’œ NOTES πŸ’œ

CL_DEVICE_PROFILE: so the platform profile returns the profile implemented by the OpenCL framework. if the platform profile returned is FULL_PROFILE, the OpenCL framework will support devices that are FULL_PROFILE and may also support devices that are EMBEDDED_PROFILE. the compiler must be available for all devices, i.e. CL_DEVICE_COMPILER_AVAILABLE is CL_TRUE. if the platform profile returned is EMBEDDED_PROFILE, then devices that are only EMBEDDED_PROFILE are supported. periodt. 🫢

the device queries described in the table above should return the same information for a root-level device β€” i.e. a device returned by clGetDeviceIDs(3clc) β€” and any sub-devices created from this device, except for the following queries:

  • CL_DEVICE_GLOBAL_MEM_CACHE_SIZE.RE
    • CL_DEVICE_BUILT_IN_KERNELS.RE
      • CL_DEVICE_PARENT_DEVICE.RE
        • CL_DEVICE_PARTITION_TYPE.RE
          • CL_DEVICE_REFERENCE_COUNT.RE

(yes the nesting goes that deep. she's dramatic like that. πŸ’…)


πŸ”₯ ERRORS πŸ”₯

clGetDeviceInfo returns CL_SUCCESS if the function is executed successfully. otherwise, she returns the following:

  • CL_INVALID_DEVICE β€” if device is not valid. 🚫
  • CL_INVALID_VALUE β€” if param_name is not one of the supported values, or if the size in bytes specified by param_value_size is less than size of return type as shown in the table above and param_value is not a NULL value, or if param_name is a value that is available as an extension and the corresponding extension is not supported by the device.
  • CL_OUT_OF_RESOURCES β€” if there is a failure to allocate resources required by the OpenCL implementation on the device. 😭
  • CL_OUT_OF_HOST_MEMORY β€” if there is a failure to allocate resources required by the OpenCL implementation on the host. 😭😭
ngl, those last two are the "your computer said no" errors. respect them.

πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1]


πŸ‘€ SEE ALSO πŸ‘€

clGetDeviceIDs(3clc), cl_khr_fp64(3clc), constant(3clc), clCreateCommandQueue(3clc), clRetainCommandQueue(3clc), clEnqueueNDRangeKernel(3clc)


πŸ¦‹ AUTHORS πŸ¦‹

The Khronos Group


Copyright Β© 2007-2011 The Khronos Group Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.


⭐ NOTES ⭐

  1. OpenCL Specification page 37, section 4.2 - Querying Devices

okay that's the whole page, you ate that. πŸ’– big love to The Khronos Group for writing the original, and this version is dated 01/14/2021 β€” go forth and query your devices, bestie. slay. πŸ‘‘βœ¨

πŸ“¦ where this page comes from