IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
RoundToNearestIntegralReg.h
Go to the documentation of this file.
1 // RoundToNearestIntegralReg.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_STD_ROUNDTONEARESTINTEGRALREG_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_STD_ROUNDTONEARESTINTEGRALREG_H__
17 
20 
21 #if __cplusplus > 199711L || (defined(_MSC_VER) && _MSC_VER >= 1800) // C++ 11 support
22 #include <cmath>
23 #else
24 #include <boost/math/special_functions/round.hpp>
25 #endif
26 
27 namespace ipsdk {
28 namespace simd {
29 namespace detail {
30 
33 
35 template <>
37 {
38  static IPSDK_FORCEINLINE
39  ipReal32
40  act(const ipReal32& in)
41  {
42  ipReal32 out;
43  act(in, out);
44  return out;
45  }
46 
47  static IPSDK_FORCEINLINE
48  void
49  act(const ipReal32& in, ipReal32& out)
50  {
51 #if __cplusplus > 199711L || (defined(_MSC_VER) && _MSC_VER >= 1800) // C++ 11 support
52  out = std::round(in);
53 #else
54  out = boost::math::round(in);
55 #endif
56  }
57 };
58 
61 
62 } // end of namespace detail
63 } // end of namespace simd
64 } // end of namespace ipsdk
65 
66 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_STD_ROUNDTONEARESTINTEGRALREG_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
template structure which is specialized to implement the computation of value rounded to closest even...
Definition: RoundToNearestIntegralReg.h:36
Definition of import/export macro for library.
compiler optimisations only
Definition: InstructionSetTypes.h:34
float ipReal32
Base types definition.
Definition: BaseTypes.h:56