Blaze 3.9
Atan2.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_ATAN2_H_
36#define _BLAZE_MATH_SIMD_ATAN2_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 T > // Type of the operand
70BLAZE_ALWAYS_INLINE const SIMDfloat atan2( const SIMDf32<T>& a, const SIMDf32<T>& b ) noexcept
71#if BLAZE_SVML_MODE
72# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
73{
74 return _mm512_atan2_ps( (*a).eval().value, (*b).eval().value );
75}
76# elif BLAZE_AVX_MODE
77{
78 return _mm256_atan2_ps( (*a).eval().value, (*b).eval().value );
79}
80# elif BLAZE_SSE_MODE
81{
82 return _mm_atan2_ps( (*a).eval().value, (*b).eval().value );
83}
84# endif
85#elif BLAZE_SLEEF_MODE
86# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
87{
88 return Sleef_atan2f16_u10( (*a).eval().value, (*b).eval().value );
89}
90# elif BLAZE_AVX_MODE
91{
92 return Sleef_atan2f8_u10( (*a).eval().value, (*b).eval().value );
93}
94# elif BLAZE_SSE_MODE
95{
96 return Sleef_atan2f4_u10( (*a).eval().value, (*b).eval().value );
97}
98# endif
99#elif BLAZE_XSIMD_MODE
100{
101 return SIMDfloat{ xsimd::atan2( xsimd::batch<float>{ (*a).eval().value },
102 xsimd::batch<float>{ (*b).eval().value } ).data };
103}
104#else
105= delete;
106#endif
107//*************************************************************************************************
108
109
110
111
112//=================================================================================================
113//
114// 64-BIT FLOATING POINT SIMD TYPES
115//
116//=================================================================================================
117
118//*************************************************************************************************
128template< typename T > // Type of the operand
129BLAZE_ALWAYS_INLINE const SIMDdouble atan2( const SIMDf64<T>& a, const SIMDf64<T>& b ) noexcept
130#if BLAZE_SVML_MODE
131# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
132{
133 return _mm512_atan2_pd( (*a).eval().value, (*b).eval().value );
134}
135# elif BLAZE_AVX_MODE
136{
137 return _mm256_atan2_pd( (*a).eval().value, (*b).eval().value );
138}
139# elif BLAZE_SSE_MODE
140{
141 return _mm_atan2_pd( (*a).eval().value, (*b).eval().value );
142}
143# endif
144#elif BLAZE_SLEEF_MODE
145# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
146{
147 return Sleef_atan2d8_u10( (*a).eval().value, (*b).eval().value );
148}
149# elif BLAZE_AVX_MODE
150{
151 return Sleef_atan2d4_u10( (*a).eval().value, (*b).eval().value );
152}
153# elif BLAZE_SSE_MODE
154{
155 return Sleef_atan2d2_u10( (*a).eval().value, (*b).eval().value );
156}
157# endif
158#elif BLAZE_XSIMD_MODE
159{
160 return SIMDdouble{ xsimd::atan2( xsimd::batch<double>{ (*a).eval().value },
161 xsimd::batch<double>{ (*b).eval().value } ).data };
162}
163#else
164= delete;
165#endif
166//*************************************************************************************************
167
168} // namespace blaze
169
170#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 atan2(const SIMDf64< T > &a, const SIMDf64< T > &b) noexcept=delete
Multi-valued inverse tangent 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.