25 inline namespace _V1 {
26 namespace ext::intel::esimd {
50 template <
typename Ty,
int N>
52 detail::__raw_t<Ty>, N, simd<Ty, N>,
53 std::enable_if_t<detail::is_valid_simd_elem_type_v<Ty>>> {
57 using base_type::base_type;
70 template <
typename SimdT,
71 class = std::enable_if_t<__ESIMD_DNS::is_simd_type_v<SimdT> &&
74 :
base_type(detail::convert_vector<Ty, detail::element_type_t<SimdT>, N>(
81 int N1 = N,
class Ty1 = Ty,
82 class SFINAE = std::enable_if_t<
84 Ty>)&&!detail::is_wrapper_elem_type_v<Ty1>>>
93 template <
typename T1,
94 class = std::enable_if_t<detail::is_valid_simd_elem_type_v<T1>>>
104 template <
class To,
class T =
simd,
105 class = std::enable_if_t<(
T::length == 1) &&
106 detail::is_valid_simd_elem_type_v<To>>>
107 operator To()
const {
117 int N1,
class Ty1 = Ty,
118 class SFINAE = std::enable_if_t<
120 Ty>)&&!detail::is_wrapper_elem_type_v<Ty1>>>
162 #define __ESIMD_DEF_SIMD_ARITH_UNARY_OP(ARITH_UNARY_OP, ID) \
163 template <class T1 = Ty> simd operator ARITH_UNARY_OP() const { \
164 static_assert(!std::is_unsigned_v<T1>, \
165 #ARITH_UNARY_OP "doesn't apply to unsigned types"); \
166 return simd{detail::vector_unary_op<detail::UnaryOp::ID, T1, N>( \
167 base_type::data())}; \
174 #undef __ESIMD_DEF_SIMD_ARITH_UNARY_OP
184 template <
typename To,
typename From,
int N>
186 if constexpr (std::is_same_v<std::remove_const_t<To>,
187 std::remove_const_t<From>>)
190 return detail::convert_vector<To, From, N>(val.
data());
199 template <
int N>
using simd_mask = detail::simd_mask_type<N>;
210 template <
typename Ty,
int N>
211 std::ostream &
operator<<(std::ostream &OS,
const __ESIMD_NS::simd<Ty, N> &V)
212 #ifdef __SYCL_DEVICE_ONLY__
216 __ESIMD_UNSUPPORTED_ON_HOST;
This is a base class for all ESIMD simd classes with real storage (simd, simd_mask_impl).
Derived & operator=(const simd_obj_impl &other) noexcept
Copy assignment operator.
raw_vector_type data() const
RawTy raw_element_type
The element type of the raw storage vector.
vector_type_t< RawTy, N > raw_vector_type
The underlying raw storage vector data type.
The main simd vector class.
typename base_type::raw_vector_type raw_vector_type
simd & operator++()
Prefix increment, increments elements of this object.
simd(const SimdT &RHS)
Implicit conversion constructor from another simd object of the same length.
static constexpr int length
typename base_type::raw_element_type raw_element_type
simd & operator=(const simd &other) noexcept
Copy assignment operator.
simd(const sycl::ext::oneapi::experimental::simd< Ty, N1 > &v)
simd(T1 Val)
Broadcast constructor with conversion.
simd operator++(int)
Postfix increment.
simd operator--(int)
Postfix decrement.
simd & operator--()
Prefix decrement, decrements elements of this object.
#define __esimd_dbg_print(a)
ESIMD_INLINE simd< To, N > convert(const simd< From, N > &val)
Covert from a simd object with element type From to a simd object with element type To.
std::ostream & operator<<(std::ostream &OS, const sycl::ext::intel::esimd::simd< Ty, N > &V)
Prints a simd object to an output stream.
std::experimental::simd< T, simd_abi::native_fixed_size< T, N > > simd
ValueT length(const ValueT *a, const int len)
Calculate the square root of the input array.
_Abi const simd< _Tp, _Abi > & noexcept
constexpr size_t max_fixed_size
#define __ESIMD_DEF_SIMD_ARITH_UNARY_OP(ARITH_UNARY_OP, ID)