BmnRoot
Loading...
Searching...
No Matches
CbmL1Def.h
Go to the documentation of this file.
1#ifndef CbmL1Def_h
2#define CbmL1Def_h 1
3
4// #define FAST_CODE // FAST_CODE = more unsafe
5
6#include <assert.h>
7
8#ifdef HAVE_SSE
9 #include "vectors/P4_F32vec4.h"
10// #include "vectors/P4_F64vec2.h"
11
12#else
14 #error NoSseFound
15#endif // HAVE_SSE
16
17//#include "vectors/PSEUDO_F64vec1.h"
18
19
20
21#ifdef FAST_CODE
22
23#define L1_NO_ASSERT // use with asserts, etc.
24#define L1_DYNAMIC_CAST static_cast
25
26#else // FAST_CODE
27
28#define L1_DYNAMIC_CAST dynamic_cast
29
30#endif // FAST_CODE
31
32#if 1 && defined( __GNUC__ ) && __GNUC__ - 0 >= 3 // for speed up conditions
33#define ISLIKELY( x ) __builtin_expect( !!( x ),1 )
34#define ISUNLIKELY( x ) __builtin_expect( !!( x ),0 )
35#else
36#define ISLIKELY( x ) ( x )
37#define ISUNLIKELY( x ) ( x )
38#endif
39
40#if defined( NDEBUG ) || defined( L1_NO_ASSERT )
41#define L1_ASSERT(v, msg)
42#define L1_assert(v)
43#else
44#define L1_ASSERT(v, msg) \
45if (v) {} else { \
46 std::cerr << __FILE__ << ":" << __LINE__ << " assertion failed: " \
47 << #v << " = " << (v) << "\n" << msg << std::endl; \
48 abort(); \
49}
50#define L1_assert(v) assert(v)
51#endif
52
53
54
55
56
57
58
59#endif // CbmL1Def_h