Loading [MathJax]/extensions/TeX/AMSsymbols.js
Stan Math Library
5.0.0
Automatic Differentiation
▼
Stan Math Library
Overview
▼
Contributor Guides
Developer Guide
Adding New Functions
Adding New Distributions
Common Pitfalls
Using requires for general overloads
Reverse Mode Types
Testing Automatic Differentiation Functions
Testing New Distributions
Add New Functions With Known Gradients
Adding New OpenCL Functions
Windows Development Tips
▼
Internal Docs
►
Probability Distributions
►
OpenCL
►
Compressed Sparse Row matrix format.
►
Type Traits
►
Available requires<> for overloading.
►
Eigen expressions
►
arena_matrix <br>
►
real <br>
►
Parallelism
(External Link) Stan Language Docs
(External Link) Stan Discourse
►
Stan Math Library Docs
►
Class List
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
compiler_attributes.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_META_COMPILER_ATTRIBUTES_HPP
2
#define STAN_MATH_PRIM_META_COMPILER_ATTRIBUTES_HPP
3
4
#ifdef __GNUC__
5
#ifndef likely
6
#define likely(x) __builtin_expect(!!(x), 1)
7
#endif
8
#ifndef unlikely
9
#define unlikely(x) __builtin_expect(!!(x), 0)
10
#endif
11
#ifdef __has_attribute
12
#if __has_attribute(noinline) && __has_attribute(cold)
13
#ifndef STAN_COLD_PATH
19
#define STAN_COLD_PATH __attribute__((noinline, cold))
20
#endif
21
#endif
22
#endif
23
#endif
24
#ifndef STAN_COLD_PATH
25
#define STAN_COLD_PATH
26
#endif
27
#ifndef likely
28
#define likely(x) x
29
#endif
30
#ifndef unlikely
31
#define unlikely(x) x
32
#endif
33
37
#ifndef STAN_NO_RANGE_CHECKS_RETURN
41
#ifdef STAN_NO_RANGE_CHECKS
42
#define STAN_NO_RANGE_CHECKS_RETURN return
43
#endif
44
#ifndef STAN_NO_RANGE_CHECKS_RETURN
45
#define STAN_NO_RANGE_CHECKS_RETURN
46
#endif
47
#endif
48
49
#endif
stan
math
prim
meta
compiler_attributes.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.