7 #ifndef ALIHLTTPCCADEF_H
8 #define ALIHLTTPCCADEF_H
28 using ::Vc::VectorAlignment;
41 static inline ushort_m validHitIndexes(
const ushort_v &v )
43 return static_cast<short_v
>( v ) >= short_v( Vc::Zero );
55 #if defined(HLTCA_STANDALONE)
56 typedef unsigned char UChar_t;
57 typedef UChar_t Byte_t;
59 typedef double Double_t;
66 #define ASSERT(v, msg)
68 #define ASSERT(v, msg) \
70 std::cerr << __FILE__ << ":" << __LINE__ << " assertion failed: " \
71 << #v << " = " << (v) << "\n" << msg << std::endl; \
83 template<
bool>
struct HLTTPCCA_STATIC_ASSERT_FAILURE;
84 template<>
struct HLTTPCCA_STATIC_ASSERT_FAILURE<true> {};
87 #define HLTTPCCA_STATIC_ASSERT_CONCAT_HELPER(a, b) a##b
88 #define HLTTPCCA_STATIC_ASSERT_CONCAT(a, b) HLTTPCCA_STATIC_ASSERT_CONCAT_HELPER(a, b)
89 #define STATIC_ASSERT(cond, msg) \
90 typedef HLTTPCCA_STATIC_ASSERT_FAILURE<cond> HLTTPCCA_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__); \
91 HLTTPCCA_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__) Error_##msg; \
97 void UNUSED_PARAM1(
const T1 & ) {}
98 template<
typename T1,
typename T2>
99 void UNUSED_PARAM2(
const T1 &,
const T2 & ) {}
100 template<
typename T1,
typename T2,
typename T3>
101 void UNUSED_PARAM3(
const T1 &,
const T2 &,
const T3 & ) {}
102 template<
typename T1,
typename T2,
typename T3,
typename T4>
103 void UNUSED_PARAM4(
const T1 &,
const T2 &,
const T3 &,
const T4 & ) {}
104 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
105 void UNUSED_PARAM5(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
const T5 & ) {}
106 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
107 void UNUSED_PARAM6(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
const T5 &,
const T6 & ) {}
108 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
109 void UNUSED_PARAM7(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
const T5 &,
const T6 &,
const T7 & ) {}
110 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
111 void UNUSED_PARAM8(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
const T5 &,
const T6 &,
const T7 &,
const T8 & ) {}
112 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
113 void UNUSED_PARAM9(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
const T5 &,
const T6 &,
const T7 &,
const T8 &,
const T9 & ) {}
116 #define unrolled_loop4( _type_, _it_, _start_, _end_, _code_ ) \
117 if (_start_ + 0 < _end_) { enum { _it_ = (_start_ + 0) < _end_ ? (_start_ + 0) : _start_ }; _code_ } \
118 if (_start_ + 1 < _end_) { enum { _it_ = (_start_ + 1) < _end_ ? (_start_ + 1) : _start_ }; _code_ } \
119 if (_start_ + 2 < _end_) { enum { _it_ = (_start_ + 2) < _end_ ? (_start_ + 2) : _start_ }; _code_ } \
120 if (_start_ + 3 < _end_) { enum { _it_ = (_start_ + 3) < _end_ ? (_start_ + 3) : _start_ }; _code_ } \
121 do {} while ( false )
124 #define MAY_ALIAS __attribute__((__may_alias__))
129 #if defined( __GNUC__ ) && __GNUC__ - 0 >= 3
130 # define ISLIKELY( x ) __builtin_expect( !!( x ),1 )
131 # define ISUNLIKELY( x ) __builtin_expect( !!( x ),0 )
133 # define ISLIKELY( x ) ( x )
134 # define ISUNLIKELY( x ) ( x )