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_AVX512_MAXPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX512_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
40  {
41  typedef typename UpperType<typename UpperType<T>::Type>::Type UpperT;
43  cast<eInstructionSet::eIS_Avx512>(in, inUpper);
45  }
46 };
47 
50 template <typename T>
52  typename boost::enable_if_c<boost::is_integral<T>::value
53  && sizeof(T) == 2>::type>
54 {
55  static IPSDK_FORCEINLINE
56  T
58  {
59  typedef typename UpperType<T>::Type UpperT;
61  cast<eInstructionSet::eIS_Avx512>(in, inUpper);
63  }
64 };
65 
68 template <typename T>
70  typename boost::enable_if_c<boost::is_integral<T>::value
71  && sizeof(T) == 4>::type>
72 {
73  static IPSDK_FORCEINLINE
74  T
76  {
77  const typename Avx512Type<T>::Type res0 =
79  in._val[0], in._val[1]);
80  const typename Avx512Type<T>::Type res1 =
82  res0, in._val[2]);
83  const typename Avx512Type<T>::Type res =
85  res1, in._val[3]);
87  }
88 };
89 
92 template <typename T>
94  typename boost::enable_if_c<boost::is_integral<T>::value
95  && sizeof(T) == 8>::type>
96 {
97  static IPSDK_FORCEINLINE
98  T
100  {
102  typename Avx512Type<T>::Type res = MaxR::act(in._val[0], in._val[1]);
103  res = MaxR::act(res, in._val[2]);
104  res = MaxR::act(res, in._val[3]);
105  res = MaxR::act(res, in._val[4]);
106  res = MaxR::act(res, in._val[5]);
107  res = MaxR::act(res, in._val[6]);
108  res = MaxR::act(res, in._val[7]);
109 
111  }
112 };
113 
116 template <>
118 {
119  static IPSDK_FORCEINLINE
120  ipReal32
122  {
124  typedef Avx512Type<ipReal32>::Type RegF;
125  const RegF res0 = MaxR::act(in._val[0], in._val[1]);
126  const RegF res1 = MaxR::act(res0, in._val[2]);
127  const RegF res = MaxR::act(res1, in._val[3]);
129  }
130 };
131 
134 template <>
136 {
137  static IPSDK_FORCEINLINE
138  ipReal64
140  {
142  Avx512Type<ipReal64>::Type res = MaxR::act(in._val[0], in._val[1]);
143  res = MaxR::act(res, in._val[2]);
144  res = MaxR::act(res, in._val[3]);
145  res = MaxR::act(res, in._val[4]);
146  res = MaxR::act(res, in._val[5]);
147  res = MaxR::act(res, in._val[6]);
148  res = MaxR::act(res, in._val[7]);
149 
151  }
152 };
153 
156 
157 } // end of namespace reduction
158 } // end of namespace detail
159 } // end of namespace simd
160 } // end of namespace ipsdk
161 
162 #endif // __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX512_MAXREGIMPL_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
MaxReg template specialization for instruction set AVX512 and type ipReal64.
Definition: MaxRegDecl.h:153
cast function; casts a Pack<instructionSet, TIn> to a Pack<instructionSet, TOut>
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
(including fundation and byte and word instructions)
Definition: InstructionSetTypes.h:51
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
template structure UpperType<typename T>; its typedef Type gives the type just upper to T...
Definition: UpperType.h:42
structure MaxPack<eInstructionSet::domain instructionSet, typename T, typename Enable=void> ...
Definition: MaxPack.h:40
MaxReg template specialization for instruction set AVX512 and type ipReal32.
Definition: MaxRegDecl.h:136
Definition: MaxRegDecl.h:29
Definition of import/export macro for library.
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
structure used to retrieve AVX512 type associated to a base type
Definition: Avx512Types.h:36
structure containing intrinsic registers used to store vectorized data
Definition: BasePackDecl.h:29