CLGETDEVICEINFO(3clc)
π 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 thatclGetDeviceIDs(3clc)handed you, or a sub-device you made withclCreateSubDevices(3clc). and here's the tea: ifdeviceis a sub-device, you get the specific info for that sub-device, not the parent. the info you're allowed to query withclGetDeviceInfois all listed in the table below. πparam_valueβ a pointer to the memory spot where the appropriate values for whateverparam_nameyou asked for (again, per the table below) get dropped off. ifparam_valueisNULL, it's just ignored. no harm, no foul. πparam_value_sizeβ the size, in bytes, of the memory thatparam_valuepoints 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 byparam_value. ifparam_value_size_retisNULL, 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.RECL_DEVICE_BUILT_IN_KERNELS.RECL_DEVICE_PARENT_DEVICE.RECL_DEVICE_PARTITION_TYPE.RECL_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β ifdeviceis not valid. π«CL_INVALID_VALUEβ ifparam_nameis not one of the supported values, or if the size in bytes specified byparam_value_sizeis less than size of return type as shown in the table above andparam_valueis not aNULLvalue, or ifparam_nameis 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 π
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 β
- 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
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms