IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AlignedBasic.h
Go to the documentation of this file.
1 // AlignedBasic.h:
3 // ---------------
4 //
15 
16 #ifndef __IPSDKUTIL_ALIGNEDBASIC_H__
17 #define __IPSDKUTIL_ALIGNEDBASIC_H__
18 
19 #include <IPSDKUtil/InstructionSet/Pack.h>
23 
24 namespace ipsdk {
25 
28 
32 template <ipsdk::eInstructionSet::domain IS,
33  typename BufType>
34 static IPSDK_FORCEINLINE void
35 alignedCopy(const BufType* pInputBuf,
36  const ipUInt64 size,
37  BufType* pOutputBuf)
38 {
39  simd::Pack<IS, BufType> inputPack;
40  for(ipUInt64 k=0; k<size; k+=simd::NbEltsPerOp<IS>::Value) {
41 
42  simd::load<IS>(inputPack, pInputBuf + k);
43  simd::unload<IS>(inputPack, pOutputBuf + k);
44  }
45 }
46 
50 template <ipsdk::eInstructionSet::domain IS,
51  typename BufType>
52 static IPSDK_FORCEINLINE void
53 alignedSet(const BufType& value,
54  const ipUInt64 size,
55  BufType* pOutputBuf)
56 {
57  simd::Pack<IS, BufType> inputPack;
58  simd::assign<IS>(inputPack, value);
59  for(ipUInt64 k=0; k<size; k+=simd::NbEltsPerOp<IS>::Value)
60  simd::unload<IS>(inputPack, pOutputBuf + k);
61 }
62 
65 
66 } // end of namespace ipsdk
67 
68 #endif // __IPSDKUTIL_ALIGNEDBASIC_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
load function; loads a buffer into a pack
function assigning a given value of type T to a given Pack<instructionSet, T>
unload function; unloads a pack into a memory buffer