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">
8
<keyword>clGetContextInfo</keyword>
13
<refentrytitle>clGetContextInfo</refentrytitle>
17
<year>2007-2011</year>
18
<holder>The Khronos Group Inc.
19
Permission is hereby granted, free of charge, to any person obtaining a
20
copy of this software and/or associated documentation files (the
21
"Materials"), to deal in the Materials without restriction, including
22
without limitation the rights to use, copy, modify, merge, publish,
23
distribute, sublicense, and/or sell copies of the Materials, and to
24
permit persons to whom the Materials are furnished to do so, subject to
25
the condition that this copyright notice and permission notice shall be included
26
in all copies or substantial portions of the Materials.</holder>
29
<manvolnum>3</manvolnum>
32
<!-- ================================ SYNOPSIS -->
34
<refnamediv id="clGetDeviceIDs">
35
<refname>clGetContextInfo</refname>
38
Query information about a context.
42
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
46
<link xlink:href="scalarDataTypes.html">cl_int</link>
52
<link xlink:href="abstractDataTypes.html">cl_context</link>
53
<parameter>context</parameter>
56
<link xlink:href="enums.html#cl_context_info">cl_context_info</link>
57
<parameter>param_name</parameter>
60
<link xlink:href="scalarDataTypes.html">size_t</link>
61
<parameter>param_value_size</parameter>
64
<link xlink:href="scalarDataTypes.html">void</link>
65
<parameter>*param_value</parameter>
68
<link xlink:href="scalarDataTypes.html">size_t</link>
69
<parameter>*param_value_size_ret</parameter>
76
<!-- ================================ PARAMETERS -->
78
<refsect1 id="parameters">
79
<title>Parameters</title>
83
<term> <varname>context </varname> </term>
85
<para> <!-- parameter description -->
86
Specifies the OpenCL context being queried.
92
<term> <varname> param_name </varname> </term>
94
<para> <!-- parameter description -->
95
An enumeration constant that specifies the information to query.
96
The valid values for <varname>param_name</varname> are:
100
<informaltable frame="all">
101
<tgroup cols="3" align="left" colsep="1" rowsep="1">
102
<colspec colname="col1" colnum="1" />
103
<colspec colname="col2" colnum="2" />
104
<colspec colname="col3" colnum="3" />
107
<entry>cl_context_info</entry>
108
<entry>Return Type</entry>
109
<entry>Information returned in param_value</entry>
115
<entry><constant>CL_CONTEXT_REFERENCE_COUNT</constant></entry>
116
<entry>cl_uint</entry>
118
Return the <varname>context</varname> reference count. The reference
119
count returned should be considered immediately stale. It is
120
unsuitable for general use in applications. This feature is
121
provided for identifying memory leaks.
126
<entry><constant>CL_CONTEXT_NUM_DEVICES</constant></entry>
127
<entry>cl_uint</entry>
129
Return the number of devices in <varname>context</varname>.
134
<entry><constant>CL_CONTEXT_DEVICES</constant></entry>
135
<entry>cl_device_id[]</entry>
137
Return the list of devices in <varname>context</varname>.
142
<entry><constant>CL_CONTEXT_PROPERTIES</constant></entry>
146
Return the <varname>properties</varname> argument specified in
147
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry>
149
<citerefentry><refentrytitle>clCreateContextFromType</refentrytitle></citerefentry>.
150
<para>If the <varname>properties</varname> argument specified in
151
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry>
153
<citerefentry><refentrytitle>clCreateContextFromType</refentrytitle></citerefentry>
154
used to create <varname>context</varname> is not NULL,
155
the implementation must return the values specified in the
156
<varname>properties</varname> argument. </para>
157
<para> If the <varname>properties</varname> argument specified in
158
<citerefentry><refentrytitle>clCreateContext</refentrytitle></citerefentry>
160
<citerefentry><refentrytitle>clCreateContextFromType</refentrytitle></citerefentry>
161
used to create <varname>context</varname> is NULL, the implementation
162
may return either a <varname>param_value_size_ret</varname>
163
of 0, i.e. there is no context property value to be returned
164
or can return a context property value of 0 (where 0 is used
165
to terminate the context properties list) in the memory that
166
<varname>param_value</varname> points to. </para>
171
<!-- ext. spec p. 69, section 9.9.5 says this constant and the
172
description shown below is to be added to table 4.7, but
173
table 4.7 does not exist. We think it's supposed to say table 4.6,
174
which is associated with clGetContextInfo(). Ext spec p. 67
175
mentions this constant is to be added to the list of param_name
176
values for clGetContextInfo(), but does not provide a description
177
for the constant. -->
178
<entry><constant>CL_CONTEXT_D3D10_PREFER_-
179
SHARED_RESOURCES_KHR</constant></entry>
180
<entry>cl_bool</entry>
183
<citerefentry><refentrytitle>cl_khr_d3d10_sharing</refentrytitle></citerefentry>
184
extension is enabled, returns <errorname>CL_TRUE</errorname>
185
if Direct3D 10 resources created as shared by
186
setting <varname>MiscFlags</varname> to include
187
<constant>D3D10_RESOURCE_MISC_SHARED</constant> will perform faster
188
when shared with OpenCL, compared with resources which have not
189
set this flag. Otherwise returns <constant>CL_FALSE</constant>.
194
<!-- ext. spec p. 98, section 9.11.4; and p. 100, section 9.11.5. The
195
reference on p. 98 says the following constant is to be added
196
to param_name for clGetContextInfo(), but no description is provided
197
there. On p. 100, this constant and the description shown below are
198
to be added to table 4.7, but table 4.7 does not exist. We think
199
that's probably a typo and should refer to table 4.6. -->
200
<entry><constant>CL_CONTEXT_D3D11_PREFER_-
201
SHARED_RESOURCES_KHR</constant></entry>
202
<entry>cl_bool</entry>
204
If the cl_khr_d3d11_sharing extension is supported, Returns
205
<constant>CL_TRUE</constant> if Direct3D 11 resources created
206
as shared by setting <varname>MiscFlags</varname> to include
207
<constant>D3D11_RESOURCE_MISC_SHARED</constant> will perform faster
208
when shared with OpenCL, compared with resources which have not
209
set this flag. Otherwise returns <constant>CL_FALSE</constant>.
218
<!-- END PARAMETER TABLE -->
222
<varname> <!-- parameter name -->
228
<para> <!-- parameter description -->
229
A pointer to memory where the appropriate result being queried is returned.
230
If <varname>param_value</varname> is NULL, it is ignored.
237
<varname> <!-- parameter name -->
244
<!-- parameter description --> Specifies the size in bytes of memory
245
pointed to by <varname>param_value</varname>. This size must be greater
246
than or equal to the size of return type as described in the table above.
253
<varname> <!-- parameter name -->
260
<!-- parameter description --> Returns the actual size in bytes
261
of data being queried by <varname>param_value</varname>. If
262
<varname>param_value_size_ret</varname> is NULL, it is ignored.
269
<!-- ================================ NOTES -->
271
<!-- refsect1 id="notes"><title>Notes</title>
280
The application can query specific capabilities of the OpenCL device(s) returned by
281
<function>clGetDeviceIDs</function>. This can be used by the application to determine
282
which device(s) to use.
286
<!-- ================================ ERRORS -->
288
<refsect1 id="errors"><title>Errors</title>
290
Returns <errorname>CL_SUCCESS</errorname> if the function executed successfully,
291
or one of the errors below:
294
<itemizedlist mark="disc">
296
<errorname>CL_INVALID_CONTEXT</errorname> if <varname>context</varname>
297
is not a valid context.
301
<errorname>CL_INVALID_VALUE</errorname> if <varname>param_name</varname>
302
is not one of the supported values or if size in bytes specified by
303
<varname>param_value_size</varname> is < size of return type as specified in the
304
table above and <varname>param_value</varname> is not a <errorname>NULL</errorname>
309
<errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate
310
resources required by the OpenCL implementation on the device.
314
<errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
315
resources required by the OpenCL implementation on the host.
320
<!-- ================================ EXAMPLE -->
321
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
323
<refsect2 id="example1">
328
<informaltable frame="none">
329
<tgroup cols="1" align="left" colsep="0" rowsep="0">
330
<colspec colname="col1" colnum="1" />
334
Example goes here - it will be set in "code" type with white space preserved.
343
<!-- ================================ SPECIFICATION -->
344
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
346
<refsect1 id="specification"><title>Specification</title>
349
<imagedata fileref="pdficon_small1.gif" format="gif" />
352
<olink uri="clGetContextInfo">OpenCL Specification</olink>
356
<!-- ================================ ALSO SEE -->
358
<refsect1 id="seealso"><title>Also see</title>
361
<refentrytitle>clGetDeviceInfo</refentrytitle>
366
<!-- ================================ COPYRIGHT -->
367
<!-- Content included from copyright.inc.xsl -->
369
<refsect3 id="Copyright"><title></title>
371
<imagedata fileref="KhronosLogo.jpg" format="jpg" />