Blaze 3.9
Pow.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_POW_H_
36#define _BLAZE_MATH_SIMD_POW_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#if BLAZE_SLEEF_MODE
44# include <sleef.h>
45#endif
47#include <blaze/system/Inline.h>
49
50
51namespace blaze {
52
53//=================================================================================================
54//
55// 32-BIT FLOATING POINT SIMD TYPES
56//
57//=================================================================================================
58
59//*************************************************************************************************
69template< typename T1 // Type of the left-hand side operand
70 , typename T2 > // Type of the right-hand side operand
71BLAZE_ALWAYS_INLINE const SIMDfloat pow( const SIMDf32<T1>& a, const SIMDf32<T2>& b ) noexcept
72#if BLAZE_SVML_MODE
73# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
74{
75 return _mm512_pow_ps( (*a).eval().value, (*b).eval().value );
76}
77# elif BLAZE_AVX_MODE
78{
79 return _mm256_pow_ps( (*a).eval().value, (*b).eval().value );
80}
81# elif BLAZE_SSE_MODE
82{
83 return _mm_pow_ps( (*a).eval().value, (*b).eval().value );
84}
85# endif
86#elif BLAZE_SLEEF_MODE
87# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
88{
89 return Sleef_powf16_u10( (*a).eval().value, (*b).eval().value );
90}
91# elif BLAZE_AVX_MODE
92{
93 return Sleef_powf8_u10( (*a).eval().value, (*b).eval().value );
94}
95# elif BLAZE_SSE_MODE
96{
97 return Sleef_powf4_u10( (*a).eval().value, (*b).eval().value );
98}
99# endif
100#elif BLAZE_XSIMD_MODE
101{
102 return SIMDfloat{ xsimd::pow( xsimd::batch<float>{ (*a).eval().value },
103 xsimd::batch<float>{ (*b).eval().value } ).data };
104}
105#else
106= delete;
107#endif
108//*************************************************************************************************
109
110
111
112
113//=================================================================================================
114//
115// 64-BIT FLOATING POINT SIMD TYPES
116//
117//=================================================================================================
118
119//*************************************************************************************************
129template< typename T1 // Type of the left-hand side operand
130 , typename T2 > // Type of the right-hand side operand
131BLAZE_ALWAYS_INLINE const SIMDdouble pow( const SIMDf64<T1>& a, const SIMDf64<T2>& b ) noexcept
132#if BLAZE_SVML_MODE
133# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
134{
135 return _mm512_pow_pd( (*a).eval().value, (*b).eval().value );
136}
137# elif BLAZE_AVX_MODE
138{
139 return _mm256_pow_pd( (*a).eval().value, (*b).eval().value );
140}
141# elif BLAZE_SSE_MODE
142{
143 return _mm_pow_pd( (*a).eval().value, (*b).eval().value );
144}
145# endif
146#elif BLAZE_SLEEF_MODE
147# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
148{
149 return Sleef_powd8_u10( (*a).eval().value, (*b).eval().value );
150}
151# elif BLAZE_AVX_MODE
152{
153 return Sleef_powd4_u10( (*a).eval().value, (*b).eval().value );
154}
155# elif BLAZE_SSE_MODE
156{
157 return Sleef_powd2_u10( (*a).eval().value, (*b).eval().value );
158}
159# endif
160#elif BLAZE_XSIMD_MODE
161{
162 return SIMDdouble{ xsimd::pow( xsimd::batch<double>{ (*a).eval().value },
163 xsimd::batch<double>{ (*b).eval().value } ).data };
164}
165#else
166= delete;
167#endif
168//*************************************************************************************************
169
170} // namespace blaze
171
172#endif
Header file for the basic SIMD types.
SIMD type for 64-bit double precision floating point data values.
SIMD type for 32-bit single precision floating point data values.
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:182
BLAZE_ALWAYS_INLINE const SIMDdouble pow(const SIMDf64< T1 > &a, const SIMDf64< T2 > &b) noexcept=delete
Computes the exponential value of a vector of double precision floating point values.
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
System settings for the inline keywords.
System settings for the SSE mode.