IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ToMaskPack.h
Go to the documentation of this file.
1 // ToMaskPack.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_COMMON_TOMASKPACK_H__
16 #define __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_COMMON_TOMASKPACK_H__
17 
25 
26 namespace ipsdk {
27 namespace simd {
28 namespace detail {
29 
32 
34 template <eInstructionSet::domain IS, typename TOut, typename TIn>
35 struct ToMaskPack<IS, TOut, TIn>
36 {
37  static IPSDK_FORCEINLINE
39  act(const typename IS2Pack<IS, TIn>::Type& in)
40  {
41  typename IS2Pack<IS, TOut>::Type inTOut, zero;
42  assign<IS>(zero, 0);
43  cast<IS>(in, inTOut);
44  return isNotEqual<IS>(inTOut, zero);
45  }
46 
47  static IPSDK_FORCEINLINE
48  void
49  act(const typename IS2Pack<IS, TIn>::Type& in,
50  typename IS2MaskPack<IS, TOut>::Type& out)
51  {
52  typename IS2Pack<IS, TOut>::Type inTOut, zero;
53  assign<IS>(zero, 0);
54  cast<IS>(in, inTOut);
55  isNotEqual<IS>(inTOut, zero, out);
56  }
57 };
58 
61 
62 } // end of namespace detail
63 } // end of namespace simd
64 } // end of namespace ipsdk
65 
66 #endif // __IPSDKUTIL_INSTRUCTIONSET_LOGICAL_DETAIL_COMMON_TOMASKPACK_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>
Definition: IS2MaskPack.h:34
Definition: ToMaskPack.h:30
function assigning a given value of type T to a given Pack<instructionSet, T>
Definition of import/export macro for library.
Definition: IS2Pack.h:34