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_AVX2_MINPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX2_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
38  act(const BasePack<ePackType::ePT_Avx, T>& in)
39  {
41  in._val[0]);
42  }
43 };
44 
47 template <typename T>
49  typename boost::enable_if_c<sizeof(T) == 2>::type>
50 {
51  static IPSDK_FORCEINLINE
52  T
53  act(const BasePack<ePackType::ePT_Avx, T>& in)
54  {
55  const typename AvxType<T>::Type res =
57  in._val[0], in._val[1]);
59  }
60 };
61 
64 template <typename T>
66  typename boost::enable_if_c<sizeof(T) == 4>::type>
67 {
68  static IPSDK_FORCEINLINE
69  T
70  act(const BasePack<ePackType::ePT_Avx, T>& in)
71  {
72  const typename AvxType<T>::Type res0 =
74  in._val[0], in._val[1]);
75  const typename AvxType<T>::Type res1 =
77  res0, in._val[2]);
78  const typename AvxType<T>::Type res =
80  res1, in._val[3]);
82  }
83 };
84 
87 template <typename T>
89  typename boost::enable_if_c<sizeof(T) == 8>::type>
90 {
91  static IPSDK_FORCEINLINE
92  T
93  act(const BasePack<ePackType::ePT_Avx, T>& in)
94  {
96  typename AvxType<T>::Type res = MinR::act(in._val[0], in._val[1]);
97  res = MinR::act(res, in._val[2]);
98  res = MinR::act(res, in._val[3]);
99  res = MinR::act(res, in._val[4]);
100  res = MinR::act(res, in._val[5]);
101  res = MinR::act(res, in._val[6]);
102  res = MinR::act(res, in._val[7]);
103 
105  }
106 };
107 
108 
111 
112 } // end of namespace reduction
113 } // end of namespace detail
114 } // end of namespace simd
115 } // end of namespace ipsdk
116 
117 #endif // __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX2_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>
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Advanced Vector Extensions 2.
Definition: InstructionSetTypes.h:48
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 AVX type associated to a base type
Definition: AvxTypes.h:33