diff --git a/sycl/include/sycl/detail/generic_type_traits.hpp b/sycl/include/sycl/detail/generic_type_traits.hpp index 33931102c40a8..3d06502dee2d9 100644 --- a/sycl/include/sycl/detail/generic_type_traits.hpp +++ b/sycl/include/sycl/detail/generic_type_traits.hpp @@ -518,7 +518,9 @@ template struct RelConverter { template class TryToGetElementType { static T check(...); template static typename A::element_type check(const A &); - template static typename A::value_type check(const A &); + template >> + static typename A::value_type check(const A &); public: using type = decltype(check(T())); diff --git a/sycl/include/sycl/types.hpp b/sycl/include/sycl/types.hpp index 711b297d35ffd..7d904a8246b03 100644 --- a/sycl/include/sycl/types.hpp +++ b/sycl/include/sycl/types.hpp @@ -546,8 +546,8 @@ template class vec { public: using element_type = DataT; + using value_type = DataT; using rel_t = detail::rel_t; - #ifdef __SYCL_DEVICE_ONLY__ #if defined(__INTEL_PREVIEW_BREAKING_CHANGES) using vector_t = diff --git a/sycl/test/regression/vec_value_type.cpp b/sycl/test/regression/vec_value_type.cpp new file mode 100644 index 0000000000000..6a0636d15eabe --- /dev/null +++ b/sycl/test/regression/vec_value_type.cpp @@ -0,0 +1,11 @@ +// RUN: %clangxx -fsycl -fsyntax-only %s +#include +#include +using namespace std; +int main() { + static_assert(is_same_v::value_type, int>); + static_assert(is_same_v::value_type, float>); + static_assert(is_same_v::value_type, double>); + static_assert(is_same_v::value_type, sycl::half>); + return 0; +}