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 geometricFunctionsInc SYSTEM "geometricFunctionsInc.xml">
10
<keyword>length</keyword>
15
<refentrytitle>length</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="length">
37
<refname>length</refname>
44
<refsynopsisdiv xmlns:xlink="http://www.w3.org/1999/xlink"><title></title>
48
<link xlink:href="scalarDataTypes.html">float</link>
53
<paramdef><link xlink:href="vectorDataTypes.html">float<replaceable>n</replaceable></link><parameter>p</parameter></paramdef>
60
<link xlink:href="scalarDataTypes.html">double</link>
65
<!-- !!! The following line might be a typo in the 1.2 spec. Spec says gentype when it may have meant double. -->
66
<paramdef><link xlink:href="vectorDataTypes.html">double<replaceable>n</replaceable></link><parameter>p</parameter></paramdef>
71
<!-- Optional Half prototypes -->
73
<refsect2 xmlns:xlink="http://www.w3.org/1999/xlink" id="double">
76
<informaltable frame="none">
77
<tgroup cols="1" align="left" colsep="0" rowsep="0">
78
<colspec colname="col1" colnum="1" />
82
<type><link xlink:href="scalarDataTypes.html">half</link></type> <function>length</function> (<type>gentype</type> <varname>p</varname>) // if half extension enabled
90
<!-- ================================ DESCRIPTION -->
92
<refsect1 id="description"><title>Description</title>
94
Returns the length of vector <varname>p</varname>, i.e., the square
95
root of (<emphasis>p.x</emphasis><superscript>2</superscript> +
96
<emphasis>p.y</emphasis><superscript>2</superscript> + ...)
100
<!-- ================================ NOTES -->
102
<refsect1 id="notes"><title>Notes</title>
104
&geometricFunctionsInc;
107
If extended with <citerefentry><refentrytitle>cl_khr_fp16</refentrytitle></citerefentry>,
108
generic type name <type>gentype</type> may indicate <type>half</type> and
109
<type>half{2|3|4}</type> as arguments.
113
<!-- ================================ EXAMPLE -->
114
<!-- DO NOT DELETE IN CASE AN EXAMPLE IS ADDED IN THE FUTURE -->
116
<refsect2 id="example1">
121
<informaltable frame="none">
122
<tgroup cols="1" align="left" colsep="0" rowsep="0">
123
<colspec colname="col1" colnum="1" />
127
Example goes here - it will be set in "code" type with white space preserved.
136
<!-- ================================ SPECIFICATION -->
137
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
139
<refsect1 id="specification"><title>Specification</title>
142
<imagedata fileref="pdficon_small1.gif" format="gif" />
145
<olink uri="geometricFunctions">OpenCL Specification</olink>
149
<!-- ================================ ALSO SEE -->
151
<refsect1 id="seealso"><title>Also see</title>
153
<citerefentry href="geometricFunctions"><refentrytitle>Geometric Functions</refentrytitle></citerefentry>
157
<!-- ============================== COPYRIGHT -->
158
<!-- Content included from copyright.inc.xsl -->
160
<refsect3 id="Copyright"><title></title>
162
<imagedata fileref="KhronosLogo.jpg" format="jpg" />