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

« back to all changes in this revision

Viewing changes to clEnqueueCopyBufferRect.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>clEnqueueCopyBufferRect</keyword>
 
9
        </keywordset>
 
10
    </refentryinfo>
 
11
 
 
12
    <refmeta>
 
13
        <refentrytitle>
 
14
            clEnqueueCopyBufferRect
 
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
<!-- For each <funcprototype />, use <funcdef /> for the first part, with the function name
 
36
     set as <function /> and <paramdef /> for each or the parameters, plus <parameter /> for the
 
37
     actual parameter name. If you need multiple synopses, use separate <funcsynopsis /> sets.
 
38
 
 
39
-->
 
40
    <refnamediv id="clEnqueueCopyBufferRect ">
 
41
        <refname>
 
42
            clEnqueueCopyBufferRect
 
43
        </refname>
 
44
 
 
45
        <refpurpose>
 
46
            Enqueues a command to copy a rectangular region from a buffer object to another buffer object.
 
47
        </refpurpose>
 
48
    </refnamediv>
 
49
 
 
50
    <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
 
51
        <funcsynopsis>
 
52
            <funcprototype>
 
53
                <funcdef>
 
54
                    <link xlink:href="scalarDataTypes.html">cl_int</link> <function>clEnqueueCopyBufferRect </function>
 
55
                </funcdef>
 
56
 
 
57
                <paramdef><link xlink:href="abstractDataTypes.html">cl_command_queue</link><parameter>command_queue</parameter></paramdef>
 
58
                <paramdef><link xlink:href="abstractDataTypes.html">cl_mem</link><parameter>src_buffer</parameter></paramdef>
 
59
                <paramdef><link xlink:href="abstractDataTypes.html">cl_mem</link><parameter>dst_buffer</parameter></paramdef>
 
60
                <paramdef>const <link xlink:href="scalarDataTypes.html">size_t</link><parameter>*src_origin</parameter></paramdef>
 
61
                <paramdef>const <link xlink:href="scalarDataTypes.html">size_t</link><parameter>*dst_origin</parameter></paramdef>
 
62
                <paramdef>const <link xlink:href="scalarDataTypes.html">size_t</link><parameter>*region</parameter></paramdef>
 
63
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>src_row_pitch</parameter></paramdef>
 
64
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>src_slice_pitch</parameter></paramdef>
 
65
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>dst_row_pitch</parameter></paramdef>
 
66
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>dst_slice_pitch</parameter></paramdef>
 
67
                <paramdef><link xlink:href="scalarDataTypes.html">cl_uint</link><parameter>num_events_in_wait_list</parameter></paramdef>
 
68
                <paramdef>const <link xlink:href="abstractDataTypes.html">cl_event</link><parameter>*event_wait_list</parameter></paramdef>
 
69
                <paramdef><link xlink:href="abstractDataTypes.html">cl_event</link><parameter>*event</parameter></paramdef>
 
70
 
 
71
            </funcprototype>
 
72
        </funcsynopsis>
 
73
    </refsynopsisdiv>
 
74
 
 
75
<!-- ================================ PARAMETERS -->
 
76
<!-- For each <varlistentry />, place the parameter name in <term /><varname />, then the definition in
 
77
     <listitem /><para />. When refering to anything
 
78
     that has a page in this system, use <citerefentry /><refentrytitle /> to make it a link.
 
79
 
 
80
-->
 
81
    <refsect1 id="parameters">
 
82
        <title>Parameters</title>
 
83
        <variablelist>
 
84
            <varlistentry>
 
85
                <term> <varname> command_queue </varname> </term>
 
86
                <listitem>
 
87
                    <para>
 
88
                      The command-queue in which the copy command will be queued. The
 
89
                      OpenCL context associated with <varname>command_queue</varname>,
 
90
                      <varname>src_buffer</varname>, and <varname>dst_buffer</varname> must be
 
91
                      the same.
 
92
                    </para>
 
93
               </listitem>
 
94
            </varlistentry>
 
95
 
 
96
            <varlistentry>
 
97
                <term>
 
98
                    <varname>
 
99
                        src_origin
 
100
                    </varname>
 
101
                </term>
 
102
                <listitem>
 
103
                    <para>
 
104
                      The (<emphasis>x, y, z</emphasis>) offset in the memory region associated
 
105
                      with <varname>src_buffer</varname>. For a 2D rectangle region, the
 
106
                      <varname>z</varname> value given by <varname>src_origin</varname>[2] should
 
107
                      be 0. The offset in bytes is computed as <varname>src_origin</varname>[2]
 
108
                      * <varname>src_slice_pitch</varname> + <varname>src_origin</varname>[1]
 
109
                      * <varname>src_row_pitch</varname> + <varname>src_origin</varname>[0].
 
110
                    </para>
 
111
               </listitem>
 
112
            </varlistentry>
 
113
 
 
114
 
 
115
            <varlistentry>
 
116
                <term> <varname> dst_origin </varname> </term>
 
117
                <listitem>
 
118
                    <para>
 
119
                      The (<emphasis>x, y, z</emphasis>) offset in the memory region associated
 
120
                      with <varname>dst_buffer</varname>. For a 2D rectangle region, the
 
121
                      <varname>z</varname> value given by <varname>dst_origin</varname>[2] should
 
122
                      be 0. The offset in bytes is computed as <varname>dst_origin</varname>[2]
 
123
                      * <varname>dst_slice_pitch</varname> + <varname>dst_origin</varname>[1]
 
124
                      * <varname>dst_row_pitch</varname> + <varname>dst_origin</varname>[0].
 
125
                    </para>
 
126
               </listitem>
 
127
            </varlistentry>
 
128
 
 
129
            <varlistentry>
 
130
                <term> <varname>region</varname> </term>
 
131
                <listitem>
 
132
                    <para>
 
133
                      The (<emphasis>width, height, depth</emphasis>) in bytes of the 2D or 3D
 
134
                      rectangle being copied. For a 2D rectangle, the <varname>depth</varname>
 
135
                      value given by <varname>region</varname>[2] should be 1.
 
136
                    </para>
 
137
               </listitem>
 
138
            </varlistentry>
 
139
 
 
140
 
 
141
             <varlistentry>
 
142
                <term> <varname>src_row_pitch</varname> </term> <listitem>
 
143
                    <para>
 
144
                      The length of each row in bytes to be used for the memory region associated
 
145
                      with <varname>src_buffer</varname>. If <varname>src_row_pitch</varname> is 0,
 
146
                      <varname>src_row_pitch</varname> is computed as <varname>region</varname>[0].
 
147
                    </para>
 
148
               </listitem>
 
149
            </varlistentry>
 
150
 
 
151
 
 
152
             <varlistentry>
 
153
                <term> <varname>src_slice_pitch</varname> </term> <listitem>
 
154
                    <para>
 
155
                      The length of each 2D slice in bytes to be used for the
 
156
                      memory region associated with <varname>src_buffer</varname>. If
 
157
                      <varname>src_slice_pitch</varname> is 0, <varname>src_slice_pitch</varname>
 
158
                      is computed as <varname>region</varname>[1] *
 
159
                      <varname>src_row_pitch</varname>.
 
160
                    </para>
 
161
               </listitem>
 
162
            </varlistentry>
 
163
 
 
164
            <varlistentry>
 
165
                <term> <varname>dst_row_pitch</varname> </term>
 
166
                <listitem>
 
167
                    <para>
 
168
                      The length of each row in bytes to be used for the memory region associated
 
169
                      with <varname>dst_buffer</varname>. If <varname>dst_row_pitch</varname> is 0,
 
170
                      <varname>dst_row_pitch</varname> is computed as <varname>region</varname>[0].
 
171
                    </para>
 
172
               </listitem>
 
173
            </varlistentry>
 
174
 
 
175
            <varlistentry>
 
176
                <term> <varname>dst_slice_pitch</varname> </term>
 
177
                <listitem>
 
178
                    <para>
 
179
                      The length of each 2D slice in bytes to be used for the
 
180
                      memory region associated with <varname>dst_buffer</varname>. If
 
181
                      <varname>dst_slice_pitch</varname> is 0, <varname>dst_slice_pitch</varname>
 
182
                      is computed as <varname>region</varname>[1] *
 
183
                      <varname>dst_row_pitch</varname>.
 
184
                    </para>
 
185
               </listitem>
 
186
            </varlistentry>
 
187
 
 
188
 
 
189
 
 
190
            <varlistentry>
 
191
                <term>
 
192
                    <varname>
 
193
                        event_wait_list
 
194
                    </varname>
 
195
                </term>
 
196
                <term>
 
197
                    <varname>
 
198
                        num_events_in_wait_list
 
199
                    </varname>
 
200
                </term>
 
201
                <listitem>
 
202
                    <para>
 
203
                      Specify events that need to complete before this particular
 
204
                      command can be executed. If <varname>event_wait_list</varname>
 
205
                      is NULL, then this particular command does not wait on any
 
206
                      event to complete. If <varname>event_wait_list</varname> is
 
207
                      NULL, <varname>num_events_in_wait_list</varname> must be 0. If
 
208
                      <varname>event_wait_list</varname> is not NULL, the list of events
 
209
                      pointed to by <varname>event_wait_list</varname> must be valid
 
210
                      and <varname>num_events_in_wait_list</varname> must be greater
 
211
                      than 0. The events specified in <varname>event_wait_list</varname>
 
212
                      act as synchronization points. The context associated with events in
 
213
                      <varname>event_wait_list</varname> and <varname>command_queue</varname> must
 
214
                      be the same. The memory associated with <varname>event_wait_list</varname>
 
215
                      can be reused or freed after the function returns.
 
216
                    </para>
 
217
               </listitem>
 
218
            </varlistentry>
 
219
 
 
220
            <varlistentry>
 
221
                <term> <varname> event </varname> </term>
 
222
                <listitem>
 
223
                    <para>
 
224
                      Returns an event object that identifies this particular copy command
 
225
                      and can be used to query or queue a wait for this particular
 
226
                      command to complete. <varname>event</varname> can be NULL in
 
227
                      which case it will not be possible for the application to query the
 
228
                      status of this command or queue a wait for this command to complete.
 
229
                      <citerefentry><refentrytitle>clEnqueueBarrierWithWaitList</refentrytitle></citerefentry>
 
230
                      can be used instead.  If the <varname>event_wait_list</varname>
 
231
                      and the <varname>event</varname> arguments are not NULL, the
 
232
                      <varname>event</varname> argument should not refer to an element of the
 
233
                      <varname>event_wait_list</varname> array.
 
234
                    </para>
 
235
               </listitem>
 
236
            </varlistentry>
 
237
        </variablelist>
 
238
    </refsect1>
 
239
 
 
240
<!-- ================================ NOTES  -->
 
241
 
 
242
    <refsect1 id="notes"><title>Notes</title>
 
243
        <para>
 
244
          <function>clEnqueueCopyBufferRect</function>enqueues a command to copy a 2D or 3D
 
245
          rectangular region from the buffer object identified by <varname>src_buffer</varname>
 
246
          to a 2D or 3D region in the buffer object identified by <varname>dst_buffer</varname>.
 
247
          Copying begins at the source offset and destination offset which are computed
 
248
          as described in the description for <varname>src_origin</varname> and
 
249
          <varname>dst_origin</varname>.
 
250
        </para>
 
251
 
 
252
        <para>
 
253
          Each byte of the region's width is copied from the source offset to the destination
 
254
          offset.  After copying each width, the source and destination offsets are incremented by
 
255
          their respective source and destination row pitches. After copying each 2D rectangle,
 
256
          the source and destination offsets are incremented by their respective source and
 
257
          destination slice pitches.
 
258
        </para>
 
259
 
 
260
        <para>
 
261
          NOTE: If <varname>src_buffer</varname> and <varname>dst_buffer</varname>
 
262
          are the same buffer object, <varname>src_row_pitch</varname> must equal
 
263
          <varname>dst_row_pitch</varname> and <varname>src_slice_pitch</varname> must equal
 
264
          <varname>dst_slice_pitch</varname>.
 
265
        </para>
 
266
    </refsect1>
 
267
 
 
268
<!-- ================================ ERRORS  -->
 
269
 
 
270
    <refsect1 id="errors"><title>Errors</title>
 
271
        <para>
 
272
          Returns <errorname>CL_SUCCESS</errorname> if the function is executed successfully.
 
273
          Otherwise, it returns one of the following errors:
 
274
        </para>
 
275
 
 
276
        <itemizedlist mark="disc">
 
277
            <listitem>
 
278
              <errorname>CL_INVALID_COMMAND_QUEUE</errorname> if <varname>command_queue</varname>
 
279
              is not a valid command-queue.
 
280
            </listitem>
 
281
 
 
282
            <listitem>
 
283
              <errorname>CL_INVALID_CONTEXT</errorname> if the context associated
 
284
              with <varname>command_queue</varname>, <varname>src_buffer</varname>, and
 
285
              <varname>dst_buffer</varname> are not the same or if the context associated with
 
286
              <varname>command_queue</varname> and events in <varname>event_wait_list</varname>
 
287
              are not the same.
 
288
            </listitem>
 
289
 
 
290
            <listitem>
 
291
              <errorname>CL_INVALID_MEM_OBJECT</errorname> if <varname>src_buffer</varname>
 
292
              and <varname>dst_buffer</varname> are not valid buffer objects.
 
293
            </listitem>
 
294
 
 
295
            <listitem>
 
296
              <errorname>CL_INVALID_VALUE</errorname> if (<varname>src_offset</varname>,
 
297
              <varname>region</varname>) or (<varname>dst_offset</varname>,
 
298
              <varname>region</varname>) require accessing elements outside the
 
299
              <varname>src_buffer</varname> and <varname>dst_buffer</varname> objects respectively.
 
300
            </listitem>
 
301
 
 
302
            <listitem>
 
303
              <errorname>CL_INVALID_VALUE</errorname> if any <varname>region</varname> array
 
304
              element is 0.
 
305
            </listitem>
 
306
 
 
307
            <listitem>
 
308
              <errorname>CL_INVALID_VALUE</errorname> if <varname>src_row_pitch</varname>
 
309
              is not 0 and is less than <varname>region</varname>[0].
 
310
            </listitem>
 
311
 
 
312
            <listitem>
 
313
              <errorname>CL_INVALID_VALUE</errorname> if <varname>dst_row_pitch</varname>
 
314
              is not 0 and is less than <varname>region</varname>[0].
 
315
            </listitem>
 
316
 
 
317
            <listitem>
 
318
              <errorname>CL_INVALID_VALUE</errorname> if <varname>src_slice_pitch</varname> is not
 
319
              0 and is less than <varname>region</varname>[1] * <varname>src_row_pitch</varname>
 
320
              or if <varname>src_slice_pitch</varname> is not 0 and is not a multiple of
 
321
              <varname>src_row_pitch</varname>.
 
322
            </listitem>
 
323
 
 
324
            <listitem>
 
325
              <errorname>CL_INVALID_VALUE</errorname> if <varname>dst_slice_pitch</varname> is not
 
326
              0 and is less than <varname>region</varname>[1] * <varname>dst_row_pitch</varname>
 
327
              or if <varname>dst_slice_pitch</varname> is not 0 and is not a multiple of
 
328
              <varname>dst_row_pitch</varname>.
 
329
            </listitem>
 
330
 
 
331
            <listitem>
 
332
              <errorname>CL_INVALID_VALUE</errorname> if <varname>src_buffer</varname>
 
333
              and <varname>dst_buffer</varname> are the same buffer
 
334
              object and <varname>src_slice_pitch</varname> is not equal to
 
335
              <varname>dst_slice_pitch</varname> and <varname>src_row_pitch</varname> is not
 
336
              equal to <varname>dst_row_pitch</varname>.
 
337
            </listitem>
 
338
 
 
339
            <listitem>
 
340
              <errorname>CL_INVALID_EVENT_WAIT_LIST</errorname>
 
341
              if <varname>event_wait_list</varname> is NULL and
 
342
              <varname>num_events_in_wait_list</varname> is &gt;
 
343
              0, or <varname>event_wait_list</varname> is not NULL and
 
344
              <varname>num_events_in_wait_list</varname> is 0, or if event objects in
 
345
              <varname>event_wait_list</varname> are not valid events.
 
346
            </listitem>
 
347
 
 
348
            <listitem>
 
349
              <errorname>CL_MEM_COPY_OVERLAP</errorname> if <varname>src_buffer</varname>
 
350
              and <varname>dst_buffer</varname> are the same buffer object and the source
 
351
              and destination regions overlap or if <varname>src_buffer</varname> and
 
352
              <varname>dst_buffer</varname> are different sub-buffers of the same associated
 
353
              buffer object and they overlap.  Refer to Appendix E in the OpenCL specification
 
354
              for details on how to determine if source and destination regions overlap.
 
355
            </listitem>
 
356
 
 
357
            <listitem>
 
358
              <errorname>CL_MISALIGNED_SUB_BUFFER_OFFSET </errorname> if
 
359
              <varname>src_buffer</varname> is a sub-buffer object and <varname>offset</varname>
 
360
              specified when the sub-buffer object is created is not aligned to
 
361
              <constant>CL_DEVICE_MEM_BASE_ADDR_ALIGN</constant> value for device associated
 
362
              with <varname>queue</varname>.
 
363
            </listitem>
 
364
 
 
365
            <listitem>
 
366
              <errorname>CL_MISALIGNED_SUB_BUFFER_OFFSET </errorname> if
 
367
              <varname>dst_buffer</varname> is a sub-buffer object and <varname>offset</varname>
 
368
              specified when the sub-buffer object is created is not aligned to
 
369
              <constant>CL_DEVICE_MEM_BASE_ADDR_ALIGN</constant> value for device associated
 
370
              with <varname>queue</varname>.
 
371
            </listitem>
 
372
 
 
373
            <listitem>
 
374
              <errorname>CL_MEM_OBJECT_ALLOCATION_FAILURE</errorname> if there is a failure
 
375
              to allocate memory for data store associated with <varname>src_buffer</varname>
 
376
              or <varname>dst_buffer</varname>.
 
377
            </listitem>
 
378
 
 
379
            <listitem>
 
380
              <errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate
 
381
              resources required by the OpenCL implementation on the device.
 
382
            </listitem>
 
383
 
 
384
            <listitem>
 
385
              <errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
 
386
              resources required by the OpenCL implementation on the host.
 
387
            </listitem>
 
388
        </itemizedlist>
 
389
    </refsect1>
 
390
 
 
391
<!-- ================================ EXAMPLE  -->
 
392
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
 
393
<!--
 
394
    <refsect2 id="example1">
 
395
        <title>
 
396
            Example
 
397
        </title>
 
398
 
 
399
        <informaltable frame="none">
 
400
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
401
                <colspec colname="col1" colnum="1" />
 
402
                <tbody>
 
403
                    <row>
 
404
                        <entry>
 
405
                            Example goes here - it will be set in "code" type with white space preserved.
 
406
                        </entry>
 
407
                    </row>
 
408
                </tbody>
 
409
            </tgroup>
 
410
        </informaltable>
 
411
    </refsect2>
 
412
-->
 
413
 
 
414
<!-- ================================ SPECIFICATION  -->
 
415
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
416
-->
 
417
    <refsect1 id="specification"><title>Specification</title>
 
418
        <para>
 
419
            <imageobject>
 
420
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
421
            </imageobject>
 
422
 
 
423
            <olink uri="clEnqueueCopyBufferRect">OpenCL Specification</olink>
 
424
        </para>
 
425
    </refsect1>
 
426
 
 
427
<!-- ================================ ALSO SEE  -->
 
428
 
 
429
    <refsect1 id="seealso"><title>Also see</title>
 
430
        <para>
 
431
            <citerefentry><refentrytitle>clEnqueueReadBuffer</refentrytitle></citerefentry>,
 
432
            <citerefentry><refentrytitle>clEnqueueReadBufferRect</refentrytitle></citerefentry>,
 
433
            <citerefentry><refentrytitle>clEnqueueWriteBuffer</refentrytitle></citerefentry>,
 
434
            <citerefentry><refentrytitle>clEnqueueWriteBufferRect</refentrytitle></citerefentry>,
 
435
            <citerefentry><refentrytitle>clEnqueueCopyBuffer</refentrytitle></citerefentry>,
 
436
            <citerefentry><refentrytitle>clCreateBuffer</refentrytitle></citerefentry>,
 
437
            <citerefentry><refentrytitle>clCreateSubBuffer</refentrytitle></citerefentry>,
 
438
            <citerefentry><refentrytitle>clEnqueueCopyBufferToImage</refentrytitle></citerefentry>,
 
439
            <citerefentry><refentrytitle>clEnqueueCopyImageToBuffer</refentrytitle></citerefentry>
 
440
        </para>
 
441
    </refsect1>
 
442
 
 
443
<!-- ================================ COPYRIGHT  -->
 
444
<!-- Content included from copyright.inc.xsl -->
 
445
 
 
446
    <refsect3 id="Copyright"><title></title>
 
447
        <imageobject>
 
448
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
449
        </imageobject>
 
450
        <para />
 
451
    </refsect3>
 
452
 
 
453
<!-- 21-Oct-2011 -->
 
454
</refentry>
 
455