@@ -605,9 +605,9 @@ constructed from the built-in <<built-in-scalar-data-types,scalar>>,
605605<<other-built-in-data-types,other>> data types are supported, with specified
606606<<restrictions,restrictions>>.
607607
608- The following tables describe the other built-in data types in OpenCL
609- described in <<table-other-builtin-types>> and the corresponding data type
610- available to the application:
608+ The following tables describe the other built-in data types in OpenCL described
609+ in <<table-other-builtin-types,Other Built-in Data Types >> and the corresponding
610+ data type available to the application:
611611
612612[cols=",",]
613613|====
@@ -639,8 +639,9 @@ available to the application:
639639
640640The data type names described in the following table are reserved and cannot
641641be used by applications as type names.
642- The vector data type names defined in <<table-builtin-vector-types>>, but
643- where _n_ is any value other than 2, 3, 4, 8 and 16, are also reserved.
642+ The vector data type names defined in <<table-builtin-vector-types,Built-in
643+ Vector Data Types>>, but where _n_ is any value other than 2, 3, 4, 8 and 16,
644+ are also reserved.
644645
645646[[table-reserved-types]]
646647.Reserved Data Types
@@ -1031,8 +1032,10 @@ The following names are reserved for use as keywords in OpenCL C and shall
10311032not be used otherwise.
10321033
10331034 * Names reserved as keywords by C99.
1034- * OpenCL C data types defined in <<table-builtin-vector-types>>,
1035- <<table-other-builtin-types>>, and <<table-reserved-types>>.
1035+ * OpenCL C data types defined in <<table-builtin-vector-types,Built-in Vector
1036+ Data Types>>,
1037+ <<table-other-builtin-types,Other Built-in Data Types>>, and
1038+ <<table-reserved-types,Reserved Data Types>>.
10361039 * Address space qualifiers: `{global}`, `global`, `{local}`, `local`,
10371040 `{constant}`, `constant`, `{private}`, and `private`.
10381041 `{generic}` and `generic` are reserved for future use.
@@ -1050,8 +1053,8 @@ not be used otherwise.
10501053=== Implicit Conversions
10511054
10521055Implicit conversions between scalar built-in types defined in
1053- <<table-builtin-scalar-types>> (except `void` and `half`
1054- footnote:[{fn-cl_khr_fp16}]) are supported.
1056+ <<table-builtin-scalar-types,Built-in Scalar Data Types >> (except `void` and
1057+ `half` footnote:[{fn-cl_khr_fp16}]) are supported.
10551058When an implicit conversion is done, it is not just a re-interpretation of
10561059the expression's value but a conversion of that value to an equivalent value
10571060in the new type.
@@ -1073,8 +1076,8 @@ Implicit conversions for pointer types follow the rules described in the
10731076=== Explicit Casts
10741077
10751078Standard typecasts for built-in scalar data types defined in
1076- <<table-builtin-scalar-types>> will perform appropriate conversion (except
1077- `void` and `half` footnote:[{fn-cl_khr_fp16}]).
1079+ <<table-builtin-scalar-types,Built-in Scalar Data Types >> will perform
1080+ appropriate conversion (except `void` and `half` footnote:[{fn-cl_khr_fp16}]).
10781081In the example below:
10791082
10801083[source,opencl_c]
@@ -1374,12 +1377,12 @@ u.d = 1.0; // u.u contains 0x3ff00000 (big endian) or 0
13741377
13751378[open,refpage='as_typen',desc='Reinterpreting Types',type='freeform',spec='clang',anchor='reinterpreting-types-using-as_type-and-as_typen',xrefs='convert_T scalarDataTypes vectorDataTypes']
13761379--
1377- All data types described in <<table-builtin-scalar-types>> and
1378- <<table-builtin-vector-types>> (except `bool`, `void`, and `half`
1379- footnote:[{fn-cl_khr_fp16}]) may be also reinterpreted as another data type of
1380- the same size using the *as_type*() operator for scalar data types and the
1381- *as_type__n__*() operator footnote:[{fn-reinterpret-vector-types}] for vector
1382- data types.
1380+ All data types described in <<table-builtin-scalar-types,Built-in Scalar Data
1381+ Types>> and <<table-builtin-vector-types,Built-in Vector Data Types >> (except
1382+ `bool`, `void`, and `half` footnote:[{fn-cl_khr_fp16}]) may be also
1383+ reinterpreted as another data type of the same size using the *as_type*()
1384+ operator for scalar data types and the *as_type__n__*() operator
1385+ footnote:[{fn-reinterpret-vector-types}] for vector data types.
13831386When the operand and result type contain the same number of elements, the
13841387bits in the operand shall be returned directly without modification as the
13851388new type.
@@ -1804,7 +1807,8 @@ If all three expressions are scalar values, the C99 rules for ternary
18041807operator are followed.
18051808If the result is a vector value, then this is equivalent to calling
18061809*select*(_exp3_, _exp2_, _exp1_).
1807- The *select* function is described in <<table-builtin-relational>>.
1810+ The *select* function is described in <<table-builtin-relational,Built-in Scalar
1811+ and Vector Relational Functions>>.
18081812The second and third expressions can be any type, as long their types match,
18091813or there is an <<implicit-conversions,implicit conversion>> that can be
18101814applied to one of the expressions to make their types match, or one is a
@@ -1950,10 +1954,10 @@ operator (*=*), like
19501954* _lvalue_ = _expression_
19511955
19521956The assignment operator stores the value of _expression_ into _lvalue_.
1953- The _expression_ and _lvalue_ must have the same type, or the expression
1954- must have a type in <<table-builtin-scalar-types>>, in which case an
1955- implicit conversion will be done on the expression before the assignment is
1956- done.
1957+ The _expression_ and _lvalue_ must have the same type, or the expression must
1958+ have a type in <<table-builtin-scalar-types,Built- in Scalar Data Types>>, in
1959+ which case an implicit conversion will be done on the expression before the
1960+ assignment is done.
19571961
19581962If _expression_ is a scalar type and _lvalue_ is a vector type, the scalar
19591963is converted to the element type used by the vector operand.
@@ -2827,12 +2831,12 @@ to OpenCL C with the generic address space.
28272831*Clause 6.2.5 - Types*:
28282832
28292833If address space qualifier on type T is omitted refer to
2830- <<addr-spaces-inference>>.
2834+ <<addr-spaces-inference,Address Space Inference >>.
28312835
28322836*Clause 6.3.2.3 - Pointers*
28332837
2834- Conversions between disjoint address spaces are disallowed in OpenCL
2835- ( <<addr-spaces-conversions>>) .
2838+ Conversions between disjoint address spaces are disallowed in OpenCL,
2839+ refer to <<addr-spaces-conversions,Address Space Conversions>> .
28362840
28372841*Clause 6.5.8 - Relational operators*:
28382842
@@ -3127,7 +3131,7 @@ representation of the computational _width_ of the `{kernel}`, and should
31273131serve as the basis for calculating processor bandwidth utilization when the
31283132compiler is looking to autovectorize the code.
31293133In the `+__attribute__((vec_type_hint(<type>)))+` qualifier <type> is one of
3130- the built-in vector types listed in <<table-builtin-vector-types>> or the
3134+ the built-in vector types listed in <<table-builtin-vector-types,Built-in Vector Data Types >> or the
31313135constituent scalar element types.
31323136If `vec_type_hint (<type>)` is not specified, the kernel is assumed to have
31333137the `+__attribute__((vec_type_hint(int)))+` qualifier.
@@ -3385,9 +3389,9 @@ do_proc (__global char *pA, short b,
33853389 . A function in an OpenCL program cannot be called `main`.
33863390 . Implicit function declaration is not supported.
33873391 . Program scope variables can be defined with any valid OpenCL C data type
3388- except for those in <<table-other-builtin-types>>. Such program scope
3389- variables may be of any user-defined type, or a pointer to a user-defined
3390- type.
3392+ except for those in <<table-other-builtin-types,Other Built-in Data Types>>.
3393+ Such program scope variables may be of any user-defined type, or a pointer
3394+ to a user-defined type.
33913395+
33923396In the presence of shared virtual memory, these pointers or pointer
33933397members should work as expected as long as they are shared virtual memory
@@ -4578,8 +4582,9 @@ The built-in math functions are not affected by the prevailing rounding mode
45784582in the calling environment, and always return the same value as they would
45794583if called with the round to nearest even rounding mode.
45804584
4581- The <<table-builtin-math, following table>> describes the list of built-in
4582- math functions that can take scalar or vector arguments.
4585+ The <<table-builtin-math,Built-in Scalar and Vector Argument Math Functions>>
4586+ table describes the list of built-in math functions that can take scalar or
4587+ vector arguments.
45834588We use the generic type name `gentype` to indicate that the function can take
45844589`float`, `float2`, `float3`, `float4`, `float8`, `float16`, `double`
45854590footnote:double-supported[{fn-double-supported}], `double2`,
@@ -4925,16 +4930,15 @@ all arguments and the return type, unless otherwise specified.
49254930
49264931The following table describes the following functions:
49274932
4928- * A subset of functions from <<table-builtin-math>> that are defined with
4929- the half_ prefix .
4933+ * A subset of functions from <<table-builtin-math,Built-in Scalar and Vector
4934+ Argument Math Functions>> that are defined with the half_ prefix .
49304935 These functions are implemented with a minimum of 10-bits of accuracy,
49314936 i.e. the maximum error value \<= 8192 ulp.
4932- * A subset of functions from <<table-builtin-math>> that are defined with
4933- the native_ prefix.
4937+ * A subset of functions from <<table-builtin-math,Built-in Scalar and Vector
4938+ Argument Math Functions>> that are defined with the native_ prefix.
49344939 These functions may map to one or more native device instructions and
49354940 will typically have better performance compared to the corresponding
4936- functions (without the `+native_+` prefix) described in
4937- <<table-builtin-math>>.
4941+ functions without the `+native_+` prefix).
49384942 The accuracy (and in some cases the input range(s)) of these functions
49394943 is implementation-defined.
49404944 * `+half_+` and `+native_+` functions for following basic operations:
@@ -5629,9 +5633,10 @@ operators (*<*, *\<=*, *>*, *>=*, *!=*, *==*) can be used with scalar and
56295633vector built-in types and produce a scalar or vector signed integer result
56305634respectively.
56315635
5632- The functions described in the <<table-builtin-relational, following table>> can
5633- be used with built-in scalar or vector types as arguments and return a scalar or
5634- vector integer result footnote:[{fn-floating-point-exception-nans}].
5636+ The functions described in the <<table-builtin-relational,Built-in Scalar and
5637+ Vector Relational Functions>> table can be used with built-in scalar or vector
5638+ types as arguments and return a scalar or vector integer result
5639+ footnote:[{fn-floating-point-exception-nans}].
56355640The argument type `gentype` refers to the following built-in types: `char`,
56365641`char__n__`, `uchar`, `uchar__n__`, `short`, `short__n__`, `ushort`,
56375642`ushort__n__`, `int`, `int__n__`, `uint`, `uint__n__`, `long`
@@ -6103,11 +6108,13 @@ The suffix _n_ is also used in the function names (i.e. *vload__n__*,
61036108
61046109The results of vector data load and store functions are undefined if the
61056110address being read from or written to is not correctly aligned as described
6106- in <<table-vector-loadstore>>.
6111+ in <<table-vector-loadstore,Built-in Vector Data Load and Store Functions >>.
61076112The pointer argument p can be a pointer to `global`, `local`, or `private`
6108- memory for store functions described in <<table-vector-loadstore>>.
6113+ memory for store functions described in <<table-vector-loadstore,Built-in Vector
6114+ Data Load and Store Functions>>.
61096115The pointer argument p can be a pointer to `global`, `local`, `constant`, or
6110- `private` memory for load functions described in <<table-vector-loadstore>>.
6116+ `private` memory for load functions described in
6117+ <<table-vector-loadstore,Built-in Vector Data Load and Store Functions>>.
61116118
61126119[NOTE]
61136120====
@@ -9835,9 +9842,9 @@ For query functions this may be `read_only`, `write_only` or `read_write`.
98359842|====
98369843
98379844The values returned by *get_image_channel_data_type* and
9838- *get_image_channel_order* as specified in <<table-image-query>> with the
9839- `CLK_` prefixes correspond to the `CL_` prefixes used to describe the
9840- <<opencl-channel-order,image channel order>> and
9845+ *get_image_channel_order* as specified in <<table-image-query,Built-in Image
9846+ Query Functions>> with the `CLK_` prefixes correspond to the `CL_` prefixes used
9847+ to describe the <<opencl-channel-order,image channel order>> and
98419848<<opencl-channel-data-type,data type>> in the <<opencl-spec,OpenCL
98429849Specification>>.
98439850For example, both `CL_UNORM_INT8` and `CLK_UNORM_INT8` refer to an image
@@ -11611,10 +11618,12 @@ as ULP values if the `-cl-unsafe-math-optimizations` compiler option is
1161111618specified when compiling or building an OpenCL program.
1161211619For derived implementations, the operations used in the derivation may
1161311620themselves be relaxed according to the following table.
11614- The minimum accuracy of math functions not defined in the following table
11615- when the `-cl-unsafe-math-optimizations` compiler option is specified is as defined
11616- in <<table-ulp-float-math>> when operating in the full profile, and as
11617- defined in <<table-ulp-embedded>> when operating in the embedded profile.
11621+ The minimum accuracy of math functions not defined in the following table when
11622+ the `-cl-unsafe-math-optimizations` compiler option is specified is as defined
11623+ in <<table-ulp-float-math,ULP values for single precision built-in math
11624+ functions>> when operating in the full profile, and as defined in
11625+ <<table-ulp-embedded,ULP values for the embedded profile>> when operating in the
11626+ embedded profile.
1161811627The reference value used to compute the ULP value of an arithmetic operation
1161911628is the infinitely precise result.
11620116290 ulp is used for math functions that do not require rounding.
0 commit comments