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

« back to all changes in this revision

Viewing changes to vstorea_halfn.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
<!ENTITY vectorFunctionsInc SYSTEM "vectorFunctionsInc.xml">
 
5
]>
 
6
 
 
7
<refentry>
 
8
    <refentryinfo>
 
9
        <keywordset>
 
10
            <keyword>vstorea_halfn</keyword>
 
11
        </keywordset>
 
12
    </refentryinfo>
 
13
 
 
14
    <refmeta>
 
15
        <refentrytitle>vstorea_halfn</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="vstorea_halfn">
 
37
        <refname>vstorea_half<varname>n</varname></refname>
 
38
 
 
39
        <refpurpose>
 
40
            Convert float vector to half vector and write to a pointer to memory.
 
41
        </refpurpose>
 
42
    </refnamediv>
 
43
 
 
44
    <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
 
45
        <funcsynopsis>
 
46
            <funcprototype>
 
47
                <funcdef>
 
48
                    <link xlink:href="scalarDataTypes.html">void</link>
 
49
                    <function>
 
50
                        vstorea_half<replaceable>n</replaceable>
 
51
                    </function>
 
52
                </funcdef>
 
53
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
54
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
55
                <paramdef><link xlink:href="global.html">__global</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
56
            </funcprototype>
 
57
        </funcsynopsis>
 
58
 
 
59
        <funcsynopsis>
 
60
            <funcprototype>
 
61
                <funcdef>
 
62
                    <link xlink:href="scalarDataTypes.html">void</link>
 
63
                    <function>
 
64
                        vstorea_half<replaceable>n</replaceable>_rte
 
65
                    </function>
 
66
                </funcdef>
 
67
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
68
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
69
                <paramdef><link xlink:href="global.html">__global</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
70
            </funcprototype>
 
71
        </funcsynopsis>
 
72
 
 
73
        <funcsynopsis>
 
74
            <funcprototype>
 
75
                <funcdef>
 
76
                    <link xlink:href="scalarDataTypes.html">void</link>
 
77
                    <function>
 
78
                        vstorea_half<replaceable>n</replaceable>_rtz
 
79
                    </function>
 
80
                </funcdef>
 
81
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
82
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
83
                <paramdef><link xlink:href="global.html">__global</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
84
            </funcprototype>
 
85
        </funcsynopsis>
 
86
 
 
87
        <funcsynopsis>
 
88
            <funcprototype>
 
89
                <funcdef>
 
90
                    <link xlink:href="scalarDataTypes.html">void</link>
 
91
                    <function>
 
92
                        vstorea_half<replaceable>n</replaceable>_rtp
 
93
                    </function>
 
94
                </funcdef>
 
95
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
96
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
97
                <paramdef><link xlink:href="global.html">__global</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
98
            </funcprototype>
 
99
        </funcsynopsis>
 
100
 
 
101
        <funcsynopsis>
 
102
            <funcprototype>
 
103
                <funcdef>
 
104
                    <link xlink:href="scalarDataTypes.html">void</link>
 
105
                    <function>
 
106
                        vstorea_half<replaceable>n</replaceable>_rtn
 
107
                    </function>
 
108
                </funcdef>
 
109
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
110
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
111
                <paramdef><link xlink:href="global.html">__global</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
112
            </funcprototype>
 
113
        </funcsynopsis>
 
114
    </refsynopsisdiv>
 
115
 
 
116
    <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
 
117
        <funcsynopsis>
 
118
            <funcprototype>
 
119
                <funcdef>
 
120
                    <link xlink:href="scalarDataTypes.html">void</link>
 
121
                    <function>
 
122
                        vstorea_half<replaceable>n</replaceable>
 
123
                    </function>
 
124
                </funcdef>
 
125
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
126
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
127
                <paramdef><link xlink:href="local.html">__local</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
128
            </funcprototype>
 
129
        </funcsynopsis>
 
130
 
 
131
        <funcsynopsis>
 
132
            <funcprototype>
 
133
                <funcdef>
 
134
                    <link xlink:href="scalarDataTypes.html">void</link>
 
135
                    <function>
 
136
                        vstorea_half<replaceable>n</replaceable>_rte
 
137
                    </function>
 
138
                </funcdef>
 
139
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
140
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
141
                <paramdef><link xlink:href="local.html">__local</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
142
            </funcprototype>
 
143
        </funcsynopsis>
 
144
 
 
145
        <funcsynopsis>
 
146
            <funcprototype>
 
147
                <funcdef>
 
148
                    <link xlink:href="scalarDataTypes.html">void</link>
 
149
                    <function>
 
150
                        vstorea_half<replaceable>n</replaceable>_rtz
 
151
                    </function>
 
152
                </funcdef>
 
153
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
154
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
155
                <paramdef><link xlink:href="local.html">__local</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
156
            </funcprototype>
 
157
        </funcsynopsis>
 
158
 
 
159
        <funcsynopsis>
 
160
            <funcprototype>
 
161
                <funcdef>
 
162
                    <link xlink:href="scalarDataTypes.html">void</link>
 
163
                    <function>
 
164
                        vstorea_half<replaceable>n</replaceable>_rtp
 
165
                    </function>
 
166
                </funcdef>
 
167
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
168
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
169
                <paramdef><link xlink:href="local.html">__local</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
170
            </funcprototype>
 
171
        </funcsynopsis>
 
172
 
 
173
        <funcsynopsis>
 
174
            <funcprototype>
 
175
                <funcdef>
 
176
                    <link xlink:href="scalarDataTypes.html">void</link>
 
177
                    <function>
 
178
                        vstorea_half<replaceable>n</replaceable>_rtn
 
179
                    </function>
 
180
                </funcdef>
 
181
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
182
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
183
                <paramdef><link xlink:href="local.html">__local</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
184
            </funcprototype>
 
185
        </funcsynopsis>
 
186
    </refsynopsisdiv>
 
187
 
 
188
    <refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
 
189
        <funcsynopsis>
 
190
            <funcprototype>
 
191
                <funcdef>
 
192
                    <link xlink:href="scalarDataTypes.html">void</link>
 
193
                    <function>
 
194
                        vstorea_half<replaceable>n</replaceable>
 
195
                    </function>
 
196
                </funcdef>
 
197
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
198
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
199
                <paramdef><link xlink:href="private.html">__private</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
200
            </funcprototype>
 
201
        </funcsynopsis>
 
202
 
 
203
        <funcsynopsis>
 
204
            <funcprototype>
 
205
                <funcdef>
 
206
                    <link xlink:href="scalarDataTypes.html">void</link>
 
207
                    <function>
 
208
                        vstorea_half<replaceable>n</replaceable>_rte
 
209
                    </function>
 
210
                </funcdef>
 
211
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
212
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
213
                <paramdef><link xlink:href="private.html">__private</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
214
            </funcprototype>
 
215
        </funcsynopsis>
 
216
 
 
217
        <funcsynopsis>
 
218
            <funcprototype>
 
219
                <funcdef>
 
220
                    <link xlink:href="scalarDataTypes.html">void</link>
 
221
                    <function>
 
222
                        vstorea_half<replaceable>n</replaceable>_rtz
 
223
                    </function>
 
224
                </funcdef>
 
225
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
226
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
227
                <paramdef><link xlink:href="private.html">__private</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
228
            </funcprototype>
 
229
        </funcsynopsis>
 
230
 
 
231
        <funcsynopsis>
 
232
            <funcprototype>
 
233
                <funcdef>
 
234
                    <link xlink:href="scalarDataTypes.html">void</link>
 
235
                    <function>
 
236
                        vstorea_half<replaceable>n_rtp</replaceable>
 
237
                    </function>
 
238
                </funcdef>
 
239
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
240
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
241
                <paramdef><link xlink:href="private.html">__private</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
242
            </funcprototype>
 
243
        </funcsynopsis>
 
244
 
 
245
        <funcsynopsis>
 
246
            <funcprototype>
 
247
                <funcdef>
 
248
                    <link xlink:href="scalarDataTypes.html">void</link>
 
249
                    <function>
 
250
                        vstorea_half<replaceable>n_rtn</replaceable>
 
251
                    </function>
 
252
                </funcdef>
 
253
                <paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>data</parameter></paramdef>
 
254
                <paramdef><link xlink:href="scalarDataTypes.html">size_t</link><parameter>offset</parameter></paramdef>
 
255
                <paramdef><link xlink:href="private.html">__private</link> <link xlink:href="scalarDataTypes.html">half</link><parameter>*p</parameter></paramdef>
 
256
            </funcprototype>
 
257
        </funcsynopsis>
 
258
    </refsynopsisdiv>
 
259
 
 
260
    <refsect2 id="double">
 
261
        <title></title>
 
262
 
 
263
        <informaltable frame="none">
 
264
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
265
                <colspec colname="col1" colnum="1" />
 
266
                <tbody>
 
267
                    <row>
 
268
                        <entry>
 
269
If the optional double is supported, you may use <type>double<replaceable>n</replaceable></type>
 
270
instead of <type>float<replaceable>n</replaceable></type>.
 
271
                        </entry>
 
272
                    </row>
 
273
                </tbody>
 
274
            </tgroup>
 
275
        </informaltable>
 
276
    </refsect2>
 
277
 
 
278
<!-- ================================ DESCRIPTION  -->
 
279
 
 
280
    <refsect1 id="description"><title>Description</title>
 
281
      <para>
 
282
        The <type>float<replaceable>n</replaceable></type> (or <type>double<replaceable>n</replaceable></type> if
 
283
        optional double is supported) value igiven by <varname>data</varname> is converted to
 
284
        a <type>half<replaceable>n</replaceable></type> value using the appropriate rounding mode.
 
285
      </para>
 
286
 
 
287
      <para>
 
288
        For <replaceable>n</replaceable> = 1, 2, 4, 8 and 16, the <type>half<replaceable>n</replaceable></type>
 
289
        value is written to the address computed as (<varname>p</varname> +
 
290
        (<varname>offset</varname> * <varname>n</varname>)). The address computed as
 
291
        (<varname>p</varname> + (<varname>offset</varname> * <varname>n</varname>)) must be
 
292
        aligned to sizeof (half<replaceable>n</replaceable>) bytes.
 
293
      </para>
 
294
 
 
295
      <para>
 
296
        For <replaceable>n</replaceable> = 3, the  <type>half3</type> value is
 
297
        written to the address computed as (<varname>p</varname> + (<varname>offset</varname>
 
298
        * 4)). The address computed as (<varname>p</varname> + (<varname>offset</varname> *
 
299
        4)) must be aligned to sizeof (half) * 4 bytes.
 
300
      </para>
 
301
 
 
302
      <para>
 
303
        <function>vstorea_half<replaceable>n</replaceable></function> uses the default rounding
 
304
        mode. The default rounding mode is round to the nearest even.
 
305
      </para>
 
306
 
 
307
      <para>
 
308
        An application that wants to use <type>half</type> and
 
309
        <type>half<replaceable>n</replaceable></type> types will need to include the <code>#pragma
 
310
        OPENCL EXTENSION <citerefentry><refentrytitle>cl_khr_fp16</refentrytitle></citerefentry>
 
311
        : enable</code> directive.
 
312
      </para>
 
313
    </refsect1>
 
314
 
 
315
<!-- ================================ NOTES  -->
 
316
 
 
317
    <refsect1 id="notes"><title>Notes</title>
 
318
 
 
319
        &vectorFunctionsInc;
 
320
 
 
321
        <para>
 
322
          <function>vstorea_half3</function> writes <varname>x</varname>, <varname>y</varname>,
 
323
          <varname>z</varname> components from a 3-component vector to address
 
324
          (<varname>p</varname> + (<varname>offset</varname> * 4)).
 
325
        </para>
 
326
    </refsect1>
 
327
 
 
328
<!-- ================================ EXAMPLE  -->
 
329
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
 
330
<!--
 
331
    <refsect2 id="example1">
 
332
        <title>
 
333
            Example
 
334
        </title>
 
335
 
 
336
        <informaltable frame="none">
 
337
            <tgroup cols="1" align="left" colsep="0" rowsep="0">
 
338
                <colspec colname="col1" colnum="1" />
 
339
                <tbody>
 
340
                    <row>
 
341
                        <entry>
 
342
                            Example goes here - it will be set in "code" type with white space preserved.
 
343
                        </entry>
 
344
                    </row>
 
345
                </tbody>
 
346
            </tgroup>
 
347
        </informaltable>
 
348
    </refsect2>
 
349
-->
 
350
 
 
351
<!-- ================================ SPECIFICATION  -->
 
352
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
353
-->
 
354
    <refsect1 id="specification"><title>Specification</title>
 
355
        <para>
 
356
            <imageobject>
 
357
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
358
            </imageobject>
 
359
 
 
360
            <olink uri="vectorDataLoadandStoreFunctions">OpenCL Specification</olink>
 
361
        </para>
 
362
    </refsect1>
 
363
 
 
364
<!-- ================================ ALSO SEE  -->
 
365
 
 
366
    <refsect1 id="seealso"><title>Also see</title>
 
367
        <para>
 
368
            <citerefentry href="vectorDataLoadandStoreFunctions"><refentrytitle>Vector Data Load and Store Functions</refentrytitle></citerefentry>
 
369
        </para>
 
370
    </refsect1>
 
371
 
 
372
<!-- ============================== COPYRIGHT -->
 
373
<!-- Content included from copyright.inc.xsl -->
 
374
 
 
375
    <refsect3 id="Copyright"><title></title>
 
376
        <imageobject>
 
377
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
378
        </imageobject>
 
379
        <para />
 
380
    </refsect3>
 
381
 
 
382
<!-- 13-Oct-2011 -->
 
383
</refentry>
 
384