Skip to content

Commit

Permalink
Merge pull request #446 from gmlueck/gmlueck/any-all-bool
Browse files Browse the repository at this point in the history
Add marray<bool> support to "any" / "all"
  • Loading branch information
gmlueck authored Sep 14, 2023
2 parents 472b3a2 + bdf4a29 commit 27edf19
Showing 1 changed file with 62 additions and 30 deletions.
92 changes: 62 additions & 30 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26578,11 +26578,40 @@ a@
a!
[source]
----
template<typename GenInt>
template<typename GenInt> (1)
/*return-type*/ any(GenInt x)

template<typename GenInt> (2) /* deprecated */
bool any(GenInt x)
----
!====

*Overload (1):*

_Constraints:_ Available only if [code]#GenInt# is one of the following types:

* [code]#marray<bool, N>#
* [code]#vec<int8_t, N>#
* [code]#vec<int16_t, N>#
* [code]#vec<int32_t, N>#
* [code]#vec<int64_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int8_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int16_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int32_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int64_t, N>#

_Returns:_ When [code]#x# is [code]#marray#, returns a Boolean telling whether
any element of [code]#x# is true. When [code]#x# is [code]#vec# or the
[code]#+__swizzled_vec__+# type, returns the value 1 if any element in
[code]#x# has its most significant bit set, otherwise returns the value 0.

The return type is [code]#bool# if [code]#GenInt# is [code]#marray#.
Otherwise, the return type is [code]#int#.

*Overload (2):*

This overload is deprecated in SYCL 2020.

_Constraints:_ Available only if [code]#GenInt# is one of the following types:

* [code]#signed char#
Expand All @@ -26595,36 +26624,52 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types:
* [code]#marray<int, N>#
* [code]#marray<long, N>#
* [code]#marray<long long, N>#
* [code]#vec<int8_t, N>#
* [code]#vec<int16_t, N>#
* [code]#vec<int32_t, N>#
* [code]#vec<int64_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int8_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int16_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int32_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int64_t, N>#

_Returns:_ When [code]#x# is a scalar, returns a Boolean telling whether the
most significant bit of [code]#x# is set. When [code]#x# is [code]#marray#,
returns a Boolean telling whether the most significant bit of any element
in [code]#x# is set. When [code]#x# is [code]#vec# or the
[code]#+__swizzled_vec__+# type, returns the value 1 if any element in
[code]#x# has its most significant bit set, otherwise returns the value 0.

The return type is [code]#bool# if [code]#GenInt# is a scalar or
[code]#marray#. Otherwise, the return type is [code]#int#.
in [code]#x# is set.

a@
[frame=all,grid=none]
!====
a!
[source]
----
template<typename GenInt>
template<typename GenInt> (1)
/*return-type*/ all(GenInt x)

template<typename GenInt> (2) /* deprecated */
bool all(GenInt x)
----
!====

*Overload (1):*

_Constraints:_ Available only if [code]#GenInt# is one of the following types:

* [code]#marray<bool, N>#
* [code]#vec<int8_t, N>#
* [code]#vec<int16_t, N>#
* [code]#vec<int32_t, N>#
* [code]#vec<int64_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int8_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int16_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int32_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int64_t, N>#

_Returns:_ When [code]#x# is [code]#marray#, returns a Boolean telling whether
all elements of [code]#x# are true. When [code]#x# is [code]#vec# or the
[code]#+__swizzled_vec__+# type, returns the value 1 if all elements in
[code]#x# have their most significant bit set, otherwise returns the value 0.

The return type is [code]#bool# if [code]#GenInt# is [code]#marray#.
Otherwise, the return type is [code]#int#.

*Overload (2):*

This overload is deprecated in SYCL 2020.

_Constraints:_ Available only if [code]#GenInt# is one of the following types:

* [code]#signed char#
Expand All @@ -26637,24 +26682,11 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types:
* [code]#marray<int, N>#
* [code]#marray<long, N>#
* [code]#marray<long long, N>#
* [code]#vec<int8_t, N>#
* [code]#vec<int16_t, N>#
* [code]#vec<int32_t, N>#
* [code]#vec<int64_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int8_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int16_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int32_t, N>#
* [code]#+__swizzled_vec__+# that is convertible to [code]#vec<int64_t, N>#

_Returns:_ When [code]#x# is a scalar, returns a Boolean telling whether the
most significant bit of [code]#x# is set. When [code]#x# is [code]#marray#,
returns a Boolean telling whether the most significant bit of all elements
in [code]#x# are set. When [code]#x# is [code]#vec# or the
[code]#+__swizzled_vec__+# type, returns the value 1 if all elements in
[code]#x# have their most significant bit set, otherwise returns the value 0.

The return type is [code]#bool# if [code]#GenInt# is a scalar or
[code]#marray#. Otherwise, the return type is [code]#int#.
in [code]#x# are set.

a@
[frame=all,grid=none]
Expand Down

0 comments on commit 27edf19

Please sign in to comment.