IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
DivPack.h
Go to the documentation of this file.
1 // DivPack.h:
3 // -----------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX512_DIVPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX512_DIVPACK_H__
17 
27 
28 #include <boost/type_traits/is_same.hpp>
29 #include <boost/utility/enable_if.hpp>
30 
31 namespace ipsdk {
32 namespace simd {
33 namespace detail {
34 
37 
40 template <>
42 {
43  static
44  IPSDK_FORCEINLINE
48  {
51  }
52 
53  static
54  IPSDK_FORCEINLINE
55  void
59  {
62  }
63 };
64 
67 template <>
69 {
70  static
71  IPSDK_FORCEINLINE
75  {
78  }
79 
80  static
81  IPSDK_FORCEINLINE
82  void
86  {
89  }
90 };
91 
94 template <typename TIn1, typename TIn2>
95 struct DivPack<eInstructionSet::eIS_Avx512, TIn1, TIn2,
96  typename boost::enable_if_c<!boost::is_same<TIn1, TIn2>::value
97  && boost::is_same<TIn1, typename PromotedType<TIn1, TIn2>::Type>::value
98  >::type>
99 {
100  static
101  IPSDK_FORCEINLINE
105  {
106  const BasePack<ePackType::ePT_Avx512, TIn1> in2Promoted =
107  cast<eInstructionSet::eIS_Avx512, TIn2, TIn1>(in2);
109  }
110 
111  static
112  IPSDK_FORCEINLINE
113  void
117  {
119  cast<eInstructionSet::eIS_Avx512, TIn2, TIn1>(in2, in2Promoted);
121  }
122 };
123 
126 template <typename TIn1, typename TIn2>
127 struct DivPack<eInstructionSet::eIS_Avx512, TIn1, TIn2,
128  typename boost::enable_if_c<!boost::is_same<TIn1, TIn2>::value
129  && !boost::is_same<TIn1, typename PromotedType<TIn1, TIn2>::Type>::value
130  >::type>
131 {
132  static
133  IPSDK_FORCEINLINE
137  {
138  const BasePack<ePackType::ePT_Avx512, TIn2> in1Promoted =
139  cast<eInstructionSet::eIS_Avx512, TIn1, TIn2>(in1);
141  in1Promoted, in2);
142  }
143 
144  static
145  IPSDK_FORCEINLINE
146  void
150  {
152  cast<eInstructionSet::eIS_Avx512, TIn1, TIn2>(in1, in1Promoted);
154  in1Promoted, in2, out);
155  }
156 };
157 
160 template <typename TIn>
162  typename boost::enable_if_c<boost::is_integral<TIn>::value>::type>
163 {
164  static
165  IPSDK_FORCEINLINE
169  {
171  cast<eInstructionSet::eIS_Avx512, TIn, ipReal32>(in1);
173  cast<eInstructionSet::eIS_Avx512, TIn, ipReal32>(in2);
176 
177  return cast<eInstructionSet::eIS_Avx512, ipReal32, TIn>(outCast);
178  }
179 
180  static
181  IPSDK_FORCEINLINE
182  void
186  {
188  cast<eInstructionSet::eIS_Avx512>(in1, in1Cast);
190  cast<eInstructionSet::eIS_Avx512>(in2, in2Cast);
193  cast<eInstructionSet::eIS_Avx512>(outCast, out);
194  }
195 };
196 
200 
201 } // end of namespace detail
202 } // end of namespace simd
203 } // end of namespace ipsdk
204 
205 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX512_DIVPACK_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>
DivReg template specialization for instruction set AVX2 and for ipReal32.
Definition: DivReg.h:33
Definition: DivPack.h:40
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
(including fundation and byte and word instructions)
Definition: InstructionSetTypes.h:51
BasePack class; defines a set of scalars (for instruction set "standard") or registers (for all other...
DivReg template specialization for instruction set AVX512 and for ipReal64.
Definition: DivReg.h:56
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
defines template structures PromotedType<T1, T2> and PromotedType3<T1, T2, T3>; their attribute Type ...
Predefined types associated to instruction set management.
Definition of import/export macro for library.
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
Definition: BinaryPackOp.h:31
structure DivPack<typename TIn1, typename TIn2, typename Enable=void>
structure containing intrinsic registers used to store vectorized data
Definition: BasePackDecl.h:29