IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AssignPackImpl.h
Go to the documentation of this file.
1 // AssignPackImpl.h:
3 // ------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_ASSIGNPACKIMPL_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_ASSIGNPACKIMPL_H__
17 
24 
25 #include <boost/type_traits/is_same.hpp>
26 #include <boost/type_traits/is_signed.hpp>
27 
28 namespace ipsdk {
29 namespace simd {
30 namespace detail {
31 
34 
35 IPSDK_FORCEINLINE
36 BasePack<ePackType::ePT_Avx, ipReal32>
37 AssignPack<eInstructionSet::eIS_Avx, ipReal32>::act(const ipReal32& value)
38 {
39  BasePack<ePackType::ePT_Avx, ipReal32> packOut;
40  /*const AvxType<ipReal32>::Type value256 =
41  AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);*/
42  packOut._val[0] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
43  packOut._val[1] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
44  packOut._val[2] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
45  packOut._val[3] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
46 
47  return packOut;
48 }
49 
50 IPSDK_FORCEINLINE
51 void
52 AssignPack<eInstructionSet::eIS_Avx, ipReal32>::act(
53  BasePack<ePackType::ePT_Avx, ipReal32>& pack, const ipReal32& value)
54 {
55  const AvxType<ipReal32>::Type value256 =
56  AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
57  pack._val[0] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
58  pack._val[1] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
59  pack._val[2] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
60  pack._val[3] = AssignReg<eInstructionSet::eIS_Avx, ipReal32>::act(value);
61 }
62 
63 IPSDK_FORCEINLINE
64 BasePack<ePackType::ePT_Avx, ipReal64>
65 AssignPack<eInstructionSet::eIS_Avx, ipReal64>::act(const ipReal64& value)
66 {
67  BasePack<ePackType::ePT_Avx, ipReal64> packOut;
68  const AvxType<ipReal64>::Type value256 =
69  AssignReg<eInstructionSet::eIS_Avx, ipReal64>::act(value);
70  packOut._val[0] = value256;
71  packOut._val[1] = value256;
72  packOut._val[2] = value256;
73  packOut._val[3] = value256;
74  packOut._val[4] = value256;
75  packOut._val[5] = value256;
76  packOut._val[6] = value256;
77  packOut._val[7] = value256;
78 }
79 
80 IPSDK_FORCEINLINE
81 void
82 AssignPack<eInstructionSet::eIS_Avx, ipReal64>::act(
83  BasePack<ePackType::ePT_Avx, ipReal64>& pack, const ipReal64& value)
84 {
85  const AvxType<ipReal64>::Type value256 =
86  AssignReg<eInstructionSet::eIS_Avx, ipReal64>::act(value);
87  pack._val[0] = value256;
88  pack._val[1] = value256;
89  pack._val[2] = value256;
90  pack._val[3] = value256;
91  pack._val[4] = value256;
92  pack._val[5] = value256;
93  pack._val[6] = value256;
94  pack._val[7] = value256;
95 }
96 
99 
100 } // end of namespace detail
101 } // end of namespace simd
102 } // end of namespace ipsdk
103 
105 
106 #endif // __IPSDKUTIL_INSTRUCTIONSET_DETAIL_AVX_ASSIGNPACKIMPL_H__
Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Definition of import/export macro for library.
float ipReal32
Base types definition.
Definition: BaseTypes.h:56