Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
simd
Round.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_SIMD_ROUND_H_
36
#define _BLAZE_MATH_SIMD_ROUND_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/math/simd/BasicTypes.h
>
44
#include <
blaze/system/Inline.h
>
45
#include <
blaze/system/Vectorization.h
>
46
47
48
namespace
blaze {
49
50
//=================================================================================================
51
//
52
// 32-BIT FLOATING POINT SIMD TYPES
53
//
54
//=================================================================================================
55
56
//*************************************************************************************************
65
template
<
typename
T >
// Type of the operand
66
BLAZE_ALWAYS_INLINE
const
SIMDfloat
round
(
const
SIMDf32<T>& a )
noexcept
67
#if BLAZE_AVX512F_MODE
68
{
69
return
_mm512_roundscale_ps( (*a).eval().value, 0 );
70
}
71
#elif BLAZE_MIC_MODE
72
{
73
return
_mm512_round_ps( (*a).eval().value, ( _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC ), _MM_EXPADJ_NONE );
74
}
75
#elif BLAZE_AVX_MODE
76
{
77
return
_mm256_round_ps( (*a).eval().value, ( _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC ) );
78
}
79
#elif BLAZE_SSE4_MODE
80
{
81
return
_mm_round_ps( (*a).eval().value, ( _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC ) );
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
//*************************************************************************************************
106
template
<
typename
T >
// Type of the operand
107
BLAZE_ALWAYS_INLINE
const
SIMDdouble
round
(
const
SIMDf64<T>& a )
noexcept
108
#if BLAZE_AVX512F_MODE
109
{
110
return
_mm512_roundscale_pd( (*a).eval().value, 0 );
111
}
112
#elif BLAZE_AVX_MODE
113
{
114
return
_mm256_round_pd( (*a).eval().value, ( _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC ) );
115
}
116
#elif BLAZE_SSE4_MODE
117
{
118
return
_mm_round_pd( (*a).eval().value, ( _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC ) );
119
}
120
#else
121
=
delete
;
122
#endif
123
//*************************************************************************************************
124
125
}
// namespace blaze
126
127
#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::round
decltype(auto) round(const DenseMatrix< MT, SO > &dm)
Applies the round() function to each single element of the dense matrix dm.
Definition
DMatMapExpr.h:1436
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