29 #ifndef VC_COMMON_SIMDARRAYFWD_H_
30 #define VC_COMMON_SIMDARRAYFWD_H_
32 #include "../scalar/types.h"
33 #include "../sse/types.h"
34 #include "../avx/types.h"
35 #include "../mic/types.h"
40 namespace Vc_VERSIONED_NAMESPACE
51 template<std::size_t N,
typename... Typelist>
struct select_best_vector_type_impl;
53 template<std::
size_t N,
typename T>
struct select_best_vector_type_impl<N, T>
57 template<std::size_t N,
typename T,
typename... Typelist>
struct select_best_vector_type_impl<N, T, Typelist...>
59 using type =
typename std::conditional<
60 (N < T::Size),
typename select_best_vector_type_impl<N, Typelist...>::type,
63 template <
typename T, std::
size_t N>
64 using select_best_vector_type =
65 typename select_best_vector_type_impl<N,
70 #elif defined(Vc_IMPL_AVX)
74 #elif defined(Vc_IMPL_Scalar)
76 #elif defined(Vc_IMPL_SSE)
79 #elif defined(Vc_IMPL_MIC)
112 template <
typename T, std::size_t N,
113 typename VectorType = Common::select_best_vector_type<T, N>,
114 std::size_t VectorSize =
120 template <
typename T, std::size_t N,
121 typename VectorType = Common::select_best_vector_type<T, N>,
122 std::size_t VectorSize =
132 template <
typename T, std::
size_t N>
struct SimdArrayTraits {
133 static constexpr std::size_t N0 = Common::left_size(N);
134 static constexpr std::size_t N1 = Common::right_size(N);
136 using storage_type0 = SimdArray<T, N0>;
137 using storage_type1 = SimdArray<T, N1>;
140 template <
typename T, std::
size_t N,
typename VectorType, std::
size_t VectorSize>
141 Vc_INTRINSIC_L
typename SimdArrayTraits<T, N>::storage_type0 &internal_data0(
142 SimdArray<T, N, VectorType, VectorSize> &x) Vc_INTRINSIC_R;
143 template <
typename T, std::
size_t N,
typename VectorType, std::
size_t VectorSize>
144 Vc_INTRINSIC_L
typename SimdArrayTraits<T, N>::storage_type1 &internal_data1(
145 SimdArray<T, N, VectorType, VectorSize> &x) Vc_INTRINSIC_R;
146 template <
typename T, std::
size_t N,
typename VectorType, std::
size_t VectorSize>
147 Vc_INTRINSIC_L
const typename SimdArrayTraits<T, N>::storage_type0 &internal_data0(
148 const SimdArray<T, N, VectorType, VectorSize> &x) Vc_INTRINSIC_R;
149 template <
typename T, std::
size_t N,
typename VectorType, std::
size_t VectorSize>
150 Vc_INTRINSIC_L
const typename SimdArrayTraits<T, N>::storage_type1 &internal_data1(
151 const SimdArray<T, N, VectorType, VectorSize> &x) Vc_INTRINSIC_R;
153 template <
typename T, std::
size_t N,
typename V>
154 Vc_INTRINSIC_L V &internal_data(SimdArray<T, N, V, N> &x) Vc_INTRINSIC_R;
155 template <
typename T, std::
size_t N,
typename V>
156 Vc_INTRINSIC_L
const V &internal_data(
const SimdArray<T, N, V, N> &x) Vc_INTRINSIC_R;
160 template <
typename T, std::
size_t N,
typename V>
struct is_atomic_simdarray_internal<SimdArray<T, N, V, N>> :
public std::true_type {};
161 template <
typename T, std::
size_t N,
typename V>
struct is_atomic_simd_mask_array_internal<SimdMaskArray<T, N, V, N>> :
public std::true_type {};
163 template <
typename T, std::
size_t N,
typename VectorType, std::
size_t M>
struct is_simdarray_internal<SimdArray<T, N, VectorType, M>> :
public std::true_type {};
164 template <
typename T, std::
size_t N,
typename VectorType, std::
size_t M>
struct is_simd_mask_array_internal<SimdMaskArray<T, N, VectorType, M>> :
public std::true_type {};
165 template <
typename T, std::
size_t N,
typename V, std::
size_t M>
struct is_integral_internal <SimdArray<T, N, V, M>, false> :
public std::is_integral<T> {};
166 template <
typename T, std::
size_t N,
typename V, std::
size_t M>
struct is_floating_point_internal<SimdArray<T, N, V, M>, false> :
public std::is_floating_point<T> {};
167 template <
typename T, std::
size_t N,
typename V, std::
size_t M>
struct is_signed_internal <SimdArray<T, N, V, M>, false> :
public std::is_signed<T> {};
168 template <
typename T, std::
size_t N,
typename V, std::
size_t M>
struct is_unsigned_internal <SimdArray<T, N, V, M>, false> :
public std::is_unsigned<T> {};
170 template<
typename T, std::
size_t N>
struct has_no_allocated_data_impl<
Vc::SimdArray<T, N>> :
public std::true_type {};
175 #endif // VC_COMMON_SIMDARRAYFWD_H_
Vector Classes Namespace.