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

« back to all changes in this revision

Viewing changes to clGetExtensionFunctionAddressForPlatform.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>
 
8
            <keyword>clGetExtensionFunctionAddressForPlatform</keyword>
 
9
        </keywordset>
 
10
    </refentryinfo>
 
11
 
 
12
    <refmeta>
 
13
        <refentrytitle>clGetExtensionFunctionAddressForPlatform</refentrytitle>
 
14
 
 
15
        <refmiscinfo>
 
16
            <copyright>
 
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>
 
27
            </copyright>
 
28
        </refmiscinfo>
 
29
        <manvolnum>3</manvolnum>
 
30
    </refmeta>
 
31
 
 
32
<!-- ================================ SYNOPSIS -->
 
33
 
 
34
    <refnamediv id="clGetExtensionFunctionAddressForPlatform">
 
35
        <refname>clGetExtensionFunctionAddressForPlatform</refname>
 
36
 
 
37
        <refpurpose>
 
38
            Returns the address of the extension function named by
 
39
            <varname>funcname</varname> for a given <varname>platform</varname>.
 
40
        </refpurpose>
 
41
    </refnamediv>
 
42
 
 
43
    <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
 
44
        <funcsynopsis>
 
45
            <funcprototype>
 
46
                <funcdef>
 
47
                   <link xlink:href="scalarDataTypes.html">void*</link>
 
48
                    <function>
 
49
                        clGetExtensionFunctionAddressForPlatform
 
50
                    </function>
 
51
                </funcdef>
 
52
 
 
53
                <paramdef>
 
54
                    <link xlink:href="abstractDataTypes.html">cl_platform_id</link>
 
55
                    <parameter>platform</parameter>
 
56
                </paramdef>
 
57
 
 
58
                <paramdef>const
 
59
                    <link xlink:href="scalarDataTypes.html">char</link>
 
60
                    <parameter>*funcname</parameter>
 
61
               </paramdef>
 
62
            </funcprototype>
 
63
        </funcsynopsis>
 
64
    </refsynopsisdiv>
 
65
 
 
66
<!-- ================================ PARAMETERS -->
 
67
 
 
68
    <refsect1 id="parameters">
 
69
        <title>Parameters</title>
 
70
        <variablelist>
 
71
            <varlistentry>
 
72
                <term> <varname> funcname </varname> </term>
 
73
                <listitem>
 
74
                    <para> <!-- parameter description -->
 
75
                        Name of an extension function.
 
76
                    </para>
 
77
               </listitem>
 
78
            </varlistentry>
 
79
        </variablelist>
 
80
    </refsect1>
 
81
 
 
82
<!-- ================================ DESCRIPTION  -->
 
83
 
 
84
    <refsect1 id="description"><title>Description</title>
 
85
        <para>
 
86
          The function <function>clGetExtensionFunctionAddressForPlatform</function> returns
 
87
          the address of the extension function named by <varname>funcname</varname> for a
 
88
          given <varname>platform</varname>. The pointer returned should be cast to a function
 
89
          pointer type matching the extension function's definition defined in the appropriate
 
90
          extension specification and header file.
 
91
        </para>
 
92
 
 
93
        <para>
 
94
          A return value of NULL indicates that the specified function does not exist for the
 
95
          implementation or <varname>platform</varname> is not a valid platform.  A non-NULL
 
96
          return value for <function>clGetExtensionFunctionAddressForPlatform</function>
 
97
          does not guarantee that an extension function is actually supported by
 
98
          the platform. The application must also make a corresponding query using
 
99
          <citerefentry><refentrytitle>clGetPlatformInfo</refentrytitle></citerefentry>
 
100
          (platform, <constant>CL_PLATFORM_EXTENSIONS</constant>, ... ) or
 
101
          <citerefentry><refentrytitle>clGetDeviceInfo</refentrytitle></citerefentry>
 
102
          (device,<constant>CL_DEVICE_EXTENSIONS</constant>, ... ) to determine if an extension
 
103
          is supported by the OpenCL implementation.
 
104
        </para>
 
105
 
 
106
        <para>
 
107
          <function>clGetExtensionFunctionAddressForPlatform</function> may not be queried
 
108
          for core (non-extension) functions in OpenCL. For functions that are queryable with
 
109
          <function>clGetExtensionFunctionAddressForPlatform</function>, implementations may
 
110
          choose to also export those functions statically from the object libraries implementing
 
111
          those functions. However, portable applications cannot rely on this behavior.
 
112
        </para>
 
113
 
 
114
        <para>
 
115
          Function pointer typedefs must be declared for all extensions that add API entrypoints.
 
116
          These typedefs are a required part of the extension interface, to be provided in
 
117
          an appropriate header (such as <code>cl_ext.h</code> if the extension is an OpenCL
 
118
          extension, or <code>cl_gl_ext.h</code> if the extension is an OpenCL/OpenGL sharing
 
119
          extension).
 
120
        </para>
 
121
    </refsect1>
 
122
 
 
123
<!-- ================================ NOTES  -->
 
124
 
 
125
    <refsect1 id="notes"><title>Notes</title>
 
126
        <para>
 
127
          Since there is no way to qualify the query with a device, the function pointer
 
128
          returned must work for all implementations of that extension on different devices
 
129
          for a platform. The behavior of calling a device extension function on a device not
 
130
          supporting that extension is undefined.
 
131
        </para>
 
132
    </refsect1>
 
133
 
 
134
<!-- ================================ EXAMPLE  -->
 
135
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
 
136
 
 
137
    <refsect2 id="example1">
 
138
        <title>
 
139
            Example
 
140
        </title>
 
141
 
 
142
        <para>
 
143
          The following convention must be followed for all extensions affecting the host API,
 
144
          where TAG can be <constant>KHR</constant>, <constant>EXT</constant> or vendor-specific:
 
145
        </para>
 
146
 
 
147
        <informaltable frame="none">
 
148
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
149
                <colspec colname="col1" colnum="1" /> <tbody>
 
150
                    <row>
 
151
                        <entry>#ifndef extension_name
 
152
#define extension_name       1
 
153
 
 
154
// all data typedefs, token #defines, prototypes, and
 
155
// function pointer typedefs for this extension
 
156
 
 
157
// function pointer typedefs must use the
 
158
// following naming convention
 
159
typedef CL_API_ENTRY return type
 
160
      (CL_API_CALL *clextension_func_nameTAG_fn)(...);
 
161
 
 
162
#endif // extension_name
 
163
                        </entry>
 
164
                    </row>
 
165
                </tbody>
 
166
            </tgroup>
 
167
        </informaltable>
 
168
 
 
169
<para>
 
170
Consider, for example, the <citerefentry><refentrytitle>cl_khr_gl_sharing</refentrytitle></citerefentry> extension.
 
171
This extension would add the following to <code>cl_gl_ext</code>.h::
 
172
</para>
 
173
        <informaltable frame="none">
 
174
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
175
                <colspec colname="col1" colnum="1" />
 
176
                <tbody>
 
177
                    <row>
 
178
                        <entry>#ifndef cl_khr_gl_sharing
 
179
#define cl_khr_gl_sharing     1
 
180
 
 
181
// all data typedefs, token #defines, prototypes, and
 
182
// function pointer typedefs for this extension
 
183
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
 
184
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR   0x2006
 
185
#define CL_DEVICES_FOR_GL_CONTEXT_KHR          0x2007
 
186
#define CL_GL_CONTEXT_KHR                      0x2008
 
187
#define CL_EGL_DISPLAY_KHR                     0x2009
 
188
#define CL_GLX_DISPLAY_KHR                     0x200A
 
189
#define CL_WGL_HDC_KHR                         0x200B
 
190
#define CL_CGL_SHAREGROUP_KHR                  0x200C
 
191
 
 
192
// function pointer typedefs must use the
 
193
// following naming convention
 
194
typedef CL_API_ENTRY cl_int
 
195
     (CL_API_CALL *clGetGLContextInfoKHR_fn)(
 
196
              const cl_context_properties * /* properties */,
 
197
              cl_gl_context_info /* param_name */,
 
198
              size_t /* param_value_size */,
 
199
              void * /* param_value */,
 
200
              size_t * /*param_value_size_ret*/);
 
201
#endif // cl_khr_gl_sharing
 
202
                        </entry>
 
203
                    </row>
 
204
                </tbody>
 
205
            </tgroup>
 
206
        </informaltable>
 
207
    </refsect2>
 
208
 
 
209
<!-- ================================ SPECIFICATION  -->
 
210
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
211
-->
 
212
    <refsect1 id="specification"><title>Specification</title>
 
213
        <para>
 
214
            <imageobject>
 
215
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
216
            </imageobject>
 
217
 
 
218
            <olink uri="clGetExtensionFunctionAddressForPlatform">OpenCL Specification</olink>
 
219
        </para>
 
220
    </refsect1>
 
221
 
 
222
<!-- ================================ ALSO SEE  -->
 
223
 
 
224
    <refsect1 id="seealso"><title>Also see</title>
 
225
        <para>
 
226
            <citerefentry><refentrytitle>EXTENSION</refentrytitle></citerefentry>
 
227
        </para>
 
228
    </refsect1>
 
229
 
 
230
<!-- ============================== COPYRIGHT -->
 
231
<!-- Content included from copyright.inc.xsl -->
 
232
 
 
233
    <refsect3 id="Copyright"><title></title>
 
234
        <imageobject>
 
235
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
236
        </imageobject>
 
237
        <para />
 
238
    </refsect3>
 
239
 
 
240
<!-- 19-Oct-2011 -->
 
241
</refentry>
 
242