IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
MaxPack.h
Go to the documentation of this file.
1 // MaxPack.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX2_MAXPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX2_MAXPACK_H__
17 
21 
22 namespace ipsdk {
23 namespace simd {
24 namespace detail {
25 namespace reduction {
26 
29 
32 template <typename T>
34  typename boost::enable_if_c<boost::is_integral<T>::value
35  && sizeof(T) == 1>::type>
36 {
37  static IPSDK_FORCEINLINE
38  T
39  act(const BasePack<ePackType::ePT_Avx, T>& in)
40  {
42  }
43 };
44 
47 template <typename T>
49  typename boost::enable_if_c<boost::is_integral<T>::value
50  && sizeof(T) == 2>::type>
51 {
52  static IPSDK_FORCEINLINE
53  T
54  act(const BasePack<ePackType::ePT_Avx, T>& in)
55  {
56  const typename AvxType<T>::Type res =
58  in._val[0], in._val[1]);
60  }
61 };
62 
65 template <typename T>
67  typename boost::enable_if_c<boost::is_integral<T>::value
68  && sizeof(T) == 4>::type>
69 {
70  static IPSDK_FORCEINLINE
71  T
72  act(const BasePack<ePackType::ePT_Avx, T>& in)
73  {
74  const typename AvxType<T>::Type res0 =
76  in._val[0], in._val[1]);
77  const typename AvxType<T>::Type res1 =
79  res0, in._val[2]);
80  const typename AvxType<T>::Type res =
82  res1, in._val[3]);
84  }
85 };
86 
89 template <typename T>
91  typename boost::enable_if_c<boost::is_integral<T>::value
92  && sizeof(T) == 8>::type>
93 {
94  static IPSDK_FORCEINLINE
95  T
96  act(const BasePack<ePackType::ePT_Avx, T>& in)
97  {
99  typename AvxType<T>::Type res = MaxR::act(in._val[0], in._val[1]);
100  res = MaxR::act(res, in._val[2]);
101  res = MaxR::act(res, in._val[3]);
102  res = MaxR::act(res, in._val[4]);
103  res = MaxR::act(res, in._val[5]);
104  res = MaxR::act(res, in._val[6]);
105  res = MaxR::act(res, in._val[7]);
106 
108  }
109 };
110 
113 template <>
115 {
116  static IPSDK_FORCEINLINE
117  ipReal32
119  {
121  }
122 };
123 
126 template <>
128 {
129  static IPSDK_FORCEINLINE
130  ipReal64
132  {
134  }
135 };
136 
139 
140 } // end of namespace reduction
141 } // end of namespace detail
142 } // end of namespace simd
143 } // end of namespace ipsdk
144 
145 #endif // __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX2_MAXREGIMPL_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
cast function; casts a Pack<instructionSet, TIn> to a Pack<instructionSet, TOut>
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
structure MaxPack<eInstructionSet::domain instructionSet, typename T, typename Enable=void> ...
Definition: MaxPack.h:40
Advanced Vector Extensions 2.
Definition: InstructionSetTypes.h:48
Definition: MaxRegDecl.h:29
Definition of import/export macro for library.
structure used to retrieve AVX type associated to a base type
Definition: AvxTypes.h:33
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
structure containing intrinsic registers used to store vectorized data
Definition: BasePackDecl.h:29