Blaze 3.9
Log1p.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_LOG1P_H_
36#define _BLAZE_MATH_SIMD_LOG1P_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//*************************************************************************************************
68template< typename T > // Type of the operand
69BLAZE_ALWAYS_INLINE const SIMDfloat log1p( const SIMDf32<T>& a ) noexcept
70#if BLAZE_SLEEF_MODE
71# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
72{
73 return Sleef_log1pf16_u10( (*a).eval().value );
74}
75# elif BLAZE_AVX_MODE
76{
77 return Sleef_log1pf8_u10( (*a).eval().value );
78}
79# elif BLAZE_SSE_MODE
80{
81 return Sleef_log1pf4_u10( (*a).eval().value );
82}
83# endif
84#elif BLAZE_XSIMD_MODE
85{
86 return SIMDfloat{ xsimd::log1p( xsimd::batch<float>{ (*a).eval().value } ).data };
87}
88#else
89= delete;
90#endif
91//*************************************************************************************************
92
93
94
95
96//=================================================================================================
97//
98// 64-BIT FLOATING POINT SIMD TYPES
99//
100//=================================================================================================
101
102//*************************************************************************************************
111template< typename T > // Type of the operand
112BLAZE_ALWAYS_INLINE const SIMDdouble log1p( const SIMDf64<T>& a ) noexcept
113#if BLAZE_SLEEF_MODE
114# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
115{
116 return Sleef_log1pd8_u10( (*a).eval().value );
117}
118# elif BLAZE_AVX_MODE
119{
120 return Sleef_log1pd4_u10( (*a).eval().value );
121}
122# elif BLAZE_SSE_MODE
123{
124 return Sleef_log1pd2_u10( (*a).eval().value );
125}
126# endif
127#elif BLAZE_XSIMD_MODE
128{
129 return SIMDdouble{ xsimd::log1p( xsimd::batch<double>{ (*a).eval().value } ).data };
130}
131#else
132= delete;
133#endif
134//*************************************************************************************************
135
136} // namespace blaze
137
138#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 log1p(const SIMDf64< T > &a) noexcept=delete
Computes the natural logarithm of x+1 for 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.