Blaze  3.6
Hypot.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SIMD_HYPOT_H_
36 #define _BLAZE_MATH_SIMD_HYPOT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/system/Inline.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // 32-BIT FLOATING POINT SIMD TYPES
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
69 template< typename T > // Type of the operand
70 BLAZE_ALWAYS_INLINE const SIMDfloat hypot( const SIMDf32<T>& a, const SIMDf32<T>& b ) noexcept
71 #if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
72 {
73  return _mm512_hypot_ps( (~a).eval().value, (~b).eval().value );
74 }
75 #elif BLAZE_SVML_MODE && BLAZE_AVX_MODE
76 {
77  return _mm256_hypot_ps( (~a).eval().value, (~b).eval().value );
78 }
79 #elif BLAZE_SVML_MODE && BLAZE_SSE_MODE
80 {
81  return _mm_hypot_ps( (~a).eval().value, (~b).eval().value );
82 }
83 #else
84 = delete;
85 #endif
86 //*************************************************************************************************
87 
88 
89 
90 
91 //=================================================================================================
92 //
93 // 64-BIT FLOATING POINT SIMD TYPES
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
110 template< typename T > // Type of the operand
111 BLAZE_ALWAYS_INLINE const SIMDdouble hypot( const SIMDf64<T>& a, const SIMDf64<T>& b ) noexcept
112 #if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
113 {
114  return _mm512_hypot_pd( (~a).eval().value, (~b).eval().value );
115 }
116 #elif BLAZE_SVML_MODE && BLAZE_AVX_MODE
117 {
118  return _mm256_hypot_pd( (~a).eval().value, (~b).eval().value );
119 }
120 #elif BLAZE_SVML_MODE && BLAZE_SSE_MODE
121 {
122  return _mm_hypot_pd( (~a).eval().value, (~b).eval().value );
123 }
124 #else
125 = delete;
126 #endif
127 //*************************************************************************************************
128 
129 } // namespace blaze
130 
131 #endif
decltype(auto) hypot(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise hypotenous for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1235
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:786
Header file for the basic SIMD types.
System settings for the SSE mode.
System settings for the inline keywords.