diff --git a/intrinsiccv/include/intrinsiccv/sve2.h b/intrinsiccv/include/intrinsiccv/sve2.h index 5c84a467ea9f9286e54f711a5fd72f6b57ee27aa..8193c9b3882d0cfb44a96ba2ea895e46aec0fd1f 100644 --- a/intrinsiccv/include/intrinsiccv/sve2.h +++ b/intrinsiccv/include/intrinsiccv/sve2.h @@ -115,6 +115,26 @@ class VectorTypes { using Vector4Type = svuint64x4_t; }; // end of class VectorTypes +template <> +class VectorTypes { + public: + using ScalarType = float; + using VectorType = svfloat32_t; + using Vector2Type = svfloat32x2_t; + using Vector3Type = svfloat32x3_t; + using Vector4Type = svfloat32x4_t; +}; // end of class VectorTypes + +template <> +class VectorTypes { + public: + using ScalarType = double; + using VectorType = svfloat64_t; + using Vector2Type = svfloat64x2_t; + using Vector3Type = svfloat64x3_t; + using Vector4Type = svfloat64x4_t; +}; // end of class VectorTypes + // Base class for all SVE vector traits. template class VecTraitsBase : public VectorTypes { @@ -368,6 +388,22 @@ class VecTraits : public VecTraitsBase { } }; // end of class VecTraits +template <> +class VecTraits : public VecTraitsBase { + public: + static inline svfloat32_t svdup(float v) INTRINSICCV_STREAMING_COMPATIBLE { + return svdup_f32(v); + } +}; // end of class VecTraits + +template <> +class VecTraits : public VecTraitsBase { + public: + static inline svfloat64_t svdup(double v) INTRINSICCV_STREAMING_COMPATIBLE { + return svdup_f64(v); + } +}; // end of class VecTraits + // Adapter which adds context and forwards arguments. template class OperationContextAdapter : public OperationBase { diff --git a/test/framework/utils.h b/test/framework/utils.h index 23216c786b30f20150af81c55e4bf47871b5435d..3c4a9bba5e3e4cafba9f7e6c366469b8c9d43eba 100644 --- a/test/framework/utils.h +++ b/test/framework/utils.h @@ -59,9 +59,9 @@ class Options { // Returns seed to use. static uint64_t seed() { return seed_; } - // Returns the number of lanes in a vector for a given integral type. + // Returns the number of lanes in a vector for a given arithmetic type. template , bool> = true> + std::enable_if_t, bool> = true> static size_t vector_lanes() { return vector_length_ / sizeof(ElementType); }