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

« back to all changes in this revision

Viewing changes to clCreateSampler.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>clCreateSampler</keyword>
 
9
        </keywordset>
 
10
    </refentryinfo>
 
11
 
 
12
    <refmeta>
 
13
        <refentrytitle>
 
14
            clCreateSampler
 
15
        </refentrytitle>
 
16
 
 
17
        <refmiscinfo>
 
18
            <copyright>
 
19
                <year>2007-2011</year>
 
20
                <holder>The Khronos Group Inc.
 
21
 Permission is hereby granted, free of charge, to any person obtaining a
 
22
copy of this software and/or associated documentation files (the
 
23
"Materials"), to deal in the Materials without restriction, including
 
24
without limitation the rights to use, copy, modify, merge, publish,
 
25
distribute, sublicense, and/or sell copies of the Materials, and to
 
26
permit persons to whom the Materials are furnished to do so, subject to
 
27
the condition that this copyright notice and permission notice shall be included
 
28
in all copies or substantial portions of the Materials.</holder>
 
29
            </copyright>
 
30
        </refmiscinfo>
 
31
        <manvolnum>3</manvolnum>
 
32
    </refmeta>
 
33
 
 
34
<!-- ================================ SYNOPSIS -->
 
35
 
 
36
    <refnamediv id="clCreateSampler">
 
37
        <refname>
 
38
            clCreateSampler
 
39
        </refname>
 
40
 
 
41
        <refpurpose>
 
42
            Creates a sampler object.
 
43
        </refpurpose>
 
44
    </refnamediv>
 
45
 
 
46
    <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
 
47
        <funcsynopsis>
 
48
            <funcprototype>
 
49
                <funcdef>
 
50
                    <link xlink:href="abstractDataTypes.html">cl_sampler</link> <function>clCreateSampler</function>
 
51
                </funcdef>
 
52
 
 
53
                <paramdef><link xlink:href="abstractDataTypes.html">cl_context</link><parameter>context</parameter></paramdef>
 
54
                <paramdef><link xlink:href="enums.html#cl_bool">cl_bool</link><parameter>normalized_coords</parameter></paramdef>
 
55
                <paramdef><link xlink:href="enums.html#cl_addressing_mode">cl_addressing_mode</link><parameter>addressing_mode</parameter></paramdef>
 
56
                <paramdef><link xlink:href="enums.html#cl_filter_mode">cl_filter_mode</link><parameter>filter_mode</parameter></paramdef>
 
57
                <paramdef><link xlink:href="scalarDataTypes.html">cl_int</link><parameter>*errcode_ret</parameter></paramdef>
 
58
 
 
59
            </funcprototype>
 
60
        </funcsynopsis>
 
61
    </refsynopsisdiv>
 
62
 
 
63
<!-- ================================ PARAMETERS -->
 
64
 
 
65
    <refsect1 id="parameters">
 
66
        <title>Parameters</title>
 
67
        <variablelist>
 
68
 
 
69
            <varlistentry>
 
70
                <term> <varname> context </varname> </term>
 
71
                <listitem>
 
72
                    <para> <!-- parameter description -->
 
73
                        Must be a valid OpenCL context.
 
74
                    </para>
 
75
               </listitem>
 
76
            </varlistentry>
 
77
 
 
78
            <varlistentry>
 
79
                <term> <varname> normalized_coords </varname> </term>
 
80
                <listitem>
 
81
                    <para> <!-- parameter description -->
 
82
                        Determines if the image coordinates specified are normalized (if
 
83
                        <varname>normalized_coords</varname> is <constant>CL_TRUE</constant>) or
 
84
                        not (if <varname>normalized_coords</varname> is <constant>CL_FALSE</constant>).
 
85
                    </para>
 
86
                </listitem>
 
87
            </varlistentry>
 
88
 
 
89
            <varlistentry>
 
90
                <term> <varname> addressing_mode </varname> </term>
 
91
                <listitem>
 
92
                    <para> <!-- parameter description -->
 
93
                        Specifies how out-of-range image coordinates are handled when reading from
 
94
                        an image. This can be set to <constant>CL_ADDRESS_MIRRORED_REPEAT</constant>,
 
95
                        <constant>CL_ADDRESS_REPEAT</constant>, <constant>CL_ADDRESS_CLAMP_TO_EDGE</constant>,
 
96
                        <constant>CL_ADDRESS_CLAMP</constant>, and <constant>CL_ADDRESS_NONE</constant>.
 
97
                    </para>
 
98
                </listitem>
 
99
            </varlistentry>
 
100
 
 
101
            <varlistentry>
 
102
                <term> <varname> filter_mode </varname> </term>
 
103
                <listitem>
 
104
                    <para> <!-- parameter description -->
 
105
                        Specifies the type of filter that must be applied when reading an image. This can be
 
106
                        <constant>CL_FILTER_NEAREST</constant> or <constant>CL_FILTER_LINEAR</constant>.
 
107
                    </para>
 
108
                </listitem>
 
109
            </varlistentry>
 
110
 
 
111
            <varlistentry>
 
112
                <term> <varname> errcode_ret </varname> </term>
 
113
                <listitem>
 
114
                    <para>
 
115
                      <!-- parameter description --> Returns an appropriate error code. If
 
116
                      <varname>errcode_ret</varname> is NULL, no error code is returned.
 
117
                    </para>
 
118
                </listitem>
 
119
            </varlistentry>
 
120
        </variablelist>
 
121
    </refsect1>
 
122
 
 
123
<!-- ================================ NOTES  -->
 
124
 
 
125
    <refsect1 id="notes"><title>Notes</title>
 
126
        <para>
 
127
          <!-- should this paragraph be replicated in other sampler-related pages? [core spec
 
128
          p. 126, section 5.5.1] --> A sampler object describes how to sample an image when the
 
129
          image is read in the kernel.  The built-in functions to read from an image in a kernel
 
130
          take a sampler as an argument.  The sampler arguments to the image read function can
 
131
          be sampler objects created using OpenCL functions and passed as argument values to
 
132
          the kernel or can be samplers declared inside a kernel. In this section we discuss
 
133
          how sampler objects are created using OpenCL functions.
 
134
        </para>
 
135
 
 
136
        <para>
 
137
            For more information about working with samplers, see
 
138
             <citerefentry><refentrytitle>sampler_t</refentrytitle></citerefentry>
 
139
        </para>
 
140
    </refsect1>
 
141
 
 
142
<!-- ================================ ERRORS  -->
 
143
 
 
144
    <refsect1 id="errors"><title>Errors</title>
 
145
        <para>
 
146
            Returns a valid non-zero sampler object and <varname>errcode_ret</varname> is set to
 
147
            <errorname>CL_SUCCESS</errorname> if the sampler object is created successfully.
 
148
            Otherwise, it returns a NULL value with one of the following error values returned in
 
149
            <varname>errcode_ret</varname>:
 
150
        </para>
 
151
 
 
152
        <itemizedlist mark="disc">
 
153
            <listitem>
 
154
                <errorname>CL_INVALID_CONTEXT</errorname> if <varname>context</varname>
 
155
                is not a valid context.
 
156
            </listitem>
 
157
 
 
158
            <listitem>
 
159
              <errorname>CL_INVALID_VALUE</errorname> if <varname>addressing_mode</varname>,
 
160
              <varname>filter_mode</varname>, or <varname>normalized_coords</varname> or a
 
161
              combination of these argument values are not valid.
 
162
            </listitem>
 
163
 
 
164
            <listitem>
 
165
              <errorname>CL_INVALID_OPERATION</errorname> if images are not
 
166
              supported by any device associated with <varname>context</varname>
 
167
              (i.e.  <errorname>CL_DEVICE_IMAGE_SUPPORT</errorname>
 
168
              specified in the table of OpenCL Device Queries for
 
169
              <citerefentry><refentrytitle>clGetDeviceInfo</refentrytitle></citerefentry>
 
170
              is <errorname>CL_FALSE</errorname>).
 
171
            </listitem>
 
172
 
 
173
            <listitem>
 
174
              <errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate
 
175
              resources required by the OpenCL implementation on the device.
 
176
            </listitem>
 
177
 
 
178
            <listitem>
 
179
              <errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
 
180
              resources required by the OpenCL implementation on the host.
 
181
            </listitem>
 
182
        </itemizedlist>
 
183
    </refsect1>
 
184
 
 
185
<!-- ================================ EXAMPLE  -->
 
186
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
 
187
<!--
 
188
    <refsect2 id="example1">
 
189
        <title>
 
190
            Example
 
191
        </title>
 
192
 
 
193
        <informaltable frame="none">
 
194
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
195
                <colspec colname="col1" colnum="1" />
 
196
                <tbody>
 
197
                    <row>
 
198
                        <entry>
 
199
                            Example goes here - it will be set in "code" type with white space preserved.
 
200
                        </entry>
 
201
                    </row>
 
202
                </tbody>
 
203
            </tgroup>
 
204
        </informaltable>
 
205
    </refsect2>
 
206
-->
 
207
 
 
208
<!-- ================================ SPECIFICATION  -->
 
209
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
210
-->
 
211
    <refsect1 id="specification"><title>Specification</title>
 
212
        <para>
 
213
            <imageobject>
 
214
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
215
            </imageobject>
 
216
 
 
217
            <olink uri="clCreateSampler">OpenCL Specification</olink>
 
218
        </para>
 
219
    </refsect1>
 
220
 
 
221
<!-- ================================ ALSO SEE  -->
 
222
 
 
223
    <refsect1 id="seealso"><title>Also see</title>
 
224
        <para>
 
225
            <citerefentry><refentrytitle>clRetainSampler</refentrytitle></citerefentry>,
 
226
            <citerefentry><refentrytitle>clReleaseSampler</refentrytitle></citerefentry>,
 
227
            <citerefentry><refentrytitle>clGetSamplerInfo</refentrytitle></citerefentry>,
 
228
            <citerefentry href="classDiagram"><refentrytitle>Cardinality Diagram</refentrytitle></citerefentry>
 
229
            <citerefentry><refentrytitle>sampler_t</refentrytitle></citerefentry>
 
230
        </para>
 
231
    </refsect1>
 
232
 
 
233
<!-- ================================ COPYRIGHT  -->
 
234
<!-- Content included from copyright.inc.xsl -->
 
235
 
 
236
    <refsect3 id="Copyright"><title></title>
 
237
        <imageobject>
 
238
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
239
        </imageobject>
 
240
        <para />
 
241
    </refsect3>
 
242
 
 
243
<!-- 21-Oct-2011 -->
 
244
</refentry>
 
245