~ubuntu-branches/ubuntu/trusty/khronos-opencl-man/trusty

« back to all changes in this revision

Viewing changes to clGetDeviceIDs.xml

  • Committer: Package Import Robot
  • Author(s): Mathieu Malaterre
  • Date: 2013-05-21 18:06:15 UTC
  • Revision ID: package-import@ubuntu.com-20130521180615-6e0s2n3pai95ip2f
Tags: upstream-1.0~svn21772
ImportĀ upstreamĀ versionĀ 1.0~svn21772

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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">
 
4
 
 
5
<refentry>
 
6
    <refentryinfo>
 
7
        <keywordset><keyword>clGetDeviceIDs</keyword></keywordset>
 
8
    </refentryinfo>
 
9
    <refmeta>
 
10
        <refentrytitle>clGetDeviceIDs</refentrytitle>
 
11
        <refmiscinfo>
 
12
            <copyright>
 
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>
 
23
            </copyright>
 
24
        </refmiscinfo>
 
25
        <manvolnum>3</manvolnum>
 
26
    </refmeta>
 
27
 
 
28
<!-- ================================ SYNOPSIS -->
 
29
 
 
30
  <refnamediv id="clGetDeviceIDs">
 
31
    <refname>clGetDeviceIDs</refname>
 
32
    <refpurpose>Obtain the list of devices available on a platform.</refpurpose>
 
33
    </refnamediv>
 
34
    <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
 
35
        <funcsynopsis>
 
36
            <funcprototype>
 
37
                <funcdef>
 
38
                    <link xlink:href="scalarDataTypes.html">cl_int</link>
 
39
                    <function>clGetDeviceIDs</function>
 
40
                </funcdef>
 
41
                <paramdef>
 
42
                    <link xlink:href="abstractDataTypes.html">cl_platform_id</link>
 
43
                    <parameter>platform</parameter>
 
44
                </paramdef>
 
45
                <paramdef>
 
46
                    <link xlink:href="enums.html#cl_device_type">cl_device_type</link>
 
47
                    <parameter>device_type</parameter>
 
48
                </paramdef>
 
49
                <paramdef>
 
50
                    <link xlink:href="scalarDataTypes.html">cl_uint</link>
 
51
                    <parameter>num_entries</parameter>
 
52
                </paramdef>
 
53
                <paramdef>
 
54
                    <link xlink:href="abstractDataTypes.html">cl_device_id</link>
 
55
                    <parameter>*devices</parameter>
 
56
                </paramdef>
 
57
                <paramdef>
 
58
                    <link xlink:href="scalarDataTypes.html">cl_uint</link>
 
59
                    <parameter>*num_devices</parameter>
 
60
                </paramdef>
 
61
           </funcprototype>
 
62
        </funcsynopsis>
 
63
    </refsynopsisdiv>
 
64
 
 
65
<!-- ================================ PARAMETERS -->
 
66
 
 
67
    <refsect1 id="parameters"><title>Parameters</title>
 
68
        <variablelist>
 
69
        <varlistentry>
 
70
            <term><varname>platform</varname></term>
 
71
            <listitem>
 
72
                <para>
 
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.
 
77
                </para>
 
78
            </listitem>
 
79
        </varlistentry>
 
80
 
 
81
 
 
82
        <varlistentry>
 
83
            <term><varname>device_type</varname></term>
 
84
            <listitem>
 
85
                <para>
 
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.
 
90
                </para>
 
91
 
 
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" />
 
95
                    <thead>
 
96
                        <row>
 
97
                            <entry>cl_device_type</entry> <entry>Description</entry>
 
98
                        </row>
 
99
                    </thead>
 
100
 
 
101
                    <tbody>
 
102
                        <row>
 
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.
 
106
                            </entry>
 
107
                        </row>
 
108
 
 
109
                        <row>
 
110
                            <entry><constant>CL_DEVICE_TYPE_GPU</constant></entry>
 
111
                            <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.
 
114
                            </entry>
 
115
                        </row>
 
116
 
 
117
                        <row>
 
118
                            <entry><constant>CL_DEVICE_TYPE_ACCELERATOR</constant></entry>
 
119
                            <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.
 
122
                            </entry>
 
123
                        </row>
 
124
 
 
125
                        <row>
 
126
                            <entry><constant>CL_DEVICE_TYPE_CUSTOM</constant></entry>
 
127
                            <entry>
 
128
                                Dedicated accelerators that do not support programs written in OpenCL C.
 
129
                            </entry>
 
130
                        </row>
 
131
 
 
132
                        <row>
 
133
                            <entry><constant>CL_DEVICE_TYPE_DEFAULT</constant></entry>
 
134
                            <entry>
 
135
                              The default OpenCL device in the system. The default device cannot
 
136
                              be a <constant>CL_DEVICE_TYPE_CUSTOM</constant> device.
 
137
                            </entry>
 
138
                        </row>
 
139
 
 
140
                        <row>
 
141
                            <entry><constant>CL_DEVICE_TYPE_ALL</constant></entry>
 
142
                            <entry>
 
143
                              All OpenCL devices available in the system except
 
144
                              <constant>CL_DEVICE_TYPE_CUSTOM</constant> devices.
 
145
                            </entry>
 
146
                        </row>
 
147
                    </tbody>
 
148
                </tgroup></informaltable>
 
149
            </listitem>
 
150
        </varlistentry>
 
151
 
 
152
<!-- ================================ END PARAMETER TABLE  -->
 
153
 
 
154
        <varlistentry>
 
155
            <term><varname>num_entries</varname></term>
 
156
            <listitem>
 
157
                <para>
 
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.
 
161
                </para>
 
162
            </listitem>
 
163
        </varlistentry>
 
164
 
 
165
        <varlistentry>
 
166
            <term><varname>devices</varname></term>
 
167
            <listitem>
 
168
                <para>
 
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>.
 
175
                </para>
 
176
            </listitem>
 
177
        </varlistentry>
 
178
 
 
179
        <varlistentry>
 
180
            <term><varname>num_devices</varname></term>
 
181
            <listitem>
 
182
                <para>
 
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.
 
185
                </para>
 
186
            </listitem>
 
187
        </varlistentry>
 
188
 
 
189
        </variablelist>
 
190
    </refsect1>
 
191
 
 
192
<!-- ================================ NOTES  -->
 
193
    <refsect1 id="notes"><title>Notes</title>
 
194
 
 
195
    <para>
 
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>.
 
198
    </para>
 
199
 
 
200
    </refsect1>
 
201
 
 
202
<!-- ================================ ERRORS  -->
 
203
 
 
204
    <refsect1 id="errors"><title>Errors</title>
 
205
        <para>
 
206
          <function>clGetDeviceIDs</function> returns <errorname>CL_SUCCESS</errorname> if the
 
207
          function is executed successfully. Otherwise it returns one of the following:
 
208
        </para>
 
209
 
 
210
        <itemizedlist mark="disc">
 
211
        <listitem>
 
212
            <errorname>CL_INVALID_PLATFORM</errorname> if <varname>platform</varname> is not
 
213
            a valid platform.
 
214
        </listitem>
 
215
 
 
216
        <listitem>
 
217
          <errorname>CL_INVALID_DEVICE_TYPE</errorname> if <varname>device_type</varname>
 
218
          is not a valid value.
 
219
        </listitem>
 
220
 
 
221
        <listitem>
 
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.
 
225
        </listitem>
 
226
 
 
227
        <listitem>
 
228
          <errorname>CL_DEVICE_NOT_FOUND</errorname> if no OpenCL devices that matched
 
229
          <varname>device_type</varname> were found.
 
230
        </listitem>
 
231
 
 
232
        <listitem>
 
233
          <errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate resources
 
234
          required by the OpenCL implementation on the device.
 
235
        </listitem>
 
236
 
 
237
        <listitem>
 
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.
 
240
        </listitem>
 
241
 
 
242
        </itemizedlist>
 
243
    </refsect1>
 
244
 
 
245
<!-- ================================ EXAMPLE  -->
 
246
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
 
247
<!--
 
248
    <refsect2 id="example1">
 
249
        <title>
 
250
            Example
 
251
        </title>
 
252
 
 
253
        <informaltable frame="none">
 
254
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
255
                <colspec colname="col1" colnum="1" />
 
256
                <tbody>
 
257
                    <row>
 
258
                        <entry>
 
259
                            Example goes here - it will be set in "code" type with white space preserved.
 
260
                        </entry>
 
261
                    </row>
 
262
                </tbody>
 
263
            </tgroup>
 
264
        </informaltable>
 
265
    </refsect2>
 
266
-->
 
267
 
 
268
<!-- ================================ SPECIFICATION  -->
 
269
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
270
-->
 
271
 
 
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>
 
275
        </para>
 
276
    </refsect1>
 
277
 
 
278
<!-- ================================ ALSO SEE  -->
 
279
 
 
280
    <refsect1 id="seealso"><title>Also see</title>
 
281
        <para>
 
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>
 
286
        </para>
 
287
    </refsect1>
 
288
 
 
289
<!-- ============================== COPYRIGHT -->
 
290
<!-- Content included from copyright.inc.xsl -->
 
291
 
 
292
    <refsect3 id="Copyright"><title></title>
 
293
        <imageobject>
 
294
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
295
        </imageobject>
 
296
        <para />
 
297
    </refsect3>
 
298
 
 
299
<!-- 20-Oct-2011 -->
 
300
</refentry>
 
301