Skip to content

Commit ec4c171

Browse files
Change is_*genfloat_v implementations
1 parent 477d53f commit ec4c171

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sycl/include/sycl/detail/generic_type_traits.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,19 @@ namespace sycl {
2828
inline namespace _V1 {
2929
namespace detail {
3030

31-
template <typename T>
32-
inline constexpr bool is_genfloat_v = is_contained_v<T, gtl::floating_list>;
33-
3431
template <typename T>
3532
inline constexpr bool is_sgenfloat_v =
36-
is_contained_v<T, gtl::scalar_floating_list>;
33+
check_type_in_v<T, float, double, half, ext::oneapi::bfloat16>;
3734

3835
template <typename T>
3936
inline constexpr bool is_vgenfloat_v =
40-
is_contained_v<T, gtl::vector_floating_list>;
37+
is_vec_v<T> && is_sgenfloat_v<element_type_t<T>>;
38+
39+
template <typename T>
40+
inline constexpr bool is_genfloat_v =
41+
is_sgenfloat_v<T> || is_vgenfloat_v<T> ||
42+
(is_marray_v<T> && is_sgenfloat_v<element_type_t<T>> &&
43+
is_allowed_vec_size_v<num_elements_v<T>>);
4144

4245
template <typename T>
4346
inline constexpr bool is_geninteger_v = is_contained_v<T, gtl::integer_list>;

0 commit comments

Comments
 (0)