Skip to content

[SYCL] Add support for std::byte to vec class #4637

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions sycl/include/CL/sycl/detail/generic_type_lists.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include <CL/sycl/detail/stl_type_traits.hpp>
#include <CL/sycl/detail/type_list.hpp>

#include <cstddef>

// Generic type name description, which serves as a description for all valid
// types of parameters to kernel functions

Expand Down Expand Up @@ -285,6 +287,15 @@ using vector_long_integer_list = type_list<vector_signed_long_integer_list,
using long_integer_list =
type_list<scalar_long_integer_list, vector_long_integer_list>;

#if __cplusplus >= 201703L
// std::byte
using scalar_byte_list = type_list<std::byte>;

using vector_byte_list =
type_list<vec<std::byte, 1>, vec<std::byte, 2>, vec<std::byte, 3>,
vec<std::byte, 4>, vec<std::byte, 8>, vec<std::byte, 16>>;
#endif

// integer types
using scalar_signed_integer_list = type_list<
conditional_t<std::is_signed<char>::value,
Expand All @@ -309,15 +320,25 @@ using scalar_unsigned_integer_list =
scalar_unsigned_char_list>,
scalar_unsigned_char_list>,
scalar_unsigned_short_list, scalar_unsigned_int_list,
scalar_unsigned_long_list, scalar_unsigned_longlong_list>;
scalar_unsigned_long_list, scalar_unsigned_longlong_list
#if __cplusplus >= 201703L
,
scalar_byte_list
#endif
>;

using vector_unsigned_integer_list =
type_list<conditional_t<std::is_unsigned<char>::value,
type_list<vector_default_char_list,
vector_unsigned_char_list>,
vector_unsigned_char_list>,
vector_unsigned_short_list, vector_unsigned_int_list,
vector_unsigned_long_list, vector_unsigned_longlong_list>;
vector_unsigned_long_list, vector_unsigned_longlong_list
#if __cplusplus >= 201703L
,
vector_byte_list
#endif
>;

using unsigned_integer_list =
type_list<scalar_unsigned_integer_list, vector_unsigned_integer_list>;
Expand Down
Loading