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

« back to all changes in this revision

Viewing changes to clEnqueueFillBuffer.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>clEnqueueFillBuffer</keyword>
 
9
        </keywordset>
 
10
    </refentryinfo>
 
11
 
 
12
    <refmeta>
 
13
        <refentrytitle>
 
14
            clEnqueueFillBuffer
 
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="clEnqueueFillBuffer">
 
37
        <refname>
 
38
            clEnqueueFillBuffer
 
39
        </refname>
 
40
 
 
41
        <refpurpose>
 
42
            Enqueues a command to fill a buffer object with a pattern of a given pattern size.
 
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="scalarDataTypes.html">cl_int</link>
 
51
                    <function>clEnqueueFillBuffer</function>
 
52
                </funcdef>
 
53
                    <paramdef>
 
54
                        <link xlink:href="abstractDataTypes.html">cl_command_queue</link>
 
55
                        <parameter>command_queue</parameter>
 
56
                    </paramdef>
 
57
                    <paramdef>
 
58
                        <link xlink:href="abstractDataTypes.html">cl_mem</link>
 
59
                        <parameter>buffer</parameter>
 
60
                    </paramdef>
 
61
                    <paramdef>const
 
62
                        <link xlink:href="scalarDataTypes.html">void</link>
 
63
                        <parameter>*pattern</parameter>
 
64
                    </paramdef>
 
65
                    <paramdef>
 
66
                        <link xlink:href="scalarDataTypes.html">size_t</link>
 
67
                        <parameter>pattern_size</parameter>
 
68
                    </paramdef>
 
69
                    <paramdef>
 
70
                        <link xlink:href="scalarDataTypes.html">size_t</link>
 
71
                        <parameter>offset</parameter>
 
72
                    </paramdef>
 
73
                    <paramdef>
 
74
                        <link xlink:href="scalarDataTypes.html">size_t</link>
 
75
                        <parameter>size</parameter>
 
76
                    </paramdef>
 
77
                    <paramdef>
 
78
                        <link xlink:href="scalarDataTypes.html">cl_uint</link>
 
79
                        <parameter>num_events_in_wait_list</parameter>
 
80
                    </paramdef>
 
81
                    <paramdef>const
 
82
                        <link xlink:href="abstractDataTypes.html">cl_event</link>
 
83
                        <parameter>*event_wait_list</parameter>
 
84
                    </paramdef>
 
85
                    <paramdef>
 
86
                        <link xlink:href="abstractDataTypes.html">cl_event</link>
 
87
                        <parameter>*event</parameter>
 
88
                    </paramdef>
 
89
 
 
90
            </funcprototype>
 
91
        </funcsynopsis>
 
92
    </refsynopsisdiv>
 
93
 
 
94
<!-- ================================ PARAMETERS -->
 
95
 
 
96
    <refsect1 id="parameters">
 
97
        <title>Parameters</title>
 
98
        <variablelist>
 
99
            <varlistentry>
 
100
                <term> <varname> command_queue </varname> </term>
 
101
                <listitem>
 
102
                    <para>
 
103
                      Refers to the command-queue in which the fill command will be queued.
 
104
                      The OpenCL context associated with <varname>command_queue</varname>
 
105
                      and <varname>buffer</varname> must be the same.
 
106
                    </para>
 
107
               </listitem>
 
108
            </varlistentry>
 
109
 
 
110
            <varlistentry>
 
111
                <term> <varname> buffer </varname> </term>
 
112
                <listitem>
 
113
                    <para>
 
114
                       A valid buffer object.
 
115
                    </para>
 
116
               </listitem>
 
117
            </varlistentry>
 
118
 
 
119
            <varlistentry>
 
120
                <term> <varname> pattern </varname> </term>
 
121
                <listitem>
 
122
                    <para>
 
123
                      A pointer to the data pattern of size <varname>pattern_size</varname>
 
124
                      in bytes. <varname>pattern</varname> will be used to fill a region
 
125
                      in <varname>buffer</varname> starting at <varname>offset</varname>
 
126
                      and is <varname>size</varname> bytes in size. The data pattern
 
127
                      must be a scalar or vector integer or floating-point data type. For
 
128
                      example, if <varname>buffer</varname> is to be filled with a pattern of
 
129
                      <type>float4</type> values, then <varname>pattern</varname> will be a pointer
 
130
                      to a <type>cl_float4</type> value and <varname>pattern_size</varname>
 
131
                      will be <code>sizeof(cl_float4)</code>.  The maximum value of
 
132
                      <varname>pattern_size</varname> is the size of the largest integer
 
133
                      or floating-point vector data type supported by the OpenCL device.
 
134
                      The memory associated with <varname>pattern</varname> can be reused or
 
135
                      freed after the function returns.
 
136
                    </para>
 
137
                </listitem>
 
138
            </varlistentry>
 
139
 
 
140
            <varlistentry>
 
141
                <term> <varname> offset </varname> </term>
 
142
                <listitem>
 
143
                    <para>
 
144
                      The location in bytes of the region being filled in <varname>buffer</varname>
 
145
                      and must be a multiple of <varname>pattern_size</varname>.
 
146
                    </para>
 
147
               </listitem>
 
148
            </varlistentry>
 
149
 
 
150
            <varlistentry>
 
151
                <term> <varname> size </varname> </term>
 
152
                <listitem>
 
153
                    <para>
 
154
                      The size in bytes of region being filled in <varname>buffer</varname>
 
155
                      and must be a multiple of <varname>pattern_size</varname>.
 
156
                    </para>
 
157
               </listitem>
 
158
            </varlistentry>
 
159
 
 
160
            <varlistentry>
 
161
                <term>
 
162
                    <varname>
 
163
                        event_wait_list
 
164
                    ,</varname>
 
165
                    <varname>
 
166
                        num_events_in_wait_list
 
167
                    </varname>
 
168
                </term>
 
169
 
 
170
                <listitem>
 
171
                    <para>
 
172
                      Specify events that need to complete before this particular
 
173
                      command can be executed. If <varname>event_wait_list</varname>
 
174
                      is NULL, then this particular command does not wait on any
 
175
                      event to complete. If <varname>event_wait_list</varname> is
 
176
                      NULL, <varname>num_events_in_wait_list</varname> must be 0. If
 
177
                      <varname>event_wait_list</varname> is not NULL, the list of events
 
178
                      pointed to by <varname>event_wait_list</varname> must be valid
 
179
                      and <varname>num_events_in_wait_list</varname> must be greater
 
180
                      than 0. The events specified in <varname>event_wait_list</varname>
 
181
                      act as synchronization points. The context associated with events in
 
182
                      <varname>event_wait_list</varname> and <varname>command_queue</varname> must
 
183
                      be the same. The memory associated with <varname>event_wait_list</varname>
 
184
                      can be reused or freed after the function returns.
 
185
                    </para>
 
186
               </listitem>
 
187
            </varlistentry>
 
188
 
 
189
            <varlistentry>
 
190
                <term> <varname> event </varname> </term>
 
191
                <listitem>
 
192
                    <para>
 
193
                      Returns an event object that identifies this particular write
 
194
                      command and can be used to query or queue a wait for this particular
 
195
                      command to complete. <varname>event</varname> can be NULL in
 
196
                      which case it will not be possible for the application to query the
 
197
                      status of this command or queue a wait for this command to complete.
 
198
                      <citerefentry><refentrytitle>clEnqueueBarrierWithWaitList</refentrytitle></citerefentry>
 
199
                      can be used instead.  If the <varname>event_wait_list</varname>
 
200
                      and the <varname>event</varname> arguments are not NULL, the
 
201
                      <varname>event</varname> argument should not refer to an element of the
 
202
                      <varname>event_wait_list</varname> array.
 
203
                    </para>
 
204
                </listitem>
 
205
            </varlistentry>
 
206
        </variablelist>
 
207
    </refsect1>
 
208
 
 
209
<!-- ================================ NOTES  -->
 
210
 
 
211
     <refsect1 id="notes"><title>Notes</title>
 
212
        <para>
 
213
          Enqueues a command to fill a buffer object with a pattern of a given pattern size. The
 
214
          usage information which indicates whether the memory object can be read or written by
 
215
          a kernel and/or the host and is given by the <type>cl_mem_flags</type> argument value
 
216
          specified when buffer is created is ignored by <function>clEnqueueFillBuffer</function>.
 
217
        </para>
 
218
    </refsect1>
 
219
 
 
220
<!-- ================================ ERRORS  -->
 
221
 
 
222
    <refsect1 id="errors"><title>Errors</title>
 
223
        <para>
 
224
          <function>clEnqueueFillBuffer</function> returns <errorname>CL_SUCCESS</errorname> if
 
225
          the function is executed successfully. Otherwise, it returns one of the following errors.
 
226
        </para>
 
227
 
 
228
        <itemizedlist mark="disc">
 
229
            <listitem>
 
230
              <errorname>CL_INVALID_COMMAND_QUEUE</errorname> if <varname>command_queue</varname>
 
231
              is not a valid command-queue.
 
232
            </listitem>
 
233
 
 
234
            <listitem>
 
235
              <errorname>CL_INVALID_CONTEXT</errorname> if the context associated with
 
236
              <varname>command_queue</varname> and <varname>buffer</varname> are not the same
 
237
              or if the context associated with <varname>command_queue</varname> and events in
 
238
              <varname>event_wait_list</varname> are not the same.
 
239
            </listitem>
 
240
 
 
241
            <listitem>
 
242
              <errorname>CL_INVALID_MEM_OBJECT</errorname> if <varname>buffer</varname> is not
 
243
              a valid buffer object.
 
244
            </listitem>
 
245
 
 
246
            <listitem>
 
247
              <errorname>CL_INVALID_VALUE</errorname> if <varname>offset</varname> or
 
248
              <varname>offset</varname> + <varname>size</varname> require accessing elements
 
249
              outside the <varname>buffer</varname> buffer object respectively.
 
250
            </listitem>
 
251
 
 
252
            <listitem>
 
253
              <errorname>CL_INVALID_VALUE</errorname> if <varname>pattern</varname> is NULL
 
254
              or if <varname>pattern_size</varname> is 0 or if <varname>pattern_size</varname>
 
255
              is not one of {1, 2, 4, 8, 16, 32, 64, 128}.
 
256
            </listitem>
 
257
 
 
258
            <listitem>
 
259
              <errorname>CL_INVALID_VALUE</errorname> if <varname>offset</varname> and
 
260
              <varname>size</varname> are not a multiple of <varname>pattern_size</varname>.
 
261
            </listitem>
 
262
 
 
263
            <listitem>
 
264
              <errorname>CL_INVALID_EVENT_WAIT_LIST</errorname>
 
265
              if <varname>event_wait_list</varname> is NULL and
 
266
              <varname>num_events_in_wait_list</varname> &gt; 0,
 
267
              or <varname>event_wait_list</varname> is not NULL and
 
268
              <varname>num_events_in_wait_list</varname> is 0, or if event objects in
 
269
              <varname>event_wait_list</varname> are not valid events.
 
270
            </listitem> 
 
271
 
 
272
            <listitem>
 
273
              <errorname>CL_MISALIGNED_SUB_BUFFER_OFFSET</errorname> if <varname>buffer</varname>
 
274
              is a sub-buffer object and offset specified when the sub-buffer object is created
 
275
              is not aligned to <constant>CL_DEVICE_MEM_BASE_ADDR_ALIGN</constant> value for
 
276
              device associated with <varname>queue</varname>.
 
277
            </listitem>
 
278
 
 
279
            <listitem>
 
280
              <errorname>CL_MEM_OBJECT_ALLOCATION_FAILURE</errorname> if there is a failure to
 
281
              allocate memory for data store associated with <varname>buffer</varname>.
 
282
            </listitem>
 
283
 
 
284
            <listitem>
 
285
              <errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate
 
286
              resources required by the OpenCL implementation on the device.
 
287
            </listitem>
 
288
 
 
289
            <listitem>
 
290
              <errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
 
291
              resources required by the OpenCL implementation on the host.
 
292
            </listitem>
 
293
        </itemizedlist>
 
294
    </refsect1>
 
295
 
 
296
<!-- ================================ EXAMPLE  -->
 
297
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
 
298
<!--
 
299
    <refsect2 id="example1">
 
300
        <title>
 
301
            Example
 
302
        </title>
 
303
 
 
304
        <informaltable frame="none">
 
305
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
306
                <colspec colname="col1" colnum="1" />
 
307
                <tbody>
 
308
                    <row>
 
309
                        <entry>
 
310
                            Example goes here - it will be set in "code" type with white space preserved.
 
311
                        </entry>
 
312
                    </row>
 
313
                </tbody>
 
314
            </tgroup>
 
315
        </informaltable>
 
316
    </refsect2>
 
317
-->
 
318
 
 
319
<!-- ================================ SPECIFICATION  -->
 
320
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
321
-->
 
322
    <refsect1 id="specification"><title>Specification</title>
 
323
        <para>
 
324
            <imageobject>
 
325
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
326
            </imageobject>
 
327
 
 
328
            <olink uri="clEnqueueFillBuffer">OpenCL Specification</olink>
 
329
        </para>
 
330
    </refsect1>
 
331
 
 
332
<!-- ================================ ALSO SEE  -->
 
333
 
 
334
    <refsect1 id="seealso"><title>Also see</title>
 
335
        <para>
 
336
            <citerefentry><refentrytitle>clEnqueueBarrierWithWaitList</refentrytitle></citerefentry>
 
337
        </para>
 
338
    </refsect1>
 
339
 
 
340
<!-- ================================ COPYRIGHT  -->
 
341
<!-- Content included from copyright.inc.xsl -->
 
342
 
 
343
    <refsect3 id="Copyright"><title></title>
 
344
        <imageobject>
 
345
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
346
        </imageobject>
 
347
        <para />
 
348
    </refsect3>
 
349
 
 
350
<!-- 24-Oct-2011 -->
 
351
</refentry>
 
352