'\" t .\" Title: clGetDeviceIDs .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLGETDEVICEIDS" "3clc" "01/14/2021" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clGetDeviceIDs \- Obtain the list of devices available on a platform\&. .SH "" .HP \w'cl_int\ clGetDeviceIDs('u .BI "cl_int clGetDeviceIDs(cl_platform_id\ " "platform" ", cl_device_type\ " "device_type" ", cl_uint\ " "num_entries" ", cl_device_id\ *" "devices" ", cl_uint\ *" "num_devices" ");" .SH "PARAMETERS" .PP \fIplatform\fR .RS 4 Refers to the platform ID returned by \fBclGetPlatformIDs\fR(3clc) or can be NULL\&. If \fIplatform\fR is NULL, the behavior is implementation\-defined\&. .RE .PP \fIdevice_type\fR .RS 4 A bitfield that identifies the type of OpenCL device\&. The \fIdevice_type\fR can be used to query specific OpenCL devices or all OpenCL devices available\&. The valid values for \fIdevice_type\fR are specified in the following table\&. .TS allbox tab(:); lB lB. T{ cl_device_type T}:T{ Description T} .T& l l l l l l l l l l l l. T{ \fBCL_DEVICE_TYPE_CPU\fR T}:T{ An OpenCL device that is the host processor\&. The host processor runs the OpenCL implementations and is a single or multi\-core CPU\&. T} T{ \fBCL_DEVICE_TYPE_GPU\fR T}:T{ An OpenCL device that is a GPU\&. By this we mean that the device can also be used to accelerate a 3D API such as OpenGL or DirectX\&. T} T{ \fBCL_DEVICE_TYPE_ACCELERATOR\fR T}:T{ Dedicated OpenCL accelerators (for example the IBM CELL Blade)\&. These devices communicate with the host processor using a peripheral interconnect such as PCIe\&. T} T{ \fBCL_DEVICE_TYPE_CUSTOM\fR T}:T{ Dedicated accelerators that do not support programs written in OpenCL C\&. T} T{ \fBCL_DEVICE_TYPE_DEFAULT\fR T}:T{ The default OpenCL device in the system\&. The default device cannot be a \fBCL_DEVICE_TYPE_CUSTOM\fR device\&. T} T{ \fBCL_DEVICE_TYPE_ALL\fR T}:T{ All OpenCL devices available in the system except \fBCL_DEVICE_TYPE_CUSTOM\fR devices\&. T} .TE .sp 1 .RE .PP \fInum_entries\fR .RS 4 The number of \fBcl_device_id\fR entries that can be added to \fIdevices\fR\&. If \fIdevices\fR is not NULL, the \fInum_entries\fR must be greater than zero\&. .RE .PP \fIdevices\fR .RS 4 A list of OpenCL devices found\&. The \fBcl_device_id\fR values returned in \fIdevices\fR can be used to identify a specific OpenCL device\&. If \fIdevices\fR argument is NULL, this argument is ignored\&. The number of OpenCL devices returned is the mininum of the value specified by \fInum_entries\fR or the number of OpenCL devices whose type matches \fIdevice_type\fR\&. .RE .PP \fInum_devices\fR .RS 4 The number of OpenCL devices available that match \fIdevice_type\fR\&. If \fInum_devices\fR is NULL, this argument is ignored\&. .RE .SH "NOTES" .PP \fBclGetDeviceIDs\fR may return all or a subset of the actual physical devices present in the platform and that match \fIdevice_type\fR\&. .SH "ERRORS" .PP \fBclGetDeviceIDs\fR returns CL_SUCCESS if the function is executed successfully\&. Otherwise it returns one of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_PLATFORM if \fIplatform\fR is not a valid platform\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_DEVICE_TYPE if \fIdevice_type\fR is not a valid value\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fInum_entries\fR is equal to zero and \fIdevices\fR is not NULL or if both \fInum_devices\fR and \fIdevices\fR are NULL\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_DEVICE_NOT_FOUND if no OpenCL devices that matched \fIdevice_type\fR were found\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host\&. .RE .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclGetDeviceInfo\fR(3clc), \fBclGetPlatformIDs\fR(3clc), \fBclCreateContext\fR(3clc), \fBclassDiagram\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br 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. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 35, section 4.2 - Querying Devices .RE