clGetDeviceInfo - Get information about an OpenCL device.
Contents
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.
Errors
clGetDeviceInfo returns CL_SUCCESS if the function is executed successfully. Otherwise, it 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 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.
Name
clGetDeviceInfo - Get information about an OpenCL device.
cl_intclGetDeviceInfo(cl_device_iddevice,cl_device_infoparam_name,size_tparam_value_size,void*param_value,size_t*param_value_size_ret);Notes
1. OpenCL Specification
page 37, section 4.2 - Querying Devices
The Khronos Group 11/18/2024 CLGETDEVICEINFO(3clc)
Parameters
device
May be a device returned by clGetDeviceIDs(3clc) or a sub-device created by clCreateSubDevices(3clc).
If device is a sub-device, the specific information for the sub-device will be returned. The
information that can be queried using clGetDeviceInfo is specified in the table below.
param_value
A pointer to memory location where appropriate values for a given param_name as specified in the
table below will be returned. If param_value is NULL, it is ignored.
param_value_size
Specifies the size in bytes of memory pointed to by param_value. This size in bytes must be ≥ size of
return type specified in the table below.
param_value_size_ret
Returns the actual size in bytes of data being queried by param_value. If param_value_size_ret is
NULL, it is ignored.
param_name
An enumeration constant that identifies the device information being queried. It can be one of the
values as specified in the table below.
See Also
clGetDeviceIDs(3clc), cl_khr_fp64(3clc), constant(3clc), clCreateCommandQueue(3clc), clRetainCommandQueue(3clc), clEnqueueNDRangeKernel(3clc)
Specification
OpenCLSpecification[1]
