IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ScanPack.h
Go to the documentation of this file.
1 // ScanPack.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_SCANPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_SCANPACK_H__
17 
25 
26 namespace ipsdk {
27 namespace simd {
28 namespace detail {
29 
32 
35 template <>
37 {
38  static IPSDK_FORCEINLINE
41  {
43  }
44 
45  static IPSDK_FORCEINLINE
46  void
49  {
51  }
52 };
53 
54 template <>
56 {
57  static IPSDK_FORCEINLINE
58  void act(const ipReal32* in, ipReal32* out, ipUInt64 nbElts)
59  {
61  }
62 };
63 
64 template <>
66 {
67  static IPSDK_FORCEINLINE
68  void act(const ipReal64* in, ipReal64* out, ipUInt64 nbElts)
69  {
70  __m256d regOffset = _mm256_setzero_pd();
71 
72  const ipUInt64 nbAlignedElts = nbElts - (nbElts%simd::NbEltsPerReg<ePackType::ePT_Avx, ipReal64>::Value);
73 
74  ipUInt64 i = 0;
75 
77 
78  for (; i < nbAlignedElts; i += simd::NbEltsPerReg<ePackType::ePT_Avx, ipReal64>::Value) {
79 
82 
83  regOut = _mm256_add_pd(regOut, regOffset);
85  regOffset = _mm256_permute4x64_pd(regOut, 0xff);
86  }
87  for (; i < nbElts; ++i) {
88 
89  // update of mean
90  out[i] = out[i - 1] + in[i];
91  }
92  }
93 };
94 
97 
98 } // end of namespace detail
99 } // end of namespace simd
100 } // end of namespace ipsdk
101 
102 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_SCANPACK_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
template structure which is specialized to implement the cumulative sum on 2 registers, depending on the used instructionSet and on the types of the buffers loaded in the registers
Definition: ScanReg.h:36
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Definition: NbEltsPerReg.h:28
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Advanced Vector Extensions 2.
Definition: InstructionSetTypes.h:48
Definition: ScanPack.h:35
Definition of import/export macro for library.
structure containing intrinsic registers used to store vectorized data
Definition: BaseReg.h:29
Definition: UnloadReg.h:30
Definition: LoadRegDecl.h:30
Definition: ScanPack.h:30
float ipReal32
Base types definition.
Definition: BaseTypes.h:56
structure containing intrinsic registers used to store vectorized data
Definition: BasePackDecl.h:29