commit 8a8ba7ae333ee7de7c3b703908e2c0fa8b92936a
parent df316824aebe3d5e00553039a0837464dee4eb2a
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date: Tue, 2 Aug 2022 17:49:08 +0100
is_simd_float_type and is_simd_int_type
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/kfr/simd/types.hpp b/include/kfr/simd/types.hpp
@@ -406,7 +406,20 @@ constexpr inline bool is_simd_type =
is_same<T, long> || is_same<T, unsigned long> || is_same<T, long long> || is_same<T, unsigned long long>;
template <typename T>
+constexpr inline bool is_simd_float_type = is_same<T, float> || is_same<T, double>;
+
+template <typename T>
+constexpr inline bool is_simd_int_type =
+ is_same<T, signed char> || is_same<T, unsigned char> || is_same<T, short> || is_same<T, unsigned short> ||
+ is_same<T, int> || is_same<T, unsigned int> || is_same<T, long> || is_same<T, unsigned long> ||
+ is_same<T, long long> || is_same<T, unsigned long long>;
+
+template <typename T>
constexpr inline bool is_simd_type<bit<T>> = is_simd_type<T>;
+template <typename T>
+constexpr inline bool is_simd_float_type<bit<T>> = is_simd_float_type<T>;
+template <typename T>
+constexpr inline bool is_simd_int_type<bit<T>> = is_simd_int_type<T>;
template <typename T, size_t N>
struct vec_shape