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
<!ENTITY mediaSurfaceFormatsInc SYSTEM "mediaSurfaceFormatsInc.xml">
5
<!ENTITY accessMappedInc SYSTEM "accessMappedInc.xml">
10
<keywordset><keyword>clEnqueueAcquireDX9MediaSurfacesKHR</keyword></keywordset>
13
<refentrytitle>clEnqueueAcquireDX9MediaSurfacesKHR</refentrytitle>
16
<year>2007-2011</year>
17
<holder>The Khronos Group Inc.
18
Permission is hereby granted, free of charge, to any person obtaining a
19
copy of this software and/or associated documentation files (the
20
"Materials"), to deal in the Materials without restriction, including
21
without limitation the rights to use, copy, modify, merge, publish,
22
distribute, sublicense, and/or sell copies of the Materials, and to
23
permit persons to whom the Materials are furnished to do so, subject to
24
the condition that this copyright notice and permission notice shall be included
25
in all copies or substantial portions of the Materials.</holder>
28
<manvolnum>3</manvolnum>
31
<!-- ================================ SYNOPSIS -->
33
<refnamediv id="clEnqueueAcquireDX9MediaSurfacesKHR">
34
<refname>clEnqueueAcquireDX9MediaSurfacesKHR</refname>
35
<refpurpose>Acquire OpenCL memory objects that have been created from a media surface.</refpurpose>
38
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
42
<link xlink:href="scalarDataTypes.html">cl_int</link>
43
<function>clEnqueueAcquireDX9MediaSurfacesKHR</function></funcdef>
45
<paramdef><link xlink:href="abstractDataTypes.html">cl_command_queue</link>
46
<parameter>command_queue</parameter></paramdef>
48
<paramdef><link xlink:href="scalarDataTypes.html">cl_uint</link>
49
<parameter>num_objects</parameter></paramdef>
51
<paramdef>const <link xlink:href="abstractDataTypes.html">cl_mem</link><parameter>*mem_objects</parameter></paramdef>
53
<paramdef><link xlink:href="scalarDataTypes.html">cl_uint</link><parameter>num_events_in_wait_list</parameter></paramdef>
56
const <link xlink:href="abstractDataTypes.html">cl_event</link>
57
<parameter>*event_wait_list</parameter>
60
<paramdef><link xlink:href="abstractDataTypes.html">cl_event</link><parameter>*event</parameter></paramdef>
65
<!-- ================================ PARAMETERS -->
67
<refsect1 id="parameters"><title>Parameters</title>
71
<term><varname>command_queue</varname></term>
74
A valid command-queue.
80
<term><varname>num_objects</varname></term>
83
The number of memory objects to be acquired in <varname>mem_objects</varname>.
89
<term><varname>mem_objects</varname></term>
92
A pointer to a list of OpenCL memory objects that were created from
99
<term><varname>num_events_in_wait_list</varname>, <varname>event_wait_list</varname></term>
102
Specify events that need to complete before this particular
103
command can be executed. If <varname>event_wait_list</varname>
104
is NULL, then this particular command does not wait on any
105
event to complete. If <varname>event_wait_list</varname> is
106
NULL, <varname>num_events_in_wait_list</varname> must be 0. If
107
<varname>event_wait_list</varname> is not NULL, the list of events
108
pointed to by <varname>event_wait_list</varname> must be valid and
109
<varname>num_events_in_wait_list</varname> must be greater than 0. The events
110
specified in <varname>event_wait_list</varname> act as synchronization points.
116
<term><varname>event</varname></term>
119
Returns <replaceable>n</replaceable> event object that identifies this particular
120
command and can be used to query or queue a wait for this particular command
121
to complete. <varname>event</varname> can be NULL in which case it will not
122
be possible for the application to query the status of this command or queue
123
a wait for this command to complete.
126
</varlistentry> </variablelist>
129
<!-- ================================ NOTES -->
131
<refsect1 id="notes"><title>Notes</title>
133
Used to acquire OpenCL memory objects that have been created from a media
134
surface. The media surfaces are acquired by the OpenCL context associated with
135
<varname>command_queue</varname> and can therefore be used by all command-queues
136
associated with the OpenCL context.
140
OpenCL memory objects created from media surfaces must be acquired before they can
141
be used by any OpenCL commands queued to a command-queue. If an OpenCL memory
142
object created from a media surface is used while it is not currently acquired
143
by OpenCL, the call attempting to use that OpenCL memory object will return
144
<constant>CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR</constant>.
148
If <constant>CL_CONTEXT_INTEROP_USER_SYNC</constant> is not
149
specified as <constant>CL_TRUE</constant> during context creation,
150
<function>clEnqueueAcquireDX9MediaSurfacesKHR</function> provides the synchronization
151
guarantee that any media adapter API calls involving the interop device(s) used in the
152
OpenCL context made before <function>clEnqueueAcquireDX9MediaSurfacesKHR</function>
153
is called will complete executing before <varname>event</varname> reports
154
completion and before the execution of any subsequent OpenCL work issued
155
in <varname>command_queue</varname> begins. If the context was created with
156
properties specifying <constant>CL_CONTEXT_INTEROP_USER_SYNC</constant> as
157
<constant>CL_TRUE</constant>, the user is responsible for guaranteeing that any
158
media adapter API calls involving the interop device(s) used in the OpenCL context
159
made before <function>clEnqueueAcquireDX9MediaSurfacesKHR</function> is called have
160
completed before calling <function>clEnqueueAcquireDX9MediaSurfacesKHR</function>.
163
&mediaSurfaceFormatsInc;
169
<!-- ================================ ERRORS -->
171
<refsect1 id="errors"><title>Errors</title>
173
Returns <errorname>CL_SUCCESS</errorname> returns <errorname>CL_SUCCESS</errorname>
174
if the function is executed successfully. If <varname>num_objects</varname> is 0 and
175
<varname>mem_objects</varname> is NULL then the function does nothing and returns
176
<errorname>CL_SUCCESS</errorname>. Otherwise it returns one of the following errors:
179
<itemizedlist mark="disc">
181
<errorname>CL_INVALID_VALUE</errorname> if <varname>num_objects</varname>
182
is zero and <varname>mem_objects</varname> is not a NULL value or if
183
<varname>num_objects</varname> > 0 and <varname>mem_objects</varname> is NULL.
187
<errorname>CL_INVALID_MEM_OBJECT</errorname> if memory objects in
188
<varname>mem_objects</varname> are not valid OpenCL memory objects or if memory
189
objects in <varname>mem_objects</varname> have not been created from media surfaces.
193
<errorname>CL_INVALID_COMMAND_QUEUE</errorname> if <varname>command_queue</varname>
194
is not a valid command-queue.
198
<errorname>CL_INVALID_CONTEXT</errorname> if context associated with
199
<varname>command_queue</varname> was not created from a device that can share
200
the media surface referenced by <varname>mem_objects</varname>.
204
<errorname>CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR</errorname> if memory
205
objects in <varname>mem_objects</varname> have previously been acquired
206
using <function>clEnqueueAcquireDX9MediaSurfacesKHR</function>
207
but have not been released using
208
<citerefentry><refentrytitle>clEnqueueReleaseDX9MediaSurfacesKHR</refentrytitle></citerefentry>.
212
<errorname>CL_INVALID_EVENT_WAIT_LIST</errorname>
213
if <varname>event_wait_list</varname> is NULL and
214
<varname>num_event_in_wait_list</varname> > 0,
215
or <varname>event_wait_list</varname> is not NULL and
216
<varname>num_event_in_wait_list</varname> is 0, or if event objects in
217
<varname>event_wait_list</varname> are not valid events.
221
<errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
222
resources required by the OpenCL implementation on the host.
228
<!-- ================================ EXAMPLE -->
229
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
231
<refsect2 id="example1">
236
<informaltable frame="none">
237
<tgroup cols="1" align="left" colsep="0" rowsep="0">
238
<colspec colname="col1" colnum="1" />
242
Example goes here - it will be set in "code" type with white space preserved.
251
<!-- ================================ SPECIFICATION -->
252
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
255
<refsect1 id="specification"><title>Specification</title>
256
<para><imageobject><imagedata fileref="pdficon_small1.gif" format="gif" /></imageobject>
257
<olink uri="clEnqueueAcquireDX9MediaSurfacesKHR">OpenCL Specification</olink>
261
<!-- ================================ ALSO SEE -->
263
<refsect1 id="seealso"><title>Also see</title>
265
<citerefentry><refentrytitle>cl_khr_dx9_media_sharing</refentrytitle></citerefentry>,
266
<citerefentry><refentrytitle>clGetDeviceIDsFromDX9MediaAdapterKHR</refentrytitle></citerefentry>,
267
<citerefentry><refentrytitle>clCreateFromDX9MediaSurfaceKHR</refentrytitle></citerefentry>,
268
<citerefentry><refentrytitle>clEnqueueReleaseDX9MediaSurfacesKHR</refentrytitle></citerefentry>,
269
<citerefentry><refentrytitle>clEnqueueAcquireDX9MediaSurfacesKHR</refentrytitle></citerefentry>
273
<!-- ============================== COPYRIGHT -->
274
<!-- Content included from copyright.inc.xsl -->
276
<refsect3 id="Copyright"><title></title>
278
<imagedata fileref="KhronosLogo.jpg" format="jpg" />