Skip to content

Commit 7ae8fd3

Browse files
authored
[SYCL] Add overload of select for bool (#6000)
Addresses the common case of sycl::select(a, b, c) where c is a bool.
1 parent f401052 commit 7ae8fd3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sycl/include/CL/sycl/builtins.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,13 @@ detail::enable_if_t<detail::is_gentype<T>::value, T> bitselect(T a, T b,
13061306
return __sycl_std::__invoke_bitselect<T>(a, b, c);
13071307
}
13081308

1309+
// sgentype select (sgentype a, sgentype b, bool c)
1310+
template <typename T>
1311+
detail::enable_if_t<detail::is_sgentype<T>::value, T> select(T a, T b,
1312+
bool c) __NOEXC {
1313+
return __sycl_std::__invoke_select<T>(a, b, static_cast<int>(c));
1314+
}
1315+
13091316
// geninteger select (geninteger a, geninteger b, igeninteger c)
13101317
template <typename T, typename T2>
13111318
detail::enable_if_t<

0 commit comments

Comments
 (0)