Skip to content

Commit 50e7abd

Browse files
[SYCL] Refactor sub-group built-ins implementation (#1031)
Main motivation and idea of this change is to use existing utility functions for mapping from SYCL types to corresponding SPIR-V types, which will automatically allows to use wide range of types in sub-group built-ins (like `char` or `bool`) List of changes: - used existing `ConvertToOpenCLType_t` to map SYCL types to OpenCL types - added bunch of helper functions to reduce the code - refactored bunch of `enable_if`s to use the same style (on return value) Signed-off-by: Alexey Sachkov <alexey.sachkov@intel.com>
1 parent 8ab6d7f commit 50e7abd

File tree

2 files changed

+198
-206
lines changed

2 files changed

+198
-206
lines changed

sycl/include/CL/sycl/detail/type_traits.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ template <typename T, int N, template <typename> class S>
157157
using is_gen_based_on_type_sizeof =
158158
bool_constant<S<T>::value && (sizeof(vector_element_t<T>) == N)>;
159159

160+
template <typename> struct is_vec : std::false_type {};
161+
template <typename T, std::size_t N>
162+
struct is_vec<cl::sycl::vec<T, N>> : std::true_type {};
163+
160164
// is_integral
161165
template <typename T>
162166
struct is_integral : std::is_integral<vector_element_t<T>> {};

0 commit comments

Comments
 (0)