The Gaudi Framework
v36r7 (7f57a304)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
x
Enumerations
a
c
d
e
f
i
l
m
n
o
p
r
s
t
Enumerator
a
b
c
d
e
f
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Properties
Related Functions
:
a
b
c
d
e
g
h
i
m
o
p
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
_
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
z
Variables
a
b
c
d
e
g
h
i
m
o
p
r
s
t
v
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerations
Enumerator
c
e
f
p
u
v
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Kernel.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#ifndef GAUDIKERNEL_KERNEL_H
12
#define GAUDIKERNEL_KERNEL_H
13
14
// Some pragmas to avoid warnings in VisualC
15
#ifdef _WIN32
16
// Disable warning C4786: identifier was truncated to '255' characters in the debug information
17
# pragma warning( disable : 4786 )
18
// Disable warning C4291: no matching operator delete found; memory will not be freed if initialization throws an
19
// exception
20
# pragma warning( disable : 4291 )
21
// Disable warning C4250: inheritance via dominance
22
# pragma warning( disable : 4250 )
23
#endif
24
25
// Large integer definition depends of the platform
26
#ifndef NO_LONGLONG_TYPEDEF
27
typedef
long
long
int
longlong
;
28
typedef
unsigned
long
long
int
ulonglong
;
29
#endif
30
31
#ifndef LONGLONG_MAX
32
# define LONGLONG_MAX 0x7FFFFFFFFFFFFFFFLL
33
#endif
34
#ifndef LONGLONG_MIN
35
# define LONGLONG_MIN 0x8000000000000000LL
36
#endif
37
38
#ifndef ULONGLONG_MAX
39
# define ULONGLONG_MAX 0xfFFFFFFFFFFFFFFFLL
40
#endif
41
#ifndef ULONGLONG_MIN
42
# define ULONGLONG_MIN 0x0000000000000000LL
43
#endif
44
45
// ---------------------------------- Symbol visibility macros (begin)
46
// Enabled on in Gaudi v21 mode
47
#if !defined( GAUDI_V20_COMPAT ) || defined( G21_HIDE_SYMBOLS )
48
// These macros will allow selection on exported symbols
49
// taken from http://gcc.gnu.org/wiki/Visibility
50
# if __GNUC__ >= 4 && !defined( __CINT__ )
51
# define GAUDI_HASCLASSVISIBILITY
52
# endif
53
54
# ifdef _WIN32
55
/*
56
# define GAUDI_IMPORT __declspec(dllimport)
57
# define GAUDI_EXPORT __declspec(dllexport)
58
# define GAUDI_LOCAL
59
*/
60
// The symbol visibility is disabled on Win32 because it is not possible to
61
// make coexists the gcc and VC ways.
62
# define GAUDI_IMPORT
63
# define GAUDI_EXPORT
64
# define GAUDI_LOCAL
65
# else
66
# if defined( GAUDI_HASCLASSVISIBILITY )
67
# define GAUDI_IMPORT __attribute__( ( visibility( "default" ) ) )
68
# define GAUDI_EXPORT __attribute__( ( visibility( "default" ) ) )
69
# define GAUDI_LOCAL __attribute__( ( visibility( "hidden" ) ) )
70
# else
71
# define GAUDI_IMPORT
72
# define GAUDI_EXPORT
73
# define GAUDI_LOCAL
74
# endif
75
# endif
76
77
// Define GAUDI_API for DLL builds
78
# ifdef GAUDI_LINKER_LIBRARY
79
# define GAUDI_API GAUDI_EXPORT
80
# else
81
# define GAUDI_API GAUDI_IMPORT
82
# endif
83
#else
84
// Dummy definitions for the backward compatibility mode.
85
# define GAUDI_API
86
# define GAUDI_IMPORT
87
# define GAUDI_EXPORT
88
# define GAUDI_LOCAL
89
#endif // GAUDI_V20_COMPAT
90
// ---------------------------------- Symbol visibility macros (end)
91
92
// -------------- LIKELY/UNLIKELY macros (begin)
93
// Use compiler hinting to improve branch prediction for linux
94
// if somebody defined these macros before us, clean up first
95
#if defined( LIKELY )
96
# undef LIKELY
97
#endif
98
#if defined( UNLIKELY )
99
# undef UNLIKELY
100
#endif
101
#if defined( __GNUC__ ) || defined( __clang__ )
102
# define LIKELY( x ) __builtin_expect( ( x ), 1 )
103
# define UNLIKELY( x ) __builtin_expect( ( x ), 0 )
104
#else
105
# define LIKELY( x ) x
106
# define UNLIKELY( x ) x
107
#endif
108
// -------------- LIKELY/UNLIKELY macros (end)
109
110
// -----------------------------------------------------------------------------
111
// Sanitizer suppressions
112
// Gcc
113
#if defined( __GNUC__ )
114
# if defined( __SANITIZE_ADDRESS__ )
115
# define GAUDI_NO_SANITIZE_ADDRESS __attribute__( ( no_sanitize_address ) )
116
# endif
117
// Note there is no __SANITIZE_MEMORY__ to test for
118
# define GAUDI_NO_SANITIZE_MEMORY __attribute__( ( no_sanitize_memory ) )
119
// Note there is no __SANITIZE_UNDEFINED__ to test for
120
# define GAUDI_NO_SANITIZE_UNDEFINED __attribute__( ( no_sanitize_undefined ) )
121
// Note there is no __SANITIZE_THREAD__ to test for
122
# define GAUDI_NO_SANITIZE_THREAD __attribute__( ( no_sanitize_thread ) )
123
#endif
124
// clang
125
#if defined( __clang__ )
126
# if __has_feature( address_sanitizer )
127
# define GAUDI_NO_SANITIZE_ADDRESS __attribute__( ( no_sanitize( "address" ) ) )
128
# endif
129
# if __has_feature( memory_sanitizer )
130
# define GAUDI_NO_SANITIZE_MEMORY __attribute__( ( no_sanitize( "memory" ) ) )
131
# endif
132
# if __has_feature( undefined_sanitizer )
133
# define GAUDI_NO_SANITIZE_UNDEFINED __attribute__( ( no_sanitize( "undefined" ) ) )
134
# endif
135
# if __has_feature( thread_sanitizer )
136
# define GAUDI_NO_SANITIZE_THREAD __attribute__( ( no_sanitize( "thread" ) ) )
137
# endif
138
#endif
139
// defaults
140
#ifndef GAUDI_NO_SANITIZE_ADDRESS
141
# define GAUDI_NO_SANITIZE_ADDRESS
142
#endif
143
#ifndef GAUDI_NO_SANITIZE_MEMORY
144
# define GAUDI_NO_SANITIZE_MEMORY
145
#endif
146
#ifndef GAUDI_NO_SANITIZE_UNDEFINED
147
# define GAUDI_NO_SANITIZE_UNDEFINED
148
#endif
149
#ifndef GAUDI_NO_SANITIZE_THREAD
150
# define GAUDI_NO_SANITIZE_THREAD
151
#endif
152
// -----------------------------------------------------------------------------
153
154
// -----------------------------------------------------------------------------
155
// Adds compiler specific hints for loop unrolling.
156
// To use place the macro directly before the loop you wish to unroll. e.g.
157
//
158
// GAUDI_LOOP_UNROLL(N)
159
// for ( std::size_t i = 0; i < N; ++i ) {
160
// // do stuff
161
// }
162
//
163
// Constraints on N are it needs to be something known at compile time.
164
// Gains are most obvious with small fixed size (compile time) loops,
165
// but in principle can be used with any loop.
166
#define GAUDI_DO_PRAGMA( x ) _Pragma( #x )
167
#if defined( __clang__ )
168
# define GAUDI_LOOP_UNROLL( x ) GAUDI_DO_PRAGMA( clang loop unroll_count( x ) )
169
#elif defined( __GNUC__ )
170
# define GAUDI_LOOP_UNROLL( x ) GAUDI_DO_PRAGMA( GCC unroll x )
171
#else
172
# define GAUDI_LOOP_UNROLL( x )
173
#endif
174
// -----------------------------------------------------------------------------
175
176
#endif // GAUDIKERNEL_KERNEL_H
longlong
long long int longlong
Definition:
Kernel.h:27
ulonglong
unsigned long long int ulonglong
Definition:
Kernel.h:28
GaudiKernel
include
GaudiKernel
Kernel.h
Generated on Fri Jul 29 2022 20:50:43 for The Gaudi Framework by
1.8.18