Chris@49
|
1 // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 2008-2013 Conrad Sanderson
|
Chris@49
|
3 //
|
Chris@49
|
4 // This Source Code Form is subject to the terms of the Mozilla Public
|
Chris@49
|
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
|
Chris@49
|
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
Chris@49
|
7
|
Chris@49
|
8
|
Chris@49
|
9
|
Chris@49
|
10 #define arma_hot
|
Chris@49
|
11 #define arma_cold
|
Chris@49
|
12 #define arma_pure
|
Chris@49
|
13 #define arma_const
|
Chris@49
|
14 #define arma_aligned
|
Chris@49
|
15 #define arma_align_mem
|
Chris@49
|
16 #define arma_warn_unused
|
Chris@49
|
17 #define arma_deprecated
|
Chris@49
|
18 #define arma_malloc
|
Chris@49
|
19 #define arma_inline inline
|
Chris@49
|
20 #define arma_noinline
|
Chris@49
|
21 #define arma_ignore(variable) ((void)(variable))
|
Chris@49
|
22
|
Chris@49
|
23
|
Chris@49
|
24 #if defined(ARMA_BLAS_UNDERSCORE)
|
Chris@49
|
25 #define arma_fortran2_noprefix(function) function##_
|
Chris@49
|
26 #define arma_fortran2_prefix(function) wrapper_##function##_
|
Chris@49
|
27 #else
|
Chris@49
|
28 #define arma_fortran2_noprefix(function) function
|
Chris@49
|
29 #define arma_fortran2_prefix(function) wrapper_##function
|
Chris@49
|
30 #endif
|
Chris@49
|
31
|
Chris@49
|
32 #if defined(ARMA_USE_WRAPPER)
|
Chris@49
|
33 #define arma_fortran(function) arma_fortran2_prefix(function)
|
Chris@49
|
34 #define arma_atlas(function) wrapper_##function
|
Chris@49
|
35 #else
|
Chris@49
|
36 #define arma_fortran(function) arma_fortran2_noprefix(function)
|
Chris@49
|
37 #define arma_atlas(function) function
|
Chris@49
|
38 #endif
|
Chris@49
|
39
|
Chris@49
|
40 #define arma_fortran_prefix(function) arma_fortran2_prefix(function)
|
Chris@49
|
41 #define arma_fortran_noprefix(function) arma_fortran2_noprefix(function)
|
Chris@49
|
42
|
Chris@49
|
43
|
Chris@49
|
44 #define ARMA_INCFILE_WRAP(x) <x>
|
Chris@49
|
45
|
Chris@49
|
46
|
Chris@49
|
47 #if ( ((_POSIX_C_SOURCE >= 200112L) || (_XOPEN_SOURCE >= 600)) && !defined(__MINGW32__) && !defined(__APPLE__) )
|
Chris@49
|
48 #define ARMA_HAVE_POSIX_MEMALIGN
|
Chris@49
|
49 #endif
|
Chris@49
|
50
|
Chris@49
|
51
|
Chris@49
|
52 #if (__cplusplus >= 201103L)
|
Chris@49
|
53 #if !defined(ARMA_USE_CXX11)
|
Chris@49
|
54 #define ARMA_USE_CXX11
|
Chris@49
|
55 #endif
|
Chris@49
|
56 #endif
|
Chris@49
|
57
|
Chris@49
|
58
|
Chris@49
|
59 #if defined(ARMA_USE_CXX11)
|
Chris@49
|
60 #if !defined(ARMA_USE_U64S64)
|
Chris@49
|
61 #define ARMA_USE_U64S64
|
Chris@49
|
62 #endif
|
Chris@49
|
63 #endif
|
Chris@49
|
64
|
Chris@49
|
65
|
Chris@49
|
66 #if defined(ARMA_64BIT_WORD)
|
Chris@49
|
67 #if !defined(ARMA_USE_U64S64)
|
Chris@49
|
68 #define ARMA_USE_U64S64
|
Chris@49
|
69 #endif
|
Chris@49
|
70 #endif
|
Chris@49
|
71
|
Chris@49
|
72
|
Chris@49
|
73 #if defined(__INTEL_COMPILER)
|
Chris@49
|
74
|
Chris@49
|
75 #if (__INTEL_COMPILER < 1000)
|
Chris@49
|
76 #error "*** Need a newer compiler ***"
|
Chris@49
|
77 #endif
|
Chris@49
|
78
|
Chris@49
|
79 #define ARMA_GOOD_COMPILER
|
Chris@49
|
80 #undef ARMA_HAVE_STD_TR1
|
Chris@49
|
81
|
Chris@49
|
82 #if (__INTEL_COMPILER <= 1110)
|
Chris@49
|
83 #undef ARMA_HAVE_STD_ISFINITE
|
Chris@49
|
84 #endif
|
Chris@49
|
85
|
Chris@49
|
86 // #undef arma_aligned
|
Chris@49
|
87 // #define arma_aligned __attribute__((aligned(16)))
|
Chris@49
|
88
|
Chris@49
|
89 #if defined(_MSC_VER)
|
Chris@49
|
90 #undef arma_align_mem
|
Chris@49
|
91 #define arma_align_mem __declspec(align(16))
|
Chris@49
|
92 #else
|
Chris@49
|
93 #undef arma_align_mem
|
Chris@49
|
94 #define arma_align_mem __attribute__((aligned(16)))
|
Chris@49
|
95 #endif
|
Chris@49
|
96
|
Chris@49
|
97 #define ARMA_HAVE_ALIGNED_ATTRIBUTE
|
Chris@49
|
98 #define ARMA_HAVE_ICC_ASSUME_ALIGNED
|
Chris@49
|
99
|
Chris@49
|
100 #elif defined(__GNUG__)
|
Chris@49
|
101
|
Chris@49
|
102 #if (__GNUC__ < 4)
|
Chris@49
|
103 #error "*** Need a newer compiler ***"
|
Chris@49
|
104 #endif
|
Chris@49
|
105
|
Chris@49
|
106 #define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
Chris@49
|
107
|
Chris@49
|
108 #define ARMA_GOOD_COMPILER
|
Chris@49
|
109 #undef ARMA_HAVE_STD_TR1
|
Chris@49
|
110
|
Chris@49
|
111 #undef arma_pure
|
Chris@49
|
112 #undef arma_const
|
Chris@49
|
113 #undef arma_aligned
|
Chris@49
|
114 #undef arma_align_mem
|
Chris@49
|
115 #undef arma_warn_unused
|
Chris@49
|
116 #undef arma_deprecated
|
Chris@49
|
117 #undef arma_malloc
|
Chris@49
|
118 #undef arma_inline
|
Chris@49
|
119 #undef arma_noinline
|
Chris@49
|
120
|
Chris@49
|
121 #define arma_pure __attribute__((__pure__))
|
Chris@49
|
122 #define arma_const __attribute__((__const__))
|
Chris@49
|
123 #define arma_aligned __attribute__((__aligned__))
|
Chris@49
|
124 #define arma_align_mem __attribute__((__aligned__(16)))
|
Chris@49
|
125 #define arma_warn_unused __attribute__((__warn_unused_result__))
|
Chris@49
|
126 #define arma_deprecated __attribute__((__deprecated__))
|
Chris@49
|
127 #define arma_malloc __attribute__((__malloc__))
|
Chris@49
|
128 #define arma_inline inline __attribute__((__always_inline__))
|
Chris@49
|
129 #define arma_noinline __attribute__((__noinline__))
|
Chris@49
|
130
|
Chris@49
|
131 #define ARMA_HAVE_ALIGNED_ATTRIBUTE
|
Chris@49
|
132
|
Chris@49
|
133 #if (ARMA_GCC_VERSION >= 40300)
|
Chris@49
|
134 #undef arma_hot
|
Chris@49
|
135 #undef arma_cold
|
Chris@49
|
136
|
Chris@49
|
137 #define arma_hot __attribute__((__hot__))
|
Chris@49
|
138 #define arma_cold __attribute__((__cold__))
|
Chris@49
|
139 #endif
|
Chris@49
|
140
|
Chris@49
|
141 #if (ARMA_GCC_VERSION >= 40200)
|
Chris@49
|
142 #if defined(_GLIBCXX_USE_C99_MATH_TR1) && defined(_GLIBCXX_USE_C99_COMPLEX_TR1)
|
Chris@49
|
143 #define ARMA_HAVE_STD_TR1
|
Chris@49
|
144 #endif
|
Chris@49
|
145 #endif
|
Chris@49
|
146
|
Chris@49
|
147 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
|
Chris@49
|
148 #undef ARMA_HAVE_STD_TR1
|
Chris@49
|
149
|
Chris@49
|
150 #if !defined(ARMA_USE_CXX11)
|
Chris@49
|
151 #define ARMA_USE_CXX11
|
Chris@49
|
152 #endif
|
Chris@49
|
153 #endif
|
Chris@49
|
154
|
Chris@49
|
155 #if defined(__clang__)
|
Chris@49
|
156 #undef ARMA_HAVE_STD_TR1
|
Chris@49
|
157 //#undef ARMA_GOOD_COMPILER
|
Chris@49
|
158 #endif
|
Chris@49
|
159
|
Chris@49
|
160 #if ( (ARMA_GCC_VERSION >= 40700) && (ARMA_GCC_VERSION <= 40701) )
|
Chris@49
|
161 #error "gcc versions 4.7.0 and 4.7.1 are unsupported; use 4.7.2 or later"
|
Chris@49
|
162 // due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53549
|
Chris@49
|
163 #endif
|
Chris@49
|
164
|
Chris@49
|
165 #if (ARMA_GCC_VERSION >= 40700)
|
Chris@49
|
166 #define ARMA_HAVE_GCC_ASSUME_ALIGNED
|
Chris@49
|
167 // TODO: future versions of clang may also have __builtin_assume_aligned
|
Chris@49
|
168 #endif
|
Chris@49
|
169
|
Chris@49
|
170 #undef ARMA_GCC_VERSION
|
Chris@49
|
171
|
Chris@49
|
172 #endif
|
Chris@49
|
173
|
Chris@49
|
174
|
Chris@49
|
175 #if defined(__APPLE__)
|
Chris@49
|
176 #define ARMA_BLAS_SDOT_BUG
|
Chris@49
|
177 #endif
|
Chris@49
|
178
|
Chris@49
|
179
|
Chris@49
|
180 #if defined(_MSC_VER)
|
Chris@49
|
181
|
Chris@49
|
182 #if (_MSC_VER < 1500)
|
Chris@49
|
183 #error "*** Need a newer compiler ***"
|
Chris@49
|
184 #endif
|
Chris@49
|
185
|
Chris@49
|
186 #undef ARMA_GOOD_COMPILER
|
Chris@49
|
187 #undef ARMA_HAVE_STD_ISFINITE
|
Chris@49
|
188 #undef ARMA_HAVE_STD_SNPRINTF
|
Chris@49
|
189 #undef ARMA_HAVE_LOG1P
|
Chris@49
|
190 #undef ARMA_HAVE_STD_ISINF
|
Chris@49
|
191 #undef ARMA_HAVE_STD_ISNAN
|
Chris@49
|
192 #undef ARMA_HAVE_STD_TR1
|
Chris@49
|
193
|
Chris@49
|
194 // #undef arma_inline
|
Chris@49
|
195 // #define arma_inline inline __forceinline
|
Chris@49
|
196
|
Chris@49
|
197 #pragma warning(push)
|
Chris@49
|
198
|
Chris@49
|
199 #pragma warning(disable: 4127) // conditional expression is constant
|
Chris@49
|
200 #pragma warning(disable: 4510) // default constructor could not be generated
|
Chris@49
|
201 #pragma warning(disable: 4511) // copy constructor can't be generated
|
Chris@49
|
202 #pragma warning(disable: 4512) // assignment operator can't be generated
|
Chris@49
|
203 #pragma warning(disable: 4513) // destructor can't be generated
|
Chris@49
|
204 #pragma warning(disable: 4514) // unreferenced inline function has been removed
|
Chris@49
|
205 #pragma warning(disable: 4522) // multiple assignment operators specified
|
Chris@49
|
206 #pragma warning(disable: 4623) // default constructor can't be generated
|
Chris@49
|
207 #pragma warning(disable: 4624) // destructor can't be generated
|
Chris@49
|
208 #pragma warning(disable: 4625) // copy constructor can't be generated
|
Chris@49
|
209 #pragma warning(disable: 4626) // assignment operator can't be generated
|
Chris@49
|
210 #pragma warning(disable: 4710) // function not inlined
|
Chris@49
|
211 #pragma warning(disable: 4711) // call was inlined
|
Chris@49
|
212 #pragma warning(disable: 4714) // __forceinline can't be inlined
|
Chris@49
|
213
|
Chris@49
|
214 #if (_MANAGED == 1) || (_M_CEE == 1)
|
Chris@49
|
215
|
Chris@49
|
216 // don't do any alignment when compiling in "managed code" mode
|
Chris@49
|
217
|
Chris@49
|
218 #else
|
Chris@49
|
219 // #undef arma_aligned
|
Chris@49
|
220 // #define arma_aligned __declspec(align(16))
|
Chris@49
|
221
|
Chris@49
|
222 #undef arma_align_mem
|
Chris@49
|
223 #define arma_align_mem __declspec(align(16))
|
Chris@49
|
224
|
Chris@49
|
225 #define ARMA_HAVE_ALIGNED_ATTRIBUTE
|
Chris@49
|
226
|
Chris@49
|
227 // disable warnings: "structure was padded due to __declspec(align(16))"
|
Chris@49
|
228 #pragma warning(disable: 4324)
|
Chris@49
|
229
|
Chris@49
|
230 #endif
|
Chris@49
|
231
|
Chris@49
|
232 #endif
|
Chris@49
|
233
|
Chris@49
|
234
|
Chris@49
|
235 #if defined(__CUDACC__)
|
Chris@49
|
236 #undef ARMA_HAVE_STD_ISFINITE
|
Chris@49
|
237 #undef ARMA_HAVE_STD_SNPRINTF
|
Chris@49
|
238 #undef ARMA_HAVE_LOG1P
|
Chris@49
|
239 #undef ARMA_HAVE_STD_ISINF
|
Chris@49
|
240 #undef ARMA_HAVE_STD_ISNAN
|
Chris@49
|
241 #undef ARMA_HAVE_STD_TR1
|
Chris@49
|
242 #endif
|
Chris@49
|
243
|
Chris@49
|
244
|
Chris@49
|
245 #if defined(__SUNPRO_CC)
|
Chris@49
|
246 #undef ARMA_HAVE_STD_ISFINITE
|
Chris@49
|
247 #undef ARMA_HAVE_STD_SNPRINTF
|
Chris@49
|
248 #undef ARMA_HAVE_LOG1P
|
Chris@49
|
249 #undef ARMA_HAVE_STD_ISINF
|
Chris@49
|
250 #undef ARMA_HAVE_STD_ISNAN
|
Chris@49
|
251 #undef ARMA_HAVE_STD_TR1
|
Chris@49
|
252 #endif
|