1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
7
<keywordset><keyword>clGetDeviceIDs</keyword></keywordset>
10
<refentrytitle>clGetDeviceIDs</refentrytitle>
13
<year>2007-2011</year>
14
<holder>The Khronos Group Inc.
15
Permission is hereby granted, free of charge, to any person obtaining a
16
copy of this software and/or associated documentation files (the
17
"Materials"), to deal in the Materials without restriction, including
18
without limitation the rights to use, copy, modify, merge, publish,
19
distribute, sublicense, and/or sell copies of the Materials, and to
20
permit persons to whom the Materials are furnished to do so, subject to
21
the condition that this copyright notice and permission notice shall be included
22
in all copies or substantial portions of the Materials.</holder>
25
<manvolnum>3</manvolnum>
28
<!-- ================================ SYNOPSIS -->
30
<refnamediv id="clGetDeviceIDs">
31
<refname>clGetDeviceIDs</refname>
32
<refpurpose>Obtain the list of devices available on a platform.</refpurpose>
34
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
38
<link xlink:href="scalarDataTypes.html">cl_int</link>
39
<function>clGetDeviceIDs</function>
42
<link xlink:href="abstractDataTypes.html">cl_platform_id</link>
43
<parameter>platform</parameter>
46
<link xlink:href="enums.html#cl_device_type">cl_device_type</link>
47
<parameter>device_type</parameter>
50
<link xlink:href="scalarDataTypes.html">cl_uint</link>
51
<parameter>num_entries</parameter>
54
<link xlink:href="abstractDataTypes.html">cl_device_id</link>
55
<parameter>*devices</parameter>
58
<link xlink:href="scalarDataTypes.html">cl_uint</link>
59
<parameter>*num_devices</parameter>
65
<!-- ================================ PARAMETERS -->
67
<refsect1 id="parameters"><title>Parameters</title>
70
<term><varname>platform</varname></term>
73
Refers to the platform ID returned by
74
<citerefentry><refentrytitle>clGetPlatformIDs</refentrytitle></citerefentry>
75
or can be NULL. If <varname>platform</varname> is NULL, the behavior is
76
implementation-defined.
83
<term><varname>device_type</varname></term>
86
A bitfield that identifies the type of OpenCL device. The
87
<varname>device_type</varname> can be used to query specific OpenCL devices or
88
all OpenCL devices available. The valid values for <varname>device_type</varname>
89
are specified in the following table.
92
<informaltable frame="all"><tgroup cols="2" align="left" colsep="1" rowsep="1">
93
<colspec colname="col1" colnum="1" />
94
<colspec colname="col2" colnum="2" />
97
<entry>cl_device_type</entry> <entry>Description</entry>
103
<entry><constant>CL_DEVICE_TYPE_CPU</constant></entry> <entry>
104
An OpenCL device that is the host processor. The host processor
105
runs the OpenCL implementations and is a single or multi-core CPU.
110
<entry><constant>CL_DEVICE_TYPE_GPU</constant></entry>
112
An OpenCL device that is a GPU. By this we mean that the device can also be used
113
to accelerate a 3D API such as OpenGL or DirectX.
118
<entry><constant>CL_DEVICE_TYPE_ACCELERATOR</constant></entry>
120
Dedicated OpenCL accelerators (for example the IBM CELL Blade). These devices
121
communicate with the host processor using a peripheral interconnect such as PCIe.
126
<entry><constant>CL_DEVICE_TYPE_CUSTOM</constant></entry>
128
Dedicated accelerators that do not support programs written in OpenCL C.
133
<entry><constant>CL_DEVICE_TYPE_DEFAULT</constant></entry>
135
The default OpenCL device in the system. The default device cannot
136
be a <constant>CL_DEVICE_TYPE_CUSTOM</constant> device.
141
<entry><constant>CL_DEVICE_TYPE_ALL</constant></entry>
143
All OpenCL devices available in the system except
144
<constant>CL_DEVICE_TYPE_CUSTOM</constant> devices.
148
</tgroup></informaltable>
152
<!-- ================================ END PARAMETER TABLE -->
155
<term><varname>num_entries</varname></term>
158
The number of <type>cl_device_id</type> entries that can be added to
159
<varname>devices</varname>. If <varname>devices</varname> is not NULL,
160
the <varname>num_entries</varname> must be greater than zero.
166
<term><varname>devices</varname></term>
169
A list of OpenCL devices found. The <type>cl_device_id</type> values returned in
170
<varname>devices</varname> can be used to identify a specific OpenCL device.
171
If <varname>devices</varname> argument is NULL, this argument is ignored.
172
The number of OpenCL devices returned is the mininum of the value specified
173
by <varname>num_entries</varname> or the number of OpenCL devices whose type
174
matches <varname>device_type</varname>.
180
<term><varname>num_devices</varname></term>
183
The number of OpenCL devices available that match <varname>device_type</varname>.
184
If <varname>num_devices</varname> is NULL, this argument is ignored.
192
<!-- ================================ NOTES -->
193
<refsect1 id="notes"><title>Notes</title>
196
<function>clGetDeviceIDs</function> may return all or a subset of the actual
197
physical devices present in the platform and that match <varname>device_type</varname>.
202
<!-- ================================ ERRORS -->
204
<refsect1 id="errors"><title>Errors</title>
206
<function>clGetDeviceIDs</function> returns <errorname>CL_SUCCESS</errorname> if the
207
function is executed successfully. Otherwise it returns one of the following:
210
<itemizedlist mark="disc">
212
<errorname>CL_INVALID_PLATFORM</errorname> if <varname>platform</varname> is not
217
<errorname>CL_INVALID_DEVICE_TYPE</errorname> if <varname>device_type</varname>
218
is not a valid value.
222
<errorname>CL_INVALID_VALUE</errorname> if <varname>num_entries</varname> is equal to
223
zero and <varname>devices</varname> is not NULL or if both <varname>num_devices</varname>
224
and <varname>devices</varname> are NULL.
228
<errorname>CL_DEVICE_NOT_FOUND</errorname> if no OpenCL devices that matched
229
<varname>device_type</varname> were found.
233
<errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate resources
234
required by the OpenCL implementation on the device.
238
<errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
239
resources required by the OpenCL implementation on the host.
245
<!-- ================================ EXAMPLE -->
246
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
248
<refsect2 id="example1">
253
<informaltable frame="none">
254
<tgroup cols="1" align="left" colsep="0" rowsep="0">
255
<colspec colname="col1" colnum="1" />
259
Example goes here - it will be set in "code" type with white space preserved.
268
<!-- ================================ SPECIFICATION -->
269
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
272
<refsect1 id="specification"><title>Specification</title>
273
<para><imageobject><imagedata fileref="pdficon_small1.gif" format="gif" /></imageobject>
274
<olink uri="clGetDeviceIDs">OpenCL Specification</olink>
278
<!-- ================================ ALSO SEE -->
280
<refsect1 id="seealso"><title>Also see</title>
282
<citerefentry><refentrytitle>clGetDeviceInfo</refentrytitle></citerefentry>,
283
<citerefentry><refentrytitle>clGetPlatformIDs</refentrytitle></citerefentry>,
284
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry>,
285
<citerefentry href="classDiagram"><refentrytitle>Cardinality Diagram</refentrytitle></citerefentry>
289
<!-- ============================== COPYRIGHT -->
290
<!-- Content included from copyright.inc.xsl -->
292
<refsect3 id="Copyright"><title></title>
294
<imagedata fileref="KhronosLogo.jpg" format="jpg" />