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_SSE2_MINPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_SSE2_MINPACK_H__
17 
24 
25 namespace ipsdk {
26 namespace simd {
27 namespace detail {
28 namespace reduction {
29 
32 
35 template <typename T>
37  typename boost::enable_if_c<sizeof(T) == 1>::type>
38 {
39  static IPSDK_FORCEINLINE
40  T
41  act(const BasePack<ePackType::ePT_Sse, T>& in)
42  {
44  }
45 };
46 
49 template <typename T>
51  typename boost::enable_if_c<sizeof(T) == 2>::type>
52 {
53  static IPSDK_FORCEINLINE
54  T
55  act(const BasePack<ePackType::ePT_Sse, T>& in)
56  {
57  const typename Sse2Type<T>::Type res =
59  in._val[0], in._val[1]);
61  }
62 };
63 
66 template <typename T>
68  typename boost::enable_if_c<sizeof(T) == 4>::type>
69 {
70  static IPSDK_FORCEINLINE
71  T
72  act(const BasePack<ePackType::ePT_Sse, T>& in)
73  {
75  typename Sse2Type<T>::Type res = MinR::act(in._val[0], in._val[1]);
76  res = MinR::act(res, in._val[2]);
77  res = MinR::act(res, in._val[3]);
78 
80  }
81 };
82 
85 template <typename T>
87  typename boost::enable_if_c<sizeof(T) == 8>::type>
88 {
89  static IPSDK_FORCEINLINE
90  T
91  act(const BasePack<ePackType::ePT_Sse, T>& in)
92  {
94  typename Sse2Type<T>::Type res = MinR::act(in._val[0], in._val[1]);
95  res = MinR::act(res, in._val[2]);
96  res = MinR::act(res, in._val[3]);
97  res = MinR::act(res, in._val[4]);
98  res = MinR::act(res, in._val[5]);
99  res = MinR::act(res, in._val[6]);
100  res = MinR::act(res, in._val[7]);
101 
103  }
104 };
105 
108 
109 } // end of namespace reduction
110 } // end of namespace detail
111 } // end of namespace simd
112 } // end of namespace ipsdk
113 
114 #endif // __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_SSE2_MINPACK_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: MinRegDecl.h:29
template structure, specialized to implement the computation of the minimum of the elements loaded in...
cast function; casts a Pack<instructionSet, TIn> to a Pack<instructionSet, TOut>
template structure which is specialized to implement the minimum computation on 2 scalars or 2 regist...
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
structure MinPack<eInstructionSet::domain instructionSet, typename T, typename Enable=void> ...
Definition: MinPack.h:41
Definition of import/export macro for library.
unload function; unloads a pack into a memory buffer
Streaming SIMD Extensions 2.
Definition: InstructionSetTypes.h:36
structure used to retrieve SSE2 type associated to a base type
Definition: Sse2Types.h:32