Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
simd
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
46
#include <
blaze/math/simd/BasicTypes.h
>
47
#include <
blaze/system/Inline.h
>
48
#include <
blaze/system/Vectorization.h
>
49
50
51
namespace
blaze {
52
53
//=================================================================================================
54
//
55
// 32-BIT FLOATING POINT SIMD TYPES
56
//
57
//=================================================================================================
58
59
//*************************************************************************************************
68
template
<
typename
T >
// Type of the operand
69
BLAZE_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
//*************************************************************************************************
111
template
<
typename
T >
// Type of the operand
112
BLAZE_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
BasicTypes.h
Header file for the basic SIMD types.
SIMDdouble
SIMD type for 64-bit double precision floating point data values.
SIMDfloat
SIMD type for 32-bit single precision floating point data values.
blaze::log1p
decltype(auto) log1p(const DenseMatrix< MT, SO > &dm)
Computes the natural logarithm of x+1 for each single element of the dense matrix dm.
Definition
DMatMapExpr.h:1983
blaze::data
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition
DenseMatrix.h:182
BLAZE_ALWAYS_INLINE
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition
Inline.h:85
Inline.h
System settings for the inline keywords.
Vectorization.h
System settings for the SSE mode.
Generated by
1.18.0