IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SumPack.h
Go to the documentation of this file.
1 // SumPack.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX_SUMPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX_SUMPACK_H__
17 
22 
23 namespace ipsdk {
24 namespace simd {
25 namespace detail {
26 namespace reduction {
29 
32 template <>
34 {
35  static IPSDK_FORCEINLINE
38  {
40  res._val[0] = _mm256_add_pd(in._val[0], in._val[1]);
41  res._val[0] = _mm256_add_pd(res._val[0], in._val[2]);
42  res._val[0] = _mm256_add_pd(res._val[0], in._val[3]);
43  res._val[0] = _mm256_add_pd(res._val[0], in._val[4]);
44  res._val[0] = _mm256_add_pd(res._val[0], in._val[5]);
45  res._val[0] = _mm256_add_pd(res._val[0], in._val[6]);
46  res._val[0] = _mm256_add_pd(res._val[0], in._val[7]);
47 
49  _mm256_storeu_pd(tab, res._val[0]);
50 
51  return tab[0] + tab[1] + tab[2] + tab[3];
52  }
53 };
54 
57 template <>
59 {
60  static IPSDK_FORCEINLINE
63  {
65  cast<eInstructionSet::eIS_Avx, ipReal64>(in));
66  }
67 };
68 
71 
72 } // end of namespace reduction
73 } // end of namespace detail
74 } // end of namespace simd
75 } // end of namespace ipsdk
76 
77 #endif // __IPSDKUTIL_INSTRUCTIONSET_REDUCTION_DETAIL_AVX_SUMPACK_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>
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
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
Advanced Vector Extensions.
Definition: InstructionSetTypes.h:44
structure SumPack<eInstructionSet::domain instructionSet, typename T, typename Enable=void> ...
Definition: SumPack.h:40
specialization of ipsdk::simd::detail::AddReg structure for AVX instruction set
Definition of import/export macro for library.
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
structure containing intrinsic registers used to store vectorized data
Definition: BasePackDecl.h:29