@@ -1805,7 +1805,7 @@ When converting from a floating-point type to integer type, the behavior is
1805
1805
implementation-defined.
1806
1806
1807
1807
Conversions to integer type may opt to convert using the optional saturated
1808
- mode by appending the _sat modifier to the conversion function name.
1808
+ mode by appending the ` _sat` modifier to the conversion function name.
1809
1809
When in saturated mode, values that are outside the representable range
1810
1810
shall clamp to the nearest representable value in the destination format.
1811
1811
(NaN should be converted to 0).
@@ -11604,19 +11604,19 @@ uint4 read_imageui(
11604
11604
*read_imagei* can only be used with image objects created with
11605
11605
_image_channel_data_type_ set to one of the following values:
11606
11606
11607
- * {CL_SIGNED_INT8},
11608
- * {CL_SIGNED_INT16}, and
11609
- * {CL_SIGNED_INT32}.
11607
+ {CL_SIGNED_INT8}, +
11608
+ {CL_SIGNED_INT16} and +
11609
+ {CL_SIGNED_INT32}.
11610
11610
11611
11611
If the _image_channel_data_type_ is not one of the above values, the
11612
11612
values returned by *read_imagei* are undefined.
11613
11613
11614
11614
*read_imageui* can only be used with image objects created with
11615
11615
_image_channel_data_type_ set to one of the following values:
11616
11616
11617
- * {CL_UNSIGNED_INT8},
11618
- * {CL_UNSIGNED_INT16}, and
11619
- * {CL_UNSIGNED_INT32}.
11617
+ {CL_UNSIGNED_INT8}, +
11618
+ {CL_UNSIGNED_INT16} and +
11619
+ {CL_UNSIGNED_INT32}.
11620
11620
11621
11621
If the _image_channel_data_type_ is not one of the above values, the
11622
11622
values returned by *read_imageui* are undefined.
@@ -11675,19 +11675,19 @@ uint4 read_imageui(
11675
11675
*read_imagei* can only be used with image objects created with
11676
11676
_image_channel_data_type_ set to one of the following values:
11677
11677
11678
- * {CL_SIGNED_INT8},
11679
- * {CL_SIGNED_INT16}, and
11680
- * {CL_SIGNED_INT32}.
11678
+ {CL_SIGNED_INT8}, +
11679
+ {CL_SIGNED_INT16} and +
11680
+ {CL_SIGNED_INT32}.
11681
11681
11682
11682
If the _image_channel_data_type_ is not one of the above values, the
11683
11683
values returned by *read_imagei* are undefined.
11684
11684
11685
11685
*read_imageui* can only be used with image objects created with
11686
11686
_image_channel_data_type_ set to one of the following values:
11687
11687
11688
- * {CL_UNSIGNED_INT8},
11689
- * {CL_UNSIGNED_INT16}, and
11690
- * {CL_UNSIGNED_INT32}.
11688
+ {CL_UNSIGNED_INT8}, +
11689
+ {CL_UNSIGNED_INT16} and +
11690
+ {CL_UNSIGNED_INT32}.
11691
11691
11692
11692
If the _image_channel_data_type_ is not one of the above values, the
11693
11693
values returned by *read_imageui* are undefined.
@@ -11719,11 +11719,12 @@ float read_imagef(
11719
11719
<<unified-spec, Requires>> support for the
11720
11720
{cl_khr_gl_msaa_sharing_EXT} extension macro.
11721
11721
a|
11722
- [source,c ]
11722
+ [source,opencl_c ]
11723
11723
----
11724
- float read_imagef(image2d_array_msaaa_depth_t image,
11725
- int4 coord,
11726
- int sample)
11724
+ float read_imagef(
11725
+ image2d_array_msaa_depth_t image,
11726
+ int4 coord,
11727
+ int sample)
11727
11728
----
11728
11729
| Use _coord.xy_ and _sample_ to do an element lookup in the 2D image
11729
11730
identified by _coord.z_ in the 2D depth image array specified by
@@ -12162,14 +12163,14 @@ ifdef::cl_khr_fp16[and *write_imageh*]
12162
12163
_image_channel_data_type_ set to one of the following values:
12163
12164
12164
12165
{CL_SIGNED_INT8}, +
12165
- {CL_SIGNED_INT16}, or +
12166
+ {CL_SIGNED_INT16} and +
12166
12167
{CL_SIGNED_INT32}.
12167
12168
12168
12169
*write_imageui* can only be used with image objects created with
12169
12170
_image_channel_data_type_ set to one of the following values:
12170
12171
12171
12172
{CL_UNSIGNED_INT8}, +
12172
- {CL_UNSIGNED_INT16}, or +
12173
+ {CL_UNSIGNED_INT16} and +
12173
12174
{CL_UNSIGNED_INT32}.
12174
12175
12175
12176
The behavior of *write_imagef*,
@@ -16653,8 +16654,8 @@ footnote:[{fn-min-float-constants}].
16653
16654
Let w~t~, h~t~ and d~t~ be the width, height (or image array size for a 1D
16654
16655
image array) and depth (or image array size for a 2D image array) of the
16655
16656
image in pixels.
16656
- Let _coord.xy_ (also referred to as (_s_,_t_)) or _coord.xyz_ (also referred
16657
- to as (_s_,_t_,_r_)) be the coordinates specified to *read_image{f|i|ui}*.
16657
+ Let _coord.xy_ (also referred to as (_s_, _t_)) or _coord.xyz_ (also referred
16658
+ to as (_s_, _t_, _r_)) be the coordinates specified to *read_image{f|i|ui}*.
16658
16659
The sampler specified in *read_image{f|i|ui}* is used to determine how to
16659
16660
sample the image and return an appropriate color.
16660
16661
@@ -16671,7 +16672,7 @@ For image arrays, the image array coordinate (i.e. _t_ if it is a 1D image
16671
16672
array or _r_ if it is a 2D image array) specified to *read_image{f|i|ui}*
16672
16673
must always be the un-normalized image coordinate value.
16673
16674
16674
- Let (_u_,_v_,_w_) represent the unnormalized image coordinate values.
16675
+ Let (_u_, _v_, _w_) represent the unnormalized image coordinate values.
16675
16676
16676
16677
16677
16678
[[addressing-and-filter-modes]]
@@ -16682,19 +16683,19 @@ generate the appropriate sample locations to read from the image if the
16682
16683
addressing mode is not `CLK_ADDRESS_REPEAT` nor
16683
16684
`CLK_ADDRESS_MIRRORED_REPEAT`.
16684
16685
16685
- After generating the image coordinate (_u_,_v_,_w_) we apply the appropriate
16686
+ After generating the image coordinate (_u_, _v_, _w_) we apply the appropriate
16686
16687
addressing and filter mode to generate the appropriate sample locations to
16687
16688
read from the image.
16688
16689
16689
- If values in (_u_,_v_,_w_) are `INF` or NaN, the behavior of
16690
+ If values in (_u_, _v_, _w_) are `INF` or NaN, the behavior of
16690
16691
*read_image{f|i|ui}* is undefined.
16691
16692
16692
16693
*Filter Mode* `CLK_FILTER_NEAREST`
16693
16694
16694
16695
When filter mode is `CLK_FILTER_NEAREST`, the image element in the image
16695
- that is nearest (in Manhattan distance) to that specified by (_u_,_v_,_w_)
16696
+ that is nearest (in Manhattan distance) to that specified by (_u_, _v_, _w_)
16696
16697
is obtained.
16697
- This means the image element at location (_i_,_j_,_k_) becomes the image
16698
+ This means the image element at location (_i_, _j_, _k_) becomes the image
16698
16699
element value, where
16699
16700
16700
16701
[source,opencl_c]
@@ -16704,9 +16705,9 @@ j = address_mode((int)floor(v))
16704
16705
k = address_mode((int)floor(w))
16705
16706
----------
16706
16707
16707
- For a 3D image, the image element at location (_i_,_j_,_k_) becomes the
16708
+ For a 3D image, the image element at location (_i_, _j_, _k_) becomes the
16708
16709
color value.
16709
- For a 2D image, the image element at location (_i_,_j_) becomes the color
16710
+ For a 2D image, the image element at location (_i_, _j_) becomes the color
16710
16711
value.
16711
16712
16712
16713
The following table describes the address_mode function.
@@ -16731,7 +16732,7 @@ The `clamp` function used in this table is defined as:
16731
16732
clamp(a, b, c) = return (a < b) ? b : ((a > c) ? c : a)
16732
16733
----------
16733
16734
16734
- If the selected texel location (_i_,_j_,_k_) refers to a location outside
16735
+ If the selected texel location (_i_, _j_, _k_) refers to a location outside
16735
16736
the image, the border color is used as the color value for this texel.
16736
16737
16737
16738
*Filter Mode* `CLK_FILTER_LINEAR`
@@ -16773,7 +16774,7 @@ T = (1 - a) * (1 - b) * (1 - c) * T_i0j0k0
16773
16774
+ a * b * c * T_i1j1k1
16774
16775
----------
16775
16776
16776
- where `T_ijk` is the image element at location (_i_,_j_,_k_) in the 3D image.
16777
+ where `T_ijk` is the image element at location (_i_, _j_, _k_) in the 3D image.
16777
16778
16778
16779
For a 2D image, the image element value is found as
16779
16780
@@ -16785,7 +16786,7 @@ T = (1 - a) * (1 - b) * T_i0j0
16785
16786
+ a * b * T_i1j1
16786
16787
----------
16787
16788
16788
- where `T_ij` is the image element at location (_i_,_j_) in the 2D image.
16789
+ where `T_ij` is the image element at location (_i_, _j_) in the 2D image.
16789
16790
16790
16791
If any of the selected `T_ijk` or `T_ij` in the above equations refers to a
16791
16792
location outside the image, the border color is used as the color value for
@@ -16799,13 +16800,13 @@ We now discuss how the addressing and filter modes are applied to generate
16799
16800
the appropriate sample locations to read from the image if the addressing
16800
16801
mode is `CLK_ADDRESS_REPEAT`.
16801
16802
16802
- If values in (_s_,_t_,_r_) are `INF` or NaN, the behavior of the built-in
16803
+ If values in (_s_, _t_, _r_) are `INF` or NaN, the behavior of the built-in
16803
16804
image read functions is undefined.
16804
16805
16805
16806
*Filter Mode* `CLK_FILTER_NEAREST`
16806
16807
16807
16808
When filter mode is `CLK_FILTER_NEAREST`, the image element at location
16808
- (_i_,_j_,_k_) becomes the image element value, with _i_, _j_, and _k_
16809
+ (_i_, _j_, _k_) becomes the image element value, with _i_, _j_, and _k_
16809
16810
computed as
16810
16811
16811
16812
[source,opencl_c]
@@ -16827,9 +16828,9 @@ if (k > d_t - 1)
16827
16828
----------
16828
16829
16829
16830
16830
- For a 3D image, the image element at location (_i_,_j_,_k_) becomes the
16831
+ For a 3D image, the image element at location (_i_, _j_, _k_) becomes the
16831
16832
color value.
16832
- For a 2D image, the image element at location (_i_,_j_) becomes the color
16833
+ For a 2D image, the image element at location (_i_, _j_) becomes the color
16833
16834
value.
16834
16835
16835
16836
*Filter Mode* `CLK_FILTER_LINEAR`
@@ -16889,7 +16890,7 @@ T = (1 - a) * (1 - b) * (1 - c) * T_i0j0k0
16889
16890
+ a * b * c * T_i1j1k1
16890
16891
----------
16891
16892
16892
- where `T_ijk` is the image element at location (_i_,_j_,_k_) in the 3D image.
16893
+ where `T_ijk` is the image element at location (_i_, _j_, _k_) in the 3D image.
16893
16894
16894
16895
For a 2D image, the image element value is found as
16895
16896
@@ -16901,7 +16902,7 @@ T = (1 - a) * (1 - b) * T_i0j0
16901
16902
+ a * b * T_i1j1
16902
16903
----------
16903
16904
16904
- where `T_ij` is the image element at location (_i_,_j_) in the 2D image.
16905
+ where `T_ij` is the image element at location (_i_, _j_) in the 2D image.
16905
16906
16906
16907
If the image channel type is {CL_FLOAT} or {CL_HALF_FLOAT} and any of the
16907
16908
image elements `T_ijk` or `T_ij` is `INF` or NaN, the behavior of the built-in
@@ -16913,41 +16914,41 @@ mode is `CLK_ADDRESS_MIRRORED_REPEAT`.
16913
16914
The `CLK_ADDRESS_MIRRORED_REPEAT` addressing mode causes the image to be
16914
16915
read as if it is tiled at every integer seam with the interpretation of the
16915
16916
image data flipped at each integer crossing.
16916
- For example, the (_s_,_t_,_r_) coordinates between 2 and 3 are addressed
16917
+ For example, the (_s_, _t_, _r_) coordinates between 2 and 3 are addressed
16917
16918
into the image as coordinates from 1 down to 0.
16918
- If values in (_s_,_t_,_r_) are `INF` or NaN, the behavior of the built-in
16919
+ If values in (_s_, _t_, _r_) are `INF` or NaN, the behavior of the built-in
16919
16920
image read functions is undefined.
16920
16921
16921
16922
*Filter Mode* `CLK_FILTER_NEAREST`
16922
16923
16923
16924
When filter mode is `CLK_FILTER_NEAREST`, the image element at location
16924
- (_i_,_j_,_k_) becomes the image element value, with _i_,_j_ and k computed
16925
+ (_i_, _j_, _k_) becomes the image element value, with _i_, _j_ and k computed
16925
16926
as
16926
16927
16927
16928
[source,opencl_c]
16928
16929
----------
16929
- s' = 2.0f * rint(0.5f * s)
16930
- s' = fabs(s - s' )
16931
- u = s' * w_t
16930
+ s_prime = 2.0f * rint(0.5f * s)
16931
+ s_prime = fabs(s - s_prime )
16932
+ u = s_prime * w_t
16932
16933
i = (int)floor(u)
16933
16934
i = min(i, w_t - 1)
16934
16935
16935
- t' = 2.0f * rint(0.5f * t)
16936
- t' = fabs(t - t' )
16937
- v = t' * h_t
16936
+ t_prime = 2.0f * rint(0.5f * t)
16937
+ t_prime = fabs(t - t_prime )
16938
+ v = t_prime * h_t
16938
16939
j = (int)floor(v)
16939
16940
j = min(j, h_t - 1)
16940
16941
16941
- r' = 2.0f * rint(0.5f * r)
16942
- r' = fabs(r - r' )
16943
- w = r' * d_t
16942
+ r_prime = 2.0f * rint(0.5f * r)
16943
+ r_prime = fabs(r - r_prime )
16944
+ w = r_prime * d_t
16944
16945
k = (int)floor(w)
16945
16946
k = min(k, d_t - 1)
16946
16947
----------
16947
16948
16948
- For a 3D image, the image element at location (_i_,_j_,_k_) becomes the
16949
+ For a 3D image, the image element at location (_i_, _j_, _k_) becomes the
16949
16950
color value.
16950
- For a 2D image, the image element at location (_i_,_j_) becomes the color
16951
+ For a 2D image, the image element at location (_i_, _j_) becomes the color
16951
16952
value.
16952
16953
16953
16954
*Filter Mode* `CLK_FILTER_LINEAR`
@@ -16961,25 +16962,25 @@ Let
16961
16962
16962
16963
[source,opencl_c]
16963
16964
----------
16964
- s' = 2.0f * rint(0.5f * s)
16965
- s' = fabs(s - s' )
16966
- u = s' * w_t
16965
+ s_prime = 2.0f * rint(0.5f * s)
16966
+ s_prime = fabs(s - s_prime )
16967
+ u = s_prime * w_t
16967
16968
i0 = (int)floor(u - 0.5f)
16968
16969
i1 = i0 + 1
16969
16970
i0 = max(i0, 0)
16970
16971
i1 = min(i1, w_t - 1)
16971
16972
16972
- t' = 2.0f * rint(0.5f * t)
16973
- t' = fabs(t - t' )
16974
- v = t' * h_t
16973
+ t_prime = 2.0f * rint(0.5f * t)
16974
+ t_prime = fabs(t - t_prime )
16975
+ v = t_prime * h_t
16975
16976
j0 = (int)floor(v - 0.5f)
16976
16977
j1 = j0 + 1
16977
16978
j0 = max(j0, 0)
16978
16979
j1 = min(j1, h_t - 1)
16979
16980
16980
- r' = 2.0f * rint(0.5f * r)
16981
- r' = fabs(r - r' )
16982
- w = r' * d_t
16981
+ r_prime = 2.0f * rint(0.5f * r)
16982
+ r_prime = fabs(r - r_prime )
16983
+ w = r_prime * d_t
16983
16984
k0 = (int)floor(w - 0.5f)
16984
16985
k1 = k0 + 1
16985
16986
k0 = max(k0, 0)
@@ -17007,7 +17008,7 @@ T = (1 - a) * (1 - b) * (1 - c) * T_i0j0k0
17007
17008
+ a * b * c * T_i1j1k1
17008
17009
----------
17009
17010
17010
- where `T_ijk` is the image element at location (_i_,_j_,_k_) in the 3D image.
17011
+ where `T_ijk` is the image element at location (_i_, _j_, _k_) in the 3D image.
17011
17012
17012
17013
For a 2D image, the image element value is found as
17013
17014
@@ -17019,7 +17020,7 @@ T = (1 - a) * (1 - b) * T_i0j0
17019
17020
+ a * b * T_i1j1
17020
17021
----------
17021
17022
17022
- where `T_ij` is the image element at location (_i_,_j_) in the 2D image.
17023
+ where `T_ij` is the image element at location (_i_, _j_) in the 2D image.
17023
17024
17024
17025
For a 1D image, the image element value is found as
17025
17026
@@ -17042,7 +17043,7 @@ If the sampler is specified as using unnormalized coordinates
17042
17043
`CLK_FILTER_NEAREST` and addressing mode set to one of the following modes -
17043
17044
`CLK_ADDRESS_NONE`, `CLK_ADDRESS_CLAMP_TO_EDGE` or `CLK_ADDRESS_CLAMP`, the
17044
17045
<<addressing-and-filter-modes,location of the image element in the image>>
17045
- given by (_i_,_j_,_k_) will be computed without any loss of precision.
17046
+ given by (_i_, _j_, _k_) will be computed without any loss of precision.
17046
17047
17047
17048
For all other sampler combinations of normalized or unnormalized
17048
17049
coordinates, filter and addressing modes, the relative error or precision of
@@ -17752,7 +17753,7 @@ implementation produces and being checked for conformance.
17752
17753
[[selecting-an-image-from-an-image-array]]
17753
17754
== Selecting an Image From an Image Array
17754
17755
17755
- Let (_u_,_v_,_w_) represent the unnormalized image coordinate values for
17756
+ Let (_u_, _v_, _w_) represent the unnormalized image coordinate values for
17756
17757
reading from and/or writing to a 2D image in a 2D image array.
17757
17758
17758
17759
When read using a sampler, the 2D image layer selected is computed as:
@@ -17768,7 +17769,7 @@ otherwise the layer selected is computed as:
17768
17769
(since _w_ is already an integer) and the result is undefined if _w_ is not
17769
17770
one of the integers 0, 1, ... d~t~ - 1.
17770
17771
17771
- Let (_u_,_v_) represent the unnormalized image coordinate values for reading
17772
+ Let (_u_, _v_) represent the unnormalized image coordinate values for reading
17772
17773
from and/or writing to a 1D image in a 1D image array.
17773
17774
17774
17775
When read using a sampler, the 1D image layer selected is computed as:
0 commit comments