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

« back to all changes in this revision

Viewing changes to clEnqueueCopyBufferToImage.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>clEnqueueCopyBufferToImage</keyword>
 
9
        </keywordset>
 
10
    </refentryinfo>
 
11
 
 
12
    <refmeta>
 
13
        <refentrytitle>
 
14
            clEnqueueCopyBufferToImage
 
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="clEnqueueCopyBufferToImage">
 
37
        <refname>
 
38
            clEnqueueCopyBufferToImage
 
39
        </refname>
 
40
 
 
41
        <refpurpose>
 
42
            Enqueues a command to copy a buffer object to an image 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="scalarDataTypes.html">cl_int</link>
 
51
 <function>clEnqueueCopyBufferToImage</function>
 
52
                </funcdef>
 
53
                    <paramdef><link xlink:href="abstractDataTypes.html">cl_command_queue</link><parameter>command_queue</parameter></paramdef>
 
54
                    <paramdef><link xlink:href="abstractDataTypes.html">cl_mem</link><parameter>src_buffer</parameter></paramdef>
 
55
                    <paramdef><link xlink:href="abstractDataTypes.html">cl_mem</link> <parameter>dst_image</parameter></paramdef>
 
56
                    <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>src_offset</parameter></paramdef>
 
57
                    <paramdef>const <link xlink:href="scalarDataTypes.html">size_t</link><parameter>*dst_origin</parameter></paramdef>
 
58
                    <paramdef>const <link xlink:href="scalarDataTypes.html">size_t</link><parameter>*region</parameter></paramdef>
 
59
                    <paramdef><link xlink:href="scalarDataTypes.html">cl_uint</link><parameter>num_events_in_wait_list</parameter></paramdef>
 
60
                    <paramdef>const <link xlink:href="abstractDataTypes.html">cl_event</link><parameter>*event_wait_list</parameter></paramdef>
 
61
                    <paramdef><link xlink:href="abstractDataTypes.html">cl_event</link><parameter>*event</parameter></paramdef>
 
62
            </funcprototype>
 
63
        </funcsynopsis>
 
64
    </refsynopsisdiv>
 
65
 
 
66
<!-- ================================ PARAMETERS -->
 
67
 
 
68
    <refsect1 id="parameters">
 
69
        <title>Parameters</title>
 
70
        <variablelist>
 
71
 
 
72
            <varlistentry>
 
73
                <term> <varname> command_queue </varname> </term>
 
74
                <listitem>
 
75
                    <para>
 
76
                      A valid command-queue. The OpenCL context associated with
 
77
                      <varname>command_queue</varname>, <varname>src_buffer</varname>, and
 
78
                      <varname>dst_image</varname> must be the same.
 
79
                    </para>
 
80
               </listitem>
 
81
            </varlistentry>
 
82
 
 
83
            <varlistentry>
 
84
                <term> <varname> src_buffer </varname> </term>
 
85
                <listitem>
 
86
                    <para>
 
87
                        A valid buffer object.
 
88
                    </para>
 
89
               </listitem>
 
90
            </varlistentry>
 
91
 
 
92
            <varlistentry>
 
93
                <term> <varname> dst_image </varname> </term>
 
94
                <listitem>
 
95
                    <para>
 
96
                        A valid image object.
 
97
                    </para>
 
98
               </listitem>
 
99
            </varlistentry>
 
100
 
 
101
            <varlistentry>
 
102
                <term> <varname> src_offset </varname> </term>
 
103
                <listitem>
 
104
                    <para>
 
105
                      The offset where to begin copying data from <varname>src_buffer</varname>.
 
106
                    </para>
 
107
               </listitem>
 
108
            </varlistentry>
 
109
 
 
110
            <varlistentry>
 
111
                <term> <varname> dst_origin </varname> </term>
 
112
                <listitem>
 
113
                    <para>
 
114
                      Defines the (x, y, z) offset in pixels in the 1D, 2D or 3D image,
 
115
                      the (x, y) offset and the image index in the 2D image array or the
 
116
                      (x) offset and the image index in the 1D image array.  If dst_image
 
117
                      is a 2D image object, <varname>dst_origin</varname>[2] must be 0.
 
118
                      If <varname>dst_image</varname> is a 1D image or 1D image buffer object,
 
119
                      <varname>dst_origin</varname>[1] and <varname>dst_origin</varname>[2]
 
120
                      must be 0.  If <varname>dst_image</varname> is a 1D image array object,
 
121
                      <varname>dst_origin</varname>[2] must be 0.  If <varname>dst_image</varname>
 
122
                      is a 1D image array object, <varname>dst_origin</varname>[1] describes
 
123
                      the image index in the 1D image array. If <varname>dst_image</varname>
 
124
                      is a 2D image array object, <varname>dst_origin</varname>[2] describes
 
125
                      the image index in the 2D image array.
 
126
                    </para>
 
127
               </listitem>
 
128
            </varlistentry>
 
129
 
 
130
            <varlistentry>
 
131
                <term> <varname> region </varname> </term>
 
132
                <listitem>
 
133
                    <para>
 
134
                      Defines the (width, height, depth) in pixels of the 1D, 2D or 3D rectangle,
 
135
                      the (width, height) in pixels of the 2D rectangle and the number of images
 
136
                      of a 2D image array or the (width) in pixels of the 1D rectangle and the
 
137
                      number of images of a 1D image array.  If <varname>dst_image</varname>
 
138
                      is a 2D image object, <varname>region</varname>[2] must be 1. If
 
139
                      <varname>dst_image</varname> is a 1D image or 1D image buffer object,
 
140
                      <varname>region</varname>[1] and <varname>region</varname>[2] must
 
141
                      be 1.  If <varname>dst_image</varname> is a 1D image array object,
 
142
                      <varname>region</varname>[2] must be 1.
 
143
                    </para>
 
144
 
 
145
                    <para>
 
146
                      The size in bytes of the region to be copied
 
147
                      from <varname>src_buffer</varname> referred to as
 
148
                      <varname>src_cb</varname> is computed as <varname>width</varname>
 
149
                      * <varname>height</varname> * <varname>depth</varname> *
 
150
                      <varname>bytes</varname>/<varname>image_element</varname> if
 
151
                      <varname>dst_image</varname> is a 3D image object, is computed
 
152
                      as <varname>width</varname> * <varname>height</varname> *
 
153
                      <varname>bytes</varname>/<varname>image_element</varname>
 
154
                      if <varname>dst_image</varname> is a 2D
 
155
                      image, is computed as <varname>width</varname> *
 
156
                      <varname>height</varname> * <varname>arraysize</varname> *
 
157
                      <varname>bytes</varname>/<varname>image_element</varname>
 
158
                      if <varname>dst_image</varname> is a 2D image array
 
159
                      object, is computed as <varname>width</varname> *
 
160
                      <varname>bytes</varname>/<varname>image_element</varname> if
 
161
                      <varname>dst_image</varname> is a 1D image or 1D image buffer object and
 
162
                      is computed as <varname>width</varname> * <varname>arraysize</varname>
 
163
                      * <varname>bytes</varname>/<varname>image_element</varname> if
 
164
                      <varname>dst_image</varname> is a 1D image array object.
 
165
                    </para>
 
166
               </listitem>
 
167
            </varlistentry>
 
168
 
 
169
            <varlistentry>
 
170
                <term>
 
171
                    <varname>
 
172
                        event_wait_list
 
173
                    ,</varname>
 
174
                    <varname>
 
175
                        num_events_in_wait_list
 
176
                    </varname>
 
177
                </term>
 
178
 
 
179
                <listitem>
 
180
                    <para>
 
181
                      Specify events that need to complete before this particular
 
182
                      command can be executed. If <varname>event_wait_list</varname>
 
183
                      is NULL, then this particular command does not wait on any
 
184
                      event to complete. If <varname>event_wait_list</varname> is
 
185
                      NULL, <varname>num_events_in_wait_list</varname> must be 0. If
 
186
                      <varname>event_wait_list</varname> is not NULL, the list of events
 
187
                      pointed to by <varname>event_wait_list</varname> must be valid
 
188
                      and <varname>num_events_in_wait_list</varname> must be greater
 
189
                      than 0. The events specified in <varname>event_wait_list</varname>
 
190
                      act as synchronization points. The context associated with events in
 
191
                      <varname>event_wait_list</varname> and <varname>command_queue</varname>
 
192
                      must be the same.  The memory associated with event_wait_list can be
 
193
                      reused or freed after the function returns.
 
194
                    </para>
 
195
               </listitem>
 
196
            </varlistentry>
 
197
 
 
198
            <varlistentry>
 
199
                <term> <varname> event </varname> </term>
 
200
                <listitem>
 
201
                    <para>
 
202
                      Returns an event object that identifies this particular copy command
 
203
                      and can be used to query or queue a wait for this particular
 
204
                      command to complete. <varname>event</varname> can be NULL in
 
205
                      which case it will not be possible for the application to query the
 
206
                      status of this command or queue a wait for this command to complete.
 
207
                      <citerefentry><refentrytitle>clEnqueueBarrierWithWaitList</refentrytitle></citerefentry>
 
208
                      can be used instead.  If the <varname>event_wait_list</varname>
 
209
                      and the <varname>event</varname> arguments are not NULL, the
 
210
                      <varname>event</varname> argument should not refer to an element of the
 
211
                      <varname>event_wait_list</varname> array.
 
212
                    </para>
 
213
                </listitem>
 
214
            </varlistentry>
 
215
           </variablelist>
 
216
    </refsect1>
 
217
 
 
218
<!-- ================================ NOTES  -->
 
219
<!-- Use <function /> to refer ONLY to the function that this page describes. All other functions should use
 
220
     <citerefentry /><refentrytitle /> to make it a link. Use <varname /> for parameters. Use <constant /> for
 
221
     constants (or anything to be set in monospace, non-bold type.
 
222
 
 
223
    <refsect1 id="notes"><title>Notes</title>
 
224
        <para>
 
225
 
 
226
        </para>
 
227
 
 
228
    </refsect1>-->
 
229
 
 
230
<!-- ================================ ERRORS  -->
 
231
 
 
232
    <refsect1 id="errors"><title>Errors</title>
 
233
        <para>
 
234
          <function>clEnqueueCopyBufferToImage</function> returns <errorname>CL_SUCCESS</errorname>
 
235
          if the function is executed successfully. Otherwise, it returns one of the following
 
236
          errors:
 
237
        </para>
 
238
 
 
239
        <itemizedlist mark="disc">
 
240
            <listitem>
 
241
              <errorname>CL_INVALID_COMMAND_QUEUE</errorname> if <varname>command_queue</varname>
 
242
              is not a valid command-queue.
 
243
            </listitem>
 
244
 
 
245
            <listitem>
 
246
              <errorname>CL_INVALID_CONTEXT</errorname> if the context associated
 
247
              with <varname>command_queue</varname>, <varname>src_buffer</varname> and
 
248
              <varname>dst_image</varname> are not the same or if the context associated with
 
249
              <varname>command_queue</varname> and events in <varname>event_wait_list</varname>
 
250
              are not the same.
 
251
            </listitem>
 
252
 
 
253
            <listitem>
 
254
              <errorname>CL_INVALID_MEM_OBJECT</errorname> if <varname>src_buffer</varname> is
 
255
              not a valid buffer object and <varname>dst_image</varname> is not a valid image
 
256
              object or if <varname>dst_image</varname> is a 1D image buffer object created
 
257
              from <varname>src_buffer</varname>.
 
258
            </listitem>
 
259
 
 
260
            <listitem>
 
261
              <errorname>CL_INVALID_VALUE</errorname> if the 1D, 2D, or 3D rectangular region
 
262
              specified by <varname>dst_origin</varname> and <varname>dst_origin</varname> +
 
263
              <varname>region</varname> refers to a region outside <varname>dst_origin</varname>,
 
264
              or if the region specified by <varname>src_offset</varname> and
 
265
              <varname>src_offset</varname> + <varname>src_cb</varname> refers to a region
 
266
              outside <varname>src_buffer</varname>.
 
267
            </listitem>
 
268
 
 
269
            <listitem>
 
270
              <errorname>CL_INVALID_VALUE</errorname> if values in <varname>dst_origin</varname>
 
271
              and <varname>region</varname> do not follow rules described in the argument
 
272
              description for <varname>dst_origin</varname> and <varname>region</varname>.
 
273
            </listitem>
 
274
 
 
275
            <listitem>
 
276
              <errorname>CL_INVALID_EVENT_WAIT_LIST</errorname>
 
277
              if <varname>event_wait_list</varname> is NULL and
 
278
              <varname>num_events_in_wait_list</varname> &gt; 0,
 
279
              or <varname>event_wait_list</varname> is not NULL and
 
280
              <varname>num_events_in_wait_list</varname> is 0, or if event objects in
 
281
              <varname>event_wait_list</varname> are not valid events.
 
282
            </listitem>
 
283
 
 
284
            <listitem>
 
285
              <errorname>CL_MISALIGNED_SUB_BUFFER_OFFSET</errorname> if
 
286
              <varname>src_buffer</varname> is a sub-buffer object and <varname>offset</varname>
 
287
              specified when the sub-buffer object is created is not aligned to
 
288
              <constant>CL_DEVICE_MEM_BASE_ADDR_ALIGN</constant> value for device associated
 
289
              with <varname>queue</varname>.
 
290
            </listitem>
 
291
 
 
292
            <listitem>
 
293
              <errorname>CL_INVALID_IMAGE_SIZE</errorname> if image dimensions (image width,
 
294
              height, specified or compute row and/or slice pitch) for <varname>dst_image</varname>
 
295
              are not supported by device associated with <varname>queue</varname>.
 
296
            </listitem>
 
297
 
 
298
            <listitem>
 
299
              <errorname>CL_INVALID_IMAGE_FORMAT</errorname> if image format (image channel
 
300
              order and data type) for <varname>dst_image</varname> are not supported by device
 
301
              associated with <varname>queue</varname>.
 
302
            </listitem>
 
303
 
 
304
            <listitem>
 
305
              <errorname>CL_MEM_OBJECT_ALLOCATION_FAILURE</errorname> if there is a failure
 
306
              to allocate memory for data store associated with <varname>src_buffer</varname>
 
307
              or <varname>dst_image</varname>.
 
308
            </listitem>
 
309
 
 
310
            <listitem>
 
311
              <errorname>CL_INVALID_OPERATION</errorname> if the device associated
 
312
              with <varname>command_queue</varname> does not support images (i.e.
 
313
              CL_DEVICE_IMAGE_SUPPORT specified in the table of OpenCL Device Queries for
 
314
              <citerefentry><refentrytitle>clGetDeviceInfo</refentrytitle></citerefentry>
 
315
              is CL_FALSE).
 
316
            </listitem>
 
317
 
 
318
            <listitem>
 
319
              <errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate
 
320
              resources required by the OpenCL implementation on the device.
 
321
            </listitem>
 
322
 
 
323
            <listitem>
 
324
              <errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
 
325
              resources required by the OpenCL implementation on the host.
 
326
            </listitem>
 
327
        </itemizedlist>
 
328
 
 
329
    </refsect1>
 
330
 
 
331
<!-- ================================ EXAMPLE  -->
 
332
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
 
333
<!--
 
334
    <refsect2 id="example1">
 
335
        <title>
 
336
            Example
 
337
        </title>
 
338
 
 
339
        <informaltable frame="none">
 
340
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
341
                <colspec colname="col1" colnum="1" />
 
342
                <tbody>
 
343
                    <row>
 
344
                        <entry>
 
345
                            Example goes here - it will be set in "code" type with white space preserved.
 
346
                        </entry>
 
347
                    </row>
 
348
                </tbody>
 
349
            </tgroup>
 
350
        </informaltable>
 
351
    </refsect2>
 
352
-->
 
353
 
 
354
<!-- ================================ SPECIFICATION  -->
 
355
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
356
-->
 
357
    <refsect1 id="specification"><title>Specification</title>
 
358
        <para>
 
359
            <imageobject>
 
360
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
361
            </imageobject>
 
362
 
 
363
            <olink uri="clEnqueueCopyBufferToImage">OpenCL Specification</olink>
 
364
        </para>
 
365
    </refsect1>
 
366
 
 
367
<!-- ================================ ALSO SEE  -->
 
368
 
 
369
    <refsect1 id="seealso"><title>Also see</title>
 
370
        <para>
 
371
            <citerefentry><refentrytitle>clEnqueueReadBuffer</refentrytitle></citerefentry>,
 
372
            <citerefentry><refentrytitle>clEnqueueWriteBuffer</refentrytitle></citerefentry>,
 
373
            <citerefentry><refentrytitle>clCreateBuffer</refentrytitle></citerefentry>,
 
374
            <citerefentry><refentrytitle>clEnqueueCopyBuffer</refentrytitle></citerefentry>,
 
375
            <citerefentry><refentrytitle>clEnqueueCopyImageToBuffer</refentrytitle></citerefentry>
 
376
        </para>
 
377
    </refsect1>
 
378
 
 
379
<!-- ================================ COPYRIGHT  -->
 
380
<!-- Content included from copyright.inc.xsl -->
 
381
 
 
382
    <refsect3 id="Copyright"><title></title>
 
383
        <imageobject>
 
384
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
385
        </imageobject>
 
386
        <para />
 
387
    </refsect3>
 
388
 
 
389
<!-- 21-Oct-2011 -->
 
390
</refentry>
 
391