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">
10
<keyword>vstorea_halfn</keyword>
15
<refentrytitle>vstorea_halfn</refentrytitle>
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>
31
<manvolnum>3</manvolnum>
34
<!-- ================================ SYNOPSIS -->
36
<refnamediv id="vstorea_halfn">
37
<refname>vstorea_half<varname>n</varname></refname>
40
Convert float vector to half vector and write to a pointer to memory.
44
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
48
<link xlink:href="scalarDataTypes.html">void</link>
50
vstorea_half<replaceable>n</replaceable>
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>
62
<link xlink:href="scalarDataTypes.html">void</link>
64
vstorea_half<replaceable>n</replaceable>_rte
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>
76
<link xlink:href="scalarDataTypes.html">void</link>
78
vstorea_half<replaceable>n</replaceable>_rtz
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>
90
<link xlink:href="scalarDataTypes.html">void</link>
92
vstorea_half<replaceable>n</replaceable>_rtp
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>
104
<link xlink:href="scalarDataTypes.html">void</link>
106
vstorea_half<replaceable>n</replaceable>_rtn
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>
116
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
120
<link xlink:href="scalarDataTypes.html">void</link>
122
vstorea_half<replaceable>n</replaceable>
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>
134
<link xlink:href="scalarDataTypes.html">void</link>
136
vstorea_half<replaceable>n</replaceable>_rte
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>
148
<link xlink:href="scalarDataTypes.html">void</link>
150
vstorea_half<replaceable>n</replaceable>_rtz
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>
162
<link xlink:href="scalarDataTypes.html">void</link>
164
vstorea_half<replaceable>n</replaceable>_rtp
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>
176
<link xlink:href="scalarDataTypes.html">void</link>
178
vstorea_half<replaceable>n</replaceable>_rtn
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>
188
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
192
<link xlink:href="scalarDataTypes.html">void</link>
194
vstorea_half<replaceable>n</replaceable>
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>
206
<link xlink:href="scalarDataTypes.html">void</link>
208
vstorea_half<replaceable>n</replaceable>_rte
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>
220
<link xlink:href="scalarDataTypes.html">void</link>
222
vstorea_half<replaceable>n</replaceable>_rtz
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>
234
<link xlink:href="scalarDataTypes.html">void</link>
236
vstorea_half<replaceable>n_rtp</replaceable>
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>
248
<link xlink:href="scalarDataTypes.html">void</link>
250
vstorea_half<replaceable>n_rtn</replaceable>
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>
260
<refsect2 id="double">
263
<informaltable frame="none">
264
<tgroup cols="1" align="left" colsep="0" rowsep="0">
265
<colspec colname="col1" colnum="1" />
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>.
278
<!-- ================================ DESCRIPTION -->
280
<refsect1 id="description"><title>Description</title>
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.
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.
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.
303
<function>vstorea_half<replaceable>n</replaceable></function> uses the default rounding
304
mode. The default rounding mode is round to the nearest even.
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.
315
<!-- ================================ NOTES -->
317
<refsect1 id="notes"><title>Notes</title>
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)).
328
<!-- ================================ EXAMPLE -->
329
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
331
<refsect2 id="example1">
336
<informaltable frame="none">
337
<tgroup cols="1" align="left" colsep="0" rowsep="0">
338
<colspec colname="col1" colnum="1" />
342
Example goes here - it will be set in "code" type with white space preserved.
351
<!-- ================================ SPECIFICATION -->
352
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
354
<refsect1 id="specification"><title>Specification</title>
357
<imagedata fileref="pdficon_small1.gif" format="gif" />
360
<olink uri="vectorDataLoadandStoreFunctions">OpenCL Specification</olink>
364
<!-- ================================ ALSO SEE -->
366
<refsect1 id="seealso"><title>Also see</title>
368
<citerefentry href="vectorDataLoadandStoreFunctions"><refentrytitle>Vector Data Load and Store Functions</refentrytitle></citerefentry>
372
<!-- ============================== COPYRIGHT -->
373
<!-- Content included from copyright.inc.xsl -->
375
<refsect3 id="Copyright"><title></title>
377
<imagedata fileref="KhronosLogo.jpg" format="jpg" />