@@ -1805,7 +1805,7 @@ When converting from a floating-point type to integer type, the behavior is
18051805implementation-defined.
18061806
18071807Conversions 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.
18091809When in saturated mode, values that are outside the representable range
18101810shall clamp to the nearest representable value in the destination format.
18111811(NaN should be converted to 0).
@@ -11604,19 +11604,19 @@ uint4 read_imageui(
1160411604 *read_imagei* can only be used with image objects created with
1160511605 _image_channel_data_type_ set to one of the following values:
1160611606
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}.
1161011610
1161111611 If the _image_channel_data_type_ is not one of the above values, the
1161211612 values returned by *read_imagei* are undefined.
1161311613
1161411614 *read_imageui* can only be used with image objects created with
1161511615 _image_channel_data_type_ set to one of the following values:
1161611616
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}.
1162011620
1162111621 If the _image_channel_data_type_ is not one of the above values, the
1162211622 values returned by *read_imageui* are undefined.
@@ -11675,19 +11675,19 @@ uint4 read_imageui(
1167511675 *read_imagei* can only be used with image objects created with
1167611676 _image_channel_data_type_ set to one of the following values:
1167711677
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}.
1168111681
1168211682 If the _image_channel_data_type_ is not one of the above values, the
1168311683 values returned by *read_imagei* are undefined.
1168411684
1168511685 *read_imageui* can only be used with image objects created with
1168611686 _image_channel_data_type_ set to one of the following values:
1168711687
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}.
1169111691
1169211692 If the _image_channel_data_type_ is not one of the above values, the
1169311693 values returned by *read_imageui* are undefined.
@@ -11719,11 +11719,12 @@ float read_imagef(
1171911719 <<unified-spec, Requires>> support for the
1172011720 {cl_khr_gl_msaa_sharing_EXT} extension macro.
1172111721a|
11722- [source,c ]
11722+ [source,opencl_c ]
1172311723----
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)
1172711728----
1172811729 | Use _coord.xy_ and _sample_ to do an element lookup in the 2D image
1172911730 identified by _coord.z_ in the 2D depth image array specified by
@@ -12162,14 +12163,14 @@ ifdef::cl_khr_fp16[and *write_imageh*]
1216212163 _image_channel_data_type_ set to one of the following values:
1216312164
1216412165 {CL_SIGNED_INT8}, +
12165- {CL_SIGNED_INT16}, or +
12166+ {CL_SIGNED_INT16} and +
1216612167 {CL_SIGNED_INT32}.
1216712168
1216812169 *write_imageui* can only be used with image objects created with
1216912170 _image_channel_data_type_ set to one of the following values:
1217012171
1217112172 {CL_UNSIGNED_INT8}, +
12172- {CL_UNSIGNED_INT16}, or +
12173+ {CL_UNSIGNED_INT16} and +
1217312174 {CL_UNSIGNED_INT32}.
1217412175
1217512176 The behavior of *write_imagef*,
@@ -16653,8 +16654,8 @@ footnote:[{fn-min-float-constants}].
1665316654Let w~t~, h~t~ and d~t~ be the width, height (or image array size for a 1D
1665416655image array) and depth (or image array size for a 2D image array) of the
1665516656image 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}*.
1665816659The sampler specified in *read_image{f|i|ui}* is used to determine how to
1665916660sample the image and return an appropriate color.
1666016661
@@ -16671,7 +16672,7 @@ For image arrays, the image array coordinate (i.e. _t_ if it is a 1D image
1667116672array or _r_ if it is a 2D image array) specified to *read_image{f|i|ui}*
1667216673must always be the un-normalized image coordinate value.
1667316674
16674- Let (_u_,_v_,_w_) represent the unnormalized image coordinate values.
16675+ Let (_u_, _v_, _w_) represent the unnormalized image coordinate values.
1667516676
1667616677
1667716678[[addressing-and-filter-modes]]
@@ -16682,19 +16683,19 @@ generate the appropriate sample locations to read from the image if the
1668216683addressing mode is not `CLK_ADDRESS_REPEAT` nor
1668316684`CLK_ADDRESS_MIRRORED_REPEAT`.
1668416685
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
1668616687addressing and filter mode to generate the appropriate sample locations to
1668716688read from the image.
1668816689
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
1669016691*read_image{f|i|ui}* is undefined.
1669116692
1669216693*Filter Mode* `CLK_FILTER_NEAREST`
1669316694
1669416695When 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_)
1669616697is 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
1669816699element value, where
1669916700
1670016701[source,opencl_c]
@@ -16704,9 +16705,9 @@ j = address_mode((int)floor(v))
1670416705k = address_mode((int)floor(w))
1670516706----------
1670616707
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
1670816709color 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
1671016711value.
1671116712
1671216713The following table describes the address_mode function.
@@ -16731,7 +16732,7 @@ The `clamp` function used in this table is defined as:
1673116732clamp(a, b, c) = return (a < b) ? b : ((a > c) ? c : a)
1673216733----------
1673316734
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
1673516736the image, the border color is used as the color value for this texel.
1673616737
1673716738*Filter Mode* `CLK_FILTER_LINEAR`
@@ -16773,7 +16774,7 @@ T = (1 - a) * (1 - b) * (1 - c) * T_i0j0k0
1677316774 + a * b * c * T_i1j1k1
1677416775----------
1677516776
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.
1677716778
1677816779For a 2D image, the image element value is found as
1677916780
@@ -16785,7 +16786,7 @@ T = (1 - a) * (1 - b) * T_i0j0
1678516786 + a * b * T_i1j1
1678616787----------
1678716788
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.
1678916790
1679016791If any of the selected `T_ijk` or `T_ij` in the above equations refers to a
1679116792location 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
1679916800the appropriate sample locations to read from the image if the addressing
1680016801mode is `CLK_ADDRESS_REPEAT`.
1680116802
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
1680316804image read functions is undefined.
1680416805
1680516806*Filter Mode* `CLK_FILTER_NEAREST`
1680616807
1680716808When 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_
1680916810computed as
1681016811
1681116812[source,opencl_c]
@@ -16827,9 +16828,9 @@ if (k > d_t - 1)
1682716828----------
1682816829
1682916830
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
1683116832color 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
1683316834value.
1683416835
1683516836*Filter Mode* `CLK_FILTER_LINEAR`
@@ -16889,7 +16890,7 @@ T = (1 - a) * (1 - b) * (1 - c) * T_i0j0k0
1688916890 + a * b * c * T_i1j1k1
1689016891----------
1689116892
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.
1689316894
1689416895For a 2D image, the image element value is found as
1689516896
@@ -16901,7 +16902,7 @@ T = (1 - a) * (1 - b) * T_i0j0
1690116902 + a * b * T_i1j1
1690216903----------
1690316904
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.
1690516906
1690616907If the image channel type is {CL_FLOAT} or {CL_HALF_FLOAT} and any of the
1690716908image 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`.
1691316914The `CLK_ADDRESS_MIRRORED_REPEAT` addressing mode causes the image to be
1691416915read as if it is tiled at every integer seam with the interpretation of the
1691516916image 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
1691716918into 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
1691916920image read functions is undefined.
1692016921
1692116922*Filter Mode* `CLK_FILTER_NEAREST`
1692216923
1692316924When 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
1692516926as
1692616927
1692716928[source,opencl_c]
1692816929----------
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
1693216933i = (int)floor(u)
1693316934i = min(i, w_t - 1)
1693416935
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
1693816939j = (int)floor(v)
1693916940j = min(j, h_t - 1)
1694016941
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
1694416945k = (int)floor(w)
1694516946k = min(k, d_t - 1)
1694616947----------
1694716948
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
1694916950color 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
1695116952value.
1695216953
1695316954*Filter Mode* `CLK_FILTER_LINEAR`
@@ -16961,25 +16962,25 @@ Let
1696116962
1696216963[source,opencl_c]
1696316964----------
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
1696716968i0 = (int)floor(u - 0.5f)
1696816969i1 = i0 + 1
1696916970i0 = max(i0, 0)
1697016971i1 = min(i1, w_t - 1)
1697116972
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
1697516976j0 = (int)floor(v - 0.5f)
1697616977j1 = j0 + 1
1697716978j0 = max(j0, 0)
1697816979j1 = min(j1, h_t - 1)
1697916980
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
1698316984k0 = (int)floor(w - 0.5f)
1698416985k1 = k0 + 1
1698516986k0 = max(k0, 0)
@@ -17007,7 +17008,7 @@ T = (1 - a) * (1 - b) * (1 - c) * T_i0j0k0
1700717008 + a * b * c * T_i1j1k1
1700817009----------
1700917010
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.
1701117012
1701217013For a 2D image, the image element value is found as
1701317014
@@ -17019,7 +17020,7 @@ T = (1 - a) * (1 - b) * T_i0j0
1701917020 + a * b * T_i1j1
1702017021----------
1702117022
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.
1702317024
1702417025For a 1D image, the image element value is found as
1702517026
@@ -17042,7 +17043,7 @@ If the sampler is specified as using unnormalized coordinates
1704217043`CLK_FILTER_NEAREST` and addressing mode set to one of the following modes -
1704317044`CLK_ADDRESS_NONE`, `CLK_ADDRESS_CLAMP_TO_EDGE` or `CLK_ADDRESS_CLAMP`, the
1704417045<<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.
1704617047
1704717048For all other sampler combinations of normalized or unnormalized
1704817049coordinates, filter and addressing modes, the relative error or precision of
@@ -17752,7 +17753,7 @@ implementation produces and being checked for conformance.
1775217753[[selecting-an-image-from-an-image-array]]
1775317754== Selecting an Image From an Image Array
1775417755
17755- Let (_u_,_v_,_w_) represent the unnormalized image coordinate values for
17756+ Let (_u_, _v_, _w_) represent the unnormalized image coordinate values for
1775617757reading from and/or writing to a 2D image in a 2D image array.
1775717758
1775817759When read using a sampler, the 2D image layer selected is computed as:
@@ -17768,7 +17769,7 @@ otherwise the layer selected is computed as:
1776817769(since _w_ is already an integer) and the result is undefined if _w_ is not
1776917770one of the integers 0, 1, ... d~t~ - 1.
1777017771
17771- Let (_u_,_v_) represent the unnormalized image coordinate values for reading
17772+ Let (_u_, _v_) represent the unnormalized image coordinate values for reading
1777217773from and/or writing to a 1D image in a 1D image array.
1777317774
1777417775When read using a sampler, the 1D image layer selected is computed as:
0 commit comments