IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
MinPack.h
Go to the documentation of this file.
1 // MinPack.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX512_MINPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX512_MINPACK_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<sizeof(T) == 1>::type>
35 {
36  static IPSDK_FORCEINLINE
37  T
39  {
40  typedef typename UpperType<typename UpperType<T>::Type>::Type UpperT;
42  cast<eInstructionSet::eIS_Avx512>(in, inUpper);
44  }
45 };
46 
49 template <typename T>
51  typename boost::enable_if_c<sizeof(T) == 2>::type>
52 {
53  static IPSDK_FORCEINLINE
54  T
56  {
57  typedef typename UpperType<T>::Type UpperT;
59  cast<eInstructionSet::eIS_Avx512>(in, inUpper);
61  }
62 };
63 
66 template <typename T>
68  typename boost::enable_if_c<sizeof(T) == 4>::type>
69 {
70  static IPSDK_FORCEINLINE
71  T
73  {
74  const typename Avx512Type<T>::Type res0 =
76  in._val[0], in._val[1]);
77  const typename Avx512Type<T>::Type res1 =
79  res0, in._val[2]);
80  const typename Avx512Type<T>::Type res =
82  res1, in._val[3]);
84  }
85 };
86 
89 template <typename T>
91  typename boost::enable_if_c<sizeof(T) == 8>::type>
92 {
93  static IPSDK_FORCEINLINE
94  T
96  {
98  typename Avx512Type<T>::Type res = MinR::act(in._val[0], in._val[1]);
99  res = MinR::act(res, in._val[2]);
100  res = MinR::act(res, in._val[3]);
101  res = MinR::act(res, in._val[4]);
102  res = MinR::act(res, in._val[5]);
103  res = MinR::act(res, in._val[6]);
104  res = MinR::act(res, in._val[7]);
105 
107  }
108 };
109 
110 
113 
114 } // end of namespace reduction
115 } // end of namespace detail
116 } // end of namespace simd
117 } // end of namespace ipsdk
118 
119 #endif // __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX512_MINREGIMPL_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: MinRegDecl.h:29
cast function; casts a Pack<instructionSet, TIn> to a Pack<instructionSet, TOut>
(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 MinPack<eInstructionSet::domain instructionSet, typename T, typename Enable=void> ...
Definition: MinPack.h:41
Definition of import/export macro for library.
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