blob: 0ee2cd577799900fc0b3eadff4fb342514186c95 [file] [log] [blame]
Jon Leech932ed552016-12-09 04:38:24 -08001<?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 map_flags_Inc SYSTEM "map_flags_Inc.xml">
5]>
6
7<refentry>
8 <refentryinfo>
9 <keywordset>
10 <keyword>clEnqueueSVMMap</keyword>
11 </keywordset>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>
16 clEnqueueSVMMap
17 </refentrytitle>
18
19 <refmiscinfo>
20 <copyright>
21 <year>2007-2013</year>
22 <holder>The Khronos Group Inc.
23 Permission is hereby granted, free of charge, to any person obtaining a
24copy of this software and/or associated documentation files (the
25"Materials"), to deal in the Materials without restriction, including
26without limitation the rights to use, copy, modify, merge, publish,
27distribute, sublicense, and/or sell copies of the Materials, and to
28permit persons to whom the Materials are furnished to do so, subject to
29the condition that this copyright notice and permission notice shall be included
30in all copies or substantial portions of the Materials.</holder>
31 </copyright>
32 </refmiscinfo>
33 <manvolnum>3</manvolnum>
34 </refmeta>
35
36<!-- ================================ SYNOPSIS -->
37
38 <refnamediv id="clEnqueueSVMMap">
39 <refname>
40 clEnqueueSVMMap
41 </refname>
42
43 <refpurpose>
44 Enqueues a command that will allow the host to update a region of a SVM buffer
45 </refpurpose>
46 </refnamediv>
47
48 <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
49 <funcsynopsis>
50 <funcprototype>
51 <funcdef>
52 <link xlink:href="scalarDataTypes.html">cl_int</link> <function>clEnqueueSVMMap</function>
53 </funcdef>
54 <paramdef><link xlink:href="abstractDataTypes.html">cl_command_queue</link><parameter>command_queue</parameter></paramdef>
55 <paramdef><link xlink:href="enums.html#cl_bool">cl_bool</link><parameter>blocking_map</parameter></paramdef>
56 <paramdef><link xlink:href="enums.html#cl_map_flags">cl_map_flags</link><parameter>map_flags</parameter></paramdef>
57 <paramdef><link xlink:href="scalarDataTypes.html">void</link><parameter>*svm_ptr</parameter></paramdef>
58 <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>size</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 Must be a valid host command-queue.
77 </para>
78 </listitem>
79 </varlistentry>
80
81 <varlistentry>
82 <term> <varname> blocking_map </varname> </term>
83 <listitem>
84 <para>
85 Indicates if the map operation is <varname>blocking</varname> or
86 <varname>non-blocking</varname>.
87 </para>
88
89 <para>
90 If <varname>blocking_map</varname> is <constant>CL_TRUE</constant>,
91 <function>clEnqueueSVMMap</function> does not return until the application can
92 access the contents of the SVM region specified by
93 <varname>svm_ptr</varname> and <varname>size</varname> on the host.
94 </para>
95
96 <para>
97 If <varname>blocking_map</varname> is <constant>CL_FALSE</constant>
98 i.e. map operation is non-blocking, the region specified by
99 <varname>svm_ptr</varname> and <varname>size</varname>
100 cannot be used until the map command has completed.
101 The <varname>event</varname> argument
102 returns an event object which can be used to query
103 the execution status of the map command.
104 When the map command is completed, the application
105 can access the contents of the region
106 specified by <varname>svm_ptr</varname> and
107 <varname>size</varname>.
108 </para>
109 </listitem>
110 </varlistentry>
111
112<!-- ================================ PARAMETER TABLE (OPTIONAL) -->
113<!-- DELETE IF NOT NEEDED -->
114<!-- Use this if parameter information requires a table. Adjust the number of columns by adjusting
115<colspec /> tags. Column header goes in the <thead /> section. Delte the section if no column head needed.
116-->
117 <varlistentry>
118 <term><varname>map_flags</varname></term>
119 <listitem>
120 <para>
121 A bit-bield with the following supported values.
122 </para>
123
124 &map_flags_Inc;
125
126 </listitem>
127 </varlistentry>
128
129 <varlistentry>
130 <term><varname>svm_ptr</varname> and <varname>size</varname></term>
131 <listitem>
132 <para>
133 A pointer to a memory region and size in bytes
134 that will be updated by the
135 host. If <varname>svm_ptr</varname> is allocated using
136 <citerefentry><refentrytitle>clSVMAlloc</refentrytitle></citerefentry>
137 then it must be allocated from the same context
138 from which <varname>command_queue</varname> was created.
139 Otherwise the behavior is undefined.
140 </para>
141 </listitem>
142 </varlistentry>
143
144 <varlistentry>
145 <term>
146 <varname>
147 event_wait_list,
148 </varname>
149 <varname>
150 num_events_in_wait_list
151 </varname>
152 </term>
153
154 <listitem>
155 <para>
156 Specify events that need to complete before this particular
157 command can be executed. If <varname>event_wait_list</varname>
158 is NULL, then this particular command does not wait on any
159 event to complete. If <varname>event_wait_list</varname> is
160 NULL, <varname>num_events_in_wait_list</varname> must be 0. If
161 <varname>event_wait_list</varname> is not NULL, the list of events
162 pointed to by <varname>event_wait_list</varname> must be valid
163 and <varname>num_events_in_wait_list</varname> must be greater
164 than 0. The events specified in <varname>event_wait_list</varname>
165 act as synchronization points. The context associated with events in
166 <varname>event_wait_list</varname> and <varname>command_queue</varname> must
167 be the same. The memory associated with <varname>event_wait_list</varname>
168 can be reused or freed after the function returns.
169 </para>
170 </listitem>
171 </varlistentry>
172
173 <varlistentry>
174 <term> <varname> event </varname> </term>
175 <listitem>
176 <para>
177 Returns an event object that identifies this particular command
178 and can be used to query or queue a wait for this particular command
179 to complete. <varname>event</varname> can be NULL in which case
180 it will not be possible for the application to query the status of
181 this command or queue a wait for this command to complete.
182 <citerefentry><refentrytitle>clEnqueueBarrierWithWaitList</refentrytitle></citerefentry>
183 can be used instead. If the
184 <varname>event_wait_list</varname> and the <varname>event</varname>
185 arguments are not NULL, the <varname>event</varname> argument should not
186 refer to an element of the <varname>event_wait_list</varname> array.
187 </para>
188 </listitem>
189 </varlistentry>
190
191 </variablelist>
192 </refsect1>
193
194<!-- ================================ NOTES -->
195
196 <refsect1 id="notes"><title>Notes</title>
197 <para>
198 Note that
199 since we are enqueuing a command with a SVM buffer, the region is already mapped in the host
200 address space.
201 </para>
202
203 <para>
204 <citerefentry><refentrytitle>clEnqueueSVMMap</refentrytitle></citerefentry>, and
205 <citerefentry><refentrytitle>clEnqueueSVMUnmap</refentrytitle></citerefentry>
206 act as synchronization points for the region
207 of the SVM buffer specified in these calls.
208 </para>
209
210 </refsect1>
211
212<!-- ================================ ERRORS -->
213
214 <refsect1 id="errors"><title>Errors</title>
215 <para>
216 <function>clEnqueueSVMMap</function> returns <constant>CL_SUCCESS</constant>
217 if the function is executed successfully. Otherwise,
218 it returns one of the following errors:
219 </para>
220
221 <itemizedlist mark="disc">
222 <listitem>
223 <errorname>CL_INVALID_COMMAND_QUEUE</errorname> if <varname>command_queue</varname>
224 is not a valid host command-queue.
225 </listitem>
226
227 <listitem>
228 <errorname>CL_INVALID_CONTEXT</errorname> if the context associated with
229 <varname>command_queue</varname>
230 and events in <varname>event_wait_list</varname> are not the same.
231 </listitem>
232
233 <listitem>
234 <errorname>CL_INVALID_VALUE</errorname> if <varname>svm_ptr</varname> is NULL.
235 </listitem>
236
237 <listitem>
238 <errorname>CL_INVALID_VALUE</errorname> if <varname>size</varname>
239 is 0 or if values specified in <varname>map_flags</varname> are not valid.
240 </listitem>
241
242 <listitem>
243 <errorname>CL_INVALID_EVENT_WAIT_LIST</errorname>
244 if <varname>event_wait_list</varname> is NULL and
245 <varname>num_events_in_wait_list</varname> &gt; 0,
246 or <varname>event_wait_list</varname> is not NULL and
247 <varname>num_events_in_wait_list</varname> is 0, or if event objects in
248 <varname>event_wait_list</varname> are not valid events.
249 </listitem>
250
251 <listitem>
252 <errorname>CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST</errorname>
253 if the map operation is
254 blocking and the execution status of any of the
255 events in <varname>event_wait_list</varname> is a negative
256 integer value.
257 </listitem>
258
259 <listitem>
260 <errorname>CL_OUT_OF_RESOURCES</errorname> if there is a failure to allocate
261 resources required by the OpenCL implementation on the device.
262 </listitem>
263
264 <listitem>
265 <errorname>CL_OUT_OF_HOST_MEMORY</errorname> if there is a failure to allocate
266 resources required by the OpenCL implementation on the host.
267 </listitem>
268 </itemizedlist>
269 </refsect1>
270
271<!-- ================================ EXAMPLE -->
272<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
273<!--
274 <refsect2 id="example1">
275 <title>
276 Example
277 </title>
278
279 <informaltable frame="none">
280 <tgroup cols="1" align="left" colsep="0" rowsep="0">
281 <colspec colname="col1" colnum="1" />
282 <tbody>
283 <row>
284 <entry>
285 Example goes here - it will be set in "code" type with white space preserved.
286 </entry>
287 </row>
288 </tbody>
289 </tgroup>
290 </informaltable>
291 </refsect2>
292-->
293
294<!-- ================================ SPECIFICATION -->
295<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
296-->
297 <refsect1 id="specification"><title>Specification</title>
298 <para>
299 <imageobject>
300 <imagedata fileref="pdficon_small1.gif" format="gif" />
301 </imageobject>
302
303 <olink uri="clEnqueueSVMMap">OpenCL Specification</olink>
304 </para>
305 </refsect1>
306
307<!-- ================================ ALSO SEE -->
308
309 <refsect1 id="seealso"><title>Also see</title>
310 <para>
311 <citerefentry href="sharedVirtualMemory"><refentrytitle>Shared Virtual Memory Functions</refentrytitle></citerefentry>
312 </para>
313 </refsect1>
314
315<!-- ================================ COPYRIGHT -->
316<!-- Content included from copyright.inc.xsl -->
317
318 <refsect3 id="Copyright"><title></title>
319 <imageobject>
320 <imagedata fileref="KhronosLogo.jpg" format="jpg" />
321 </imageobject>
322 <para />
323 </refsect3>
324
325<!-- 9-Dec-2013, rev. 19 -->
326</refentry>
327