1 |
commit: 0bf9d7c0c2541c7f8e607655a7c6035248b5d32d |
2 |
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Sep 29 09:20:41 2012 +0000 |
4 |
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com> |
5 |
CommitDate: Sat Sep 29 09:20:41 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=0bf9d7c0 |
7 |
|
8 |
Change BTL actions begins: BLAS levels 1 and 2 are done. Old |
9 |
implementations cleaned up. |
10 |
|
11 |
--- |
12 |
.../NI_internal/FortranDeclarations.hpp | 3 + |
13 |
NumericInterface/NI_internal/FortranInterface.hpp | 19 +- |
14 |
btl/actions/action_MatrixTVector.hpp | 79 +++ |
15 |
btl/actions/action_MatrixVector.hpp | 79 +++ |
16 |
btl/actions/action_Rank1Update.hpp | 77 +++ |
17 |
btl/actions/action_Rank2Update.hpp | 77 +++ |
18 |
btl/actions/action_SymMatrixVector.hpp | 78 +++ |
19 |
btl/actions/action_TriSolveVector.hpp | 81 +++ |
20 |
btl/actions/action_aat_product.hh | 145 ----- |
21 |
btl/actions/action_ata_product.hh | 145 ----- |
22 |
btl/actions/action_atv_product.hh | 134 ---- |
23 |
btl/actions/action_axpby.hh | 127 ---- |
24 |
btl/actions/action_axpy.hh | 139 ---- |
25 |
btl/actions/action_axpy.hpp | 77 +++ |
26 |
btl/actions/action_cholesky.hh | 129 ---- |
27 |
btl/actions/action_general_solve.hh | 137 ---- |
28 |
btl/actions/action_ger.hh | 128 ---- |
29 |
btl/actions/action_hessenberg.hh | 233 ------- |
30 |
btl/actions/action_least_squares.hh | 137 ---- |
31 |
btl/actions/action_lu_decomp.hh | 109 ---- |
32 |
btl/actions/action_lu_solve.hh | 136 ---- |
33 |
btl/actions/action_matrix_matrix_product.hh | 150 ----- |
34 |
btl/actions/action_matrix_matrix_product_bis.hh | 152 ----- |
35 |
btl/actions/action_matrix_vector_product.hh | 153 ----- |
36 |
btl/actions/action_parallel_axpy.hh | 158 ----- |
37 |
btl/actions/action_parallel_cholesky.hh | 130 ---- |
38 |
btl/actions/action_parallel_lu_decomp.hh | 142 ---- |
39 |
.../action_parallel_matrix_vector_product.hh | 159 ----- |
40 |
btl/actions/action_parallel_qr_decomp.hh | 116 ---- |
41 |
btl/actions/action_parallel_svd_decomp.hh | 151 ----- |
42 |
btl/actions/action_parallel_symm_ev.hh | 138 ---- |
43 |
btl/actions/action_partial_lu.hh | 125 ---- |
44 |
btl/actions/action_qr_decomp.hh | 112 ---- |
45 |
btl/actions/action_rot.hh | 116 ---- |
46 |
btl/actions/action_rot.hpp | 78 +++ |
47 |
btl/actions/action_stev.hh | 119 ---- |
48 |
btl/actions/action_svd_decomp.hh | 115 ---- |
49 |
btl/actions/action_syev.hh | 113 ---- |
50 |
btl/actions/action_symm_ev.hh | 104 --- |
51 |
btl/actions/action_symv.hh | 139 ---- |
52 |
btl/actions/action_syr2.hh | 133 ---- |
53 |
btl/actions/action_trisolve.hh | 137 ---- |
54 |
btl/actions/action_trisolve_matrix.hh | 165 ----- |
55 |
btl/actions/action_trmm.hh | 165 ----- |
56 |
btl/actions/actionsBLAS.hpp | 16 + |
57 |
btl/actions/base_action_fftw.hh | 86 --- |
58 |
btl/actions/basic_actions.hh | 21 - |
59 |
btl/generic_bench/init/init_function.hh | 54 -- |
60 |
btl/generic_bench/init/init_matrix.hh | 93 --- |
61 |
btl/generic_bench/init/init_vector.hh | 37 -- |
62 |
btl/generic_bench/static/intel_bench_fixed_size.hh | 6 +- |
63 |
btl/generic_bench/timers/STL_perf_analyzer.hh | 82 --- |
64 |
btl/generic_bench/timers/STL_timer.hh | 78 --- |
65 |
.../timers/distributed_perf_analyzer_node.hh | 1 - |
66 |
.../timers/distributed_perf_analyzer_root.hh | 5 +- |
67 |
btl/generic_bench/timers/mixed_perf_analyzer.hh | 73 --- |
68 |
btl/generic_bench/timers/portable_perf_analyzer.hh | 9 +- |
69 |
.../timers/portable_perf_analyzer_old.hh | 134 ---- |
70 |
btl/generic_bench/timers/x86_perf_analyzer.hh | 108 --- |
71 |
btl/generic_bench/timers/x86_timer.hh | 246 ------- |
72 |
btl/generic_bench/utils/LinearCongruential.hh | 83 --- |
73 |
btl/generic_bench/utils/LinearCongruential.hpp | 77 +++ |
74 |
btl/libs/BLAS/CMakeLists.txt | 60 -- |
75 |
btl/libs/BLAS/blas.h | 681 -------------------- |
76 |
btl/libs/BLAS/blas_interface.hh | 77 --- |
77 |
btl/libs/BLAS/blas_interface_impl.hh | 96 --- |
78 |
btl/libs/BLAS/c_interface_base.h | 89 --- |
79 |
btl/libs/BLAS/cblas_interface_impl.hh | 96 --- |
80 |
btl/libs/BLAS/main.cpp | 99 +--- |
81 |
btl/libs/STL/CMakeLists.txt | 2 - |
82 |
btl/libs/STL/STL_interface.hh | 255 -------- |
83 |
btl/libs/STL/main.cpp | 42 -- |
84 |
numbench/modules/internal/blasBase.py | 9 +- |
85 |
numbench/testdescr.py | 22 +- |
86 |
74 files changed, 774 insertions(+), 7302 deletions(-) |
87 |
|
88 |
diff --git a/NumericInterface/NI_internal/FortranDeclarations.hpp b/NumericInterface/NI_internal/FortranDeclarations.hpp |
89 |
index 9fe0b04..76dfc01 100644 |
90 |
--- a/NumericInterface/NI_internal/FortranDeclarations.hpp |
91 |
+++ b/NumericInterface/NI_internal/FortranDeclarations.hpp |
92 |
@@ -51,6 +51,9 @@ extern "C" { |
93 |
void ssymv_(const char*, const int*, const float*, const float*, const int*, const float*, const int*, const float*, float*, const int*); |
94 |
void dsymv_(const char*, const int*, const double*, const double*, const int*, const double*, const int*, const double*, double*, const int*); |
95 |
|
96 |
+ void strmv_(const char*, const char*, const char*, const int*, const float*, const int*, float*, const int*); |
97 |
+ void dtrmv_(const char*, const char*, const char*, const int*, const double*, const int*, double*, const int*); |
98 |
+ |
99 |
void strsv_(const char*, const char*, const char*, const int*, const float*, const int*, float*, const int*); |
100 |
void dtrsv_(const char*, const char*, const char*, const int*, const double*, const int*, double*, const int*); |
101 |
|
102 |
|
103 |
diff --git a/NumericInterface/NI_internal/FortranInterface.hpp b/NumericInterface/NI_internal/FortranInterface.hpp |
104 |
index 39dfa84..ab20783 100644 |
105 |
--- a/NumericInterface/NI_internal/FortranInterface.hpp |
106 |
+++ b/NumericInterface/NI_internal/FortranInterface.hpp |
107 |
@@ -81,7 +81,7 @@ public: |
108 |
* LEVEL 2 BLAS * |
109 |
****************/ |
110 |
|
111 |
- static void matrixVector(const bool& trans, const int& M, const int& N, |
112 |
+ static void MatrixVector(const bool& trans, const int& M, const int& N, |
113 |
const Scalar& alpha, const Scalar* A, const Scalar* x, |
114 |
const Scalar& beta, Scalar* y) |
115 |
{ |
116 |
@@ -90,26 +90,32 @@ public: |
117 |
FORTFUNC(gemv)(&tA, &M, &N, &alpha, A, &LDA, x, &ONE, &beta, y, &ONE); |
118 |
} |
119 |
|
120 |
- static void symmetricMatrixVector(const char& uplo, const int& N, |
121 |
+ static void SymMatrixVector(const char& uplo, const int& N, |
122 |
const Scalar& alpha, const Scalar* A, const Scalar* x, |
123 |
const Scalar& beta, Scalar* y) |
124 |
{ |
125 |
FORTFUNC(symv)(&uplo, &N, &alpha, A, &N, x, &ONE, &beta, y, &ONE); |
126 |
} |
127 |
|
128 |
- static void triangularSolveVector(const char& uplo, const char& diag, |
129 |
+ static void TriMatrixVector(const char& uplo, const int& N, |
130 |
+ const Scalar* A, Scalar* x) |
131 |
+ { |
132 |
+ FORTFUNC(trmv)(&uplo, "N", "N", &N, A, &N, x, &ONE); |
133 |
+ } |
134 |
+ |
135 |
+ static void TriSolveVector(const char& uplo, |
136 |
const int& N, const Scalar* A, Scalar* x) |
137 |
{ |
138 |
- FORTFUNC(trsv)(&uplo, "N", &diag, &N, A, &N, x, &ONE); |
139 |
+ FORTFUNC(trsv)(&uplo, "N", "N", &N, A, &N, x, &ONE); |
140 |
} |
141 |
|
142 |
- static void rank1update(const int& M, const int& N, const Scalar& alpha, |
143 |
+ static void Rank1Update(const int& M, const int& N, const Scalar& alpha, |
144 |
const Scalar* x, const Scalar* y, Scalar* A) |
145 |
{ |
146 |
FORTFUNC(ger)(&M, &N, &alpha, x, &ONE, y, &ONE, A, &M); |
147 |
} |
148 |
|
149 |
- static void rank2update(const char& uplo, const int& N, const Scalar& alpha, |
150 |
+ static void Rank2Update(const char& uplo, const int& N, const Scalar& alpha, |
151 |
const Scalar* x, const Scalar* y, Scalar* A) |
152 |
{ |
153 |
FORTFUNC(syr2)(&uplo, &N, &alpha, x, &ONE, y, &ONE, A, &N); |
154 |
@@ -138,7 +144,6 @@ public: |
155 |
tB = Trans; |
156 |
} |
157 |
|
158 |
- const int LDB = transB ? N : K; |
159 |
FORTFUNC(gemm)(&tA, &tB, &M, &N, &K, &alpha, A, &LDA, B, &LDB, |
160 |
&beta, C, &M); |
161 |
} |
162 |
|
163 |
diff --git a/btl/actions/action_MatrixTVector.hpp b/btl/actions/action_MatrixTVector.hpp |
164 |
new file mode 100644 |
165 |
index 0000000..20b360a |
166 |
--- /dev/null |
167 |
+++ b/btl/actions/action_MatrixTVector.hpp |
168 |
@@ -0,0 +1,79 @@ |
169 |
+//===================================================== |
170 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
171 |
+//===================================================== |
172 |
+// |
173 |
+// This program is free software; you can redistribute it and/or |
174 |
+// modify it under the terms of the GNU General Public License |
175 |
+// as published by the Free Software Foundation; either version 2 |
176 |
+// of the License, or (at your option) any later version. |
177 |
+// |
178 |
+// This program is distributed in the hope that it will be useful, |
179 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
180 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
181 |
+// GNU General Public License for more details. |
182 |
+// You should have received a copy of the GNU General Public License |
183 |
+// along with this program; if not, write to the Free Software |
184 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
185 |
+// |
186 |
+#ifndef ACTION_MATRIXTVECTOR |
187 |
+#define ACTION_MATRIXTVECTOR |
188 |
+ |
189 |
+#include "LinearCongruential.hpp" |
190 |
+#include <vector> |
191 |
+#include <algorithm> |
192 |
+ |
193 |
+template<class Interface> |
194 |
+class Action_MatrixTVector { |
195 |
+ |
196 |
+ typedef typename Interface::Scalar Scalar; |
197 |
+ typedef std::vector<Scalar> vector_t; |
198 |
+ |
199 |
+private: |
200 |
+ // Invalidate copy constructor |
201 |
+ Action_MatrixTVector(const Action_MatrixTVector&); |
202 |
+ |
203 |
+public: |
204 |
+ |
205 |
+ // Constructor |
206 |
+ Action_MatrixTVector(int size) |
207 |
+ : _size(size), lc(10), |
208 |
+ A(lc.fillVector<Scalar>(size*size)), x(lc.fillVector<Scalar>(size)), |
209 |
+ A_work(size*size), x_work(size), y_work(size) |
210 |
+ { |
211 |
+ MESSAGE("Action_MatrixTVector Constructor"); |
212 |
+ } |
213 |
+ |
214 |
+ // Action name |
215 |
+ static std::string name() |
216 |
+ { |
217 |
+ return "MatrixTVector_" + Interface::name(); |
218 |
+ } |
219 |
+ |
220 |
+ double fpo() { |
221 |
+ return 2*double(_size)*double(_size) - double(_size); |
222 |
+ } |
223 |
+ |
224 |
+ inline void initialize(){ |
225 |
+ std::copy(A.begin(), A.end(), A_work.begin()); |
226 |
+ std::copy(x.begin(), x.end(), x_work.begin()); |
227 |
+ } |
228 |
+ |
229 |
+ inline void calculate() { |
230 |
+ Interface::MatrixVector(true, _size, _size, 1., &A_work[0], &x_work[0], |
231 |
+ 0., &y_work[0]); |
232 |
+ } |
233 |
+ |
234 |
+ Scalar getResidual() { |
235 |
+ return 0.; |
236 |
+ } |
237 |
+ |
238 |
+private: |
239 |
+ const int _size; |
240 |
+ LinearCongruential<> lc; |
241 |
+ |
242 |
+ const vector_t A, x; |
243 |
+ vector_t A_work, x_work, y_work; |
244 |
+ |
245 |
+}; |
246 |
+ |
247 |
+#endif // ACTION_MATRIXVECTOR |
248 |
|
249 |
diff --git a/btl/actions/action_MatrixVector.hpp b/btl/actions/action_MatrixVector.hpp |
250 |
new file mode 100644 |
251 |
index 0000000..923dc7b |
252 |
--- /dev/null |
253 |
+++ b/btl/actions/action_MatrixVector.hpp |
254 |
@@ -0,0 +1,79 @@ |
255 |
+//===================================================== |
256 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
257 |
+//===================================================== |
258 |
+// |
259 |
+// This program is free software; you can redistribute it and/or |
260 |
+// modify it under the terms of the GNU General Public License |
261 |
+// as published by the Free Software Foundation; either version 2 |
262 |
+// of the License, or (at your option) any later version. |
263 |
+// |
264 |
+// This program is distributed in the hope that it will be useful, |
265 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
266 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
267 |
+// GNU General Public License for more details. |
268 |
+// You should have received a copy of the GNU General Public License |
269 |
+// along with this program; if not, write to the Free Software |
270 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
271 |
+// |
272 |
+#ifndef ACTION_MATRIXVECTOR |
273 |
+#define ACTION_MATRIXVECTOR |
274 |
+ |
275 |
+#include "LinearCongruential.hpp" |
276 |
+#include <vector> |
277 |
+#include <algorithm> |
278 |
+ |
279 |
+template<class Interface> |
280 |
+class Action_MatrixVector { |
281 |
+ |
282 |
+ typedef typename Interface::Scalar Scalar; |
283 |
+ typedef std::vector<Scalar> vector_t; |
284 |
+ |
285 |
+private: |
286 |
+ // Invalidate copy constructor |
287 |
+ Action_MatrixVector(const Action_MatrixVector&); |
288 |
+ |
289 |
+public: |
290 |
+ |
291 |
+ // Constructor |
292 |
+ Action_MatrixVector(int size) |
293 |
+ : _size(size), lc(10), |
294 |
+ A(lc.fillVector<Scalar>(size*size)), x(lc.fillVector<Scalar>(size)), |
295 |
+ A_work(size*size), x_work(size), y_work(size) |
296 |
+ { |
297 |
+ MESSAGE("Action_MatrixVector Constructor"); |
298 |
+ } |
299 |
+ |
300 |
+ // Action name |
301 |
+ static std::string name() |
302 |
+ { |
303 |
+ return "MatrixVector_" + Interface::name(); |
304 |
+ } |
305 |
+ |
306 |
+ double fpo() { |
307 |
+ return 2*double(_size)*double(_size) - double(_size); |
308 |
+ } |
309 |
+ |
310 |
+ inline void initialize(){ |
311 |
+ std::copy(A.begin(), A.end(), A_work.begin()); |
312 |
+ std::copy(x.begin(), x.end(), x_work.begin()); |
313 |
+ } |
314 |
+ |
315 |
+ inline void calculate() { |
316 |
+ Interface::MatrixVector(false, _size, _size, 1., &A_work[0], &x_work[0], |
317 |
+ 0., &y_work[0]); |
318 |
+ } |
319 |
+ |
320 |
+ Scalar getResidual() { |
321 |
+ return 0.; |
322 |
+ } |
323 |
+ |
324 |
+private: |
325 |
+ const int _size; |
326 |
+ LinearCongruential<> lc; |
327 |
+ |
328 |
+ const vector_t A, x; |
329 |
+ vector_t A_work, x_work, y_work; |
330 |
+ |
331 |
+}; |
332 |
+ |
333 |
+#endif // ACTION_MATRIXVECTOR |
334 |
|
335 |
diff --git a/btl/actions/action_Rank1Update.hpp b/btl/actions/action_Rank1Update.hpp |
336 |
new file mode 100644 |
337 |
index 0000000..bd88ac3 |
338 |
--- /dev/null |
339 |
+++ b/btl/actions/action_Rank1Update.hpp |
340 |
@@ -0,0 +1,77 @@ |
341 |
+//===================================================== |
342 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
343 |
+//===================================================== |
344 |
+// |
345 |
+// This program is free software; you can redistribute it and/or |
346 |
+// modify it under the terms of the GNU General Public License |
347 |
+// as published by the Free Software Foundation; either version 2 |
348 |
+// of the License, or (at your option) any later version. |
349 |
+// |
350 |
+// This program is distributed in the hope that it will be useful, |
351 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
352 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
353 |
+// GNU General Public License for more details. |
354 |
+// You should have received a copy of the GNU General Public License |
355 |
+// along with this program; if not, write to the Free Software |
356 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
357 |
+// |
358 |
+#ifndef ACTION_RANK1UPDATE |
359 |
+#define ACTION_RANK1UPDATE |
360 |
+ |
361 |
+#include "LinearCongruential.hpp" |
362 |
+#include <vector> |
363 |
+#include <algorithm> |
364 |
+ |
365 |
+template<class Interface> |
366 |
+class Action_Rank1Update { |
367 |
+ |
368 |
+ typedef typename Interface::Scalar Scalar; |
369 |
+ typedef std::vector<Scalar> vector_t; |
370 |
+ |
371 |
+private: |
372 |
+ // Invalidate copy constructor |
373 |
+ Action_Rank1Update(const Action_Rank1Update&); |
374 |
+ |
375 |
+public: |
376 |
+ |
377 |
+ // Constructor |
378 |
+ Action_Rank1Update(int size) |
379 |
+ : _size(size), lc(10), |
380 |
+ A(lc.fillVector<Scalar>(size*size)), A_work(size*size), |
381 |
+ x(lc.fillVector<Scalar>(size)), y(lc.fillVector<Scalar>(size)) |
382 |
+ { |
383 |
+ MESSAGE("Action_Rank1Update Constructor"); |
384 |
+ } |
385 |
+ |
386 |
+ // Action name |
387 |
+ static std::string name() |
388 |
+ { |
389 |
+ return "Rank1Update_" + Interface::name(); |
390 |
+ } |
391 |
+ |
392 |
+ double fpo() { |
393 |
+ return 3*double(_size)*double(_size); |
394 |
+ } |
395 |
+ |
396 |
+ inline void initialize(){ |
397 |
+ std::copy(A.begin(), A.end(), A_work.begin()); |
398 |
+ } |
399 |
+ |
400 |
+ inline void calculate() { |
401 |
+ Interface::Rank1Update(_size, _size, 1., &x[0], &y[0], &A_work[0]); |
402 |
+ } |
403 |
+ |
404 |
+ Scalar getResidual() { |
405 |
+ return 0.; |
406 |
+ } |
407 |
+ |
408 |
+private: |
409 |
+ const int _size; |
410 |
+ LinearCongruential<> lc; |
411 |
+ |
412 |
+ const vector_t A, x, y; |
413 |
+ vector_t A_work; |
414 |
+ |
415 |
+}; |
416 |
+ |
417 |
+#endif // ACTION_RANK1UPDATE |
418 |
|
419 |
diff --git a/btl/actions/action_Rank2Update.hpp b/btl/actions/action_Rank2Update.hpp |
420 |
new file mode 100644 |
421 |
index 0000000..b0b1693 |
422 |
--- /dev/null |
423 |
+++ b/btl/actions/action_Rank2Update.hpp |
424 |
@@ -0,0 +1,77 @@ |
425 |
+//===================================================== |
426 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
427 |
+//===================================================== |
428 |
+// |
429 |
+// This program is free software; you can redistribute it and/or |
430 |
+// modify it under the terms of the GNU General Public License |
431 |
+// as published by the Free Software Foundation; either version 2 |
432 |
+// of the License, or (at your option) any later version. |
433 |
+// |
434 |
+// This program is distributed in the hope that it will be useful, |
435 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
436 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
437 |
+// GNU General Public License for more details. |
438 |
+// You should have received a copy of the GNU General Public License |
439 |
+// along with this program; if not, write to the Free Software |
440 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
441 |
+// |
442 |
+#ifndef ACTION_RANK2UPDATE |
443 |
+#define ACTION_RANK2UPDATE |
444 |
+ |
445 |
+#include "LinearCongruential.hpp" |
446 |
+#include <vector> |
447 |
+#include <algorithm> |
448 |
+ |
449 |
+template<class Interface> |
450 |
+class Action_Rank2Update { |
451 |
+ |
452 |
+ typedef typename Interface::Scalar Scalar; |
453 |
+ typedef std::vector<Scalar> vector_t; |
454 |
+ |
455 |
+private: |
456 |
+ // Invalidate copy constructor |
457 |
+ Action_Rank2Update(const Action_Rank2Update&); |
458 |
+ |
459 |
+public: |
460 |
+ |
461 |
+ // Constructor |
462 |
+ Action_Rank2Update(int size) |
463 |
+ : _size(size), lc(10), |
464 |
+ A(lc.fillVector<Scalar>(size*size)), A_work(size*size), |
465 |
+ x(lc.fillVector<Scalar>(size)), y(lc.fillVector<Scalar>(size)) |
466 |
+ { |
467 |
+ MESSAGE("Action_Rank2Update Constructor"); |
468 |
+ } |
469 |
+ |
470 |
+ // Action name |
471 |
+ static std::string name() |
472 |
+ { |
473 |
+ return "Rank2Update_" + Interface::name(); |
474 |
+ } |
475 |
+ |
476 |
+ double fpo() { |
477 |
+ return 2*double(_size)*double(_size); |
478 |
+ } |
479 |
+ |
480 |
+ inline void initialize(){ |
481 |
+ std::copy(A.begin(), A.end(), A_work.begin()); |
482 |
+ } |
483 |
+ |
484 |
+ inline void calculate() { |
485 |
+ Interface::Rank2Update('U', _size, 1., &x[0], &y[0], &A_work[0]); |
486 |
+ } |
487 |
+ |
488 |
+ Scalar getResidual() { |
489 |
+ return 0.; |
490 |
+ } |
491 |
+ |
492 |
+private: |
493 |
+ const int _size; |
494 |
+ LinearCongruential<> lc; |
495 |
+ |
496 |
+ const vector_t A, x, y; |
497 |
+ vector_t A_work; |
498 |
+ |
499 |
+}; |
500 |
+ |
501 |
+#endif // ACTION_RANK2UPDATE |
502 |
|
503 |
diff --git a/btl/actions/action_SymMatrixVector.hpp b/btl/actions/action_SymMatrixVector.hpp |
504 |
new file mode 100644 |
505 |
index 0000000..e475007 |
506 |
--- /dev/null |
507 |
+++ b/btl/actions/action_SymMatrixVector.hpp |
508 |
@@ -0,0 +1,78 @@ |
509 |
+//===================================================== |
510 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
511 |
+//===================================================== |
512 |
+// |
513 |
+// This program is free software; you can redistribute it and/or |
514 |
+// modify it under the terms of the GNU General Public License |
515 |
+// as published by the Free Software Foundation; either version 2 |
516 |
+// of the License, or (at your option) any later version. |
517 |
+// |
518 |
+// This program is distributed in the hope that it will be useful, |
519 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
520 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
521 |
+// GNU General Public License for more details. |
522 |
+// You should have received a copy of the GNU General Public License |
523 |
+// along with this program; if not, write to the Free Software |
524 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
525 |
+// |
526 |
+#ifndef ACTION_SYMMATRIXVECTOR |
527 |
+#define ACTION_SYMMATRIXVECTOR |
528 |
+ |
529 |
+#include "LinearCongruential.hpp" |
530 |
+#include <vector> |
531 |
+#include <algorithm> |
532 |
+ |
533 |
+template<class Interface> |
534 |
+class Action_SymMatrixVector { |
535 |
+ |
536 |
+ typedef typename Interface::Scalar Scalar; |
537 |
+ typedef std::vector<Scalar> vector_t; |
538 |
+ |
539 |
+private: |
540 |
+ // Invalidate copy constructor |
541 |
+ Action_SymMatrixVector(const Action_SymMatrixVector&); |
542 |
+ |
543 |
+public: |
544 |
+ |
545 |
+ // Constructor |
546 |
+ Action_SymMatrixVector(int size) |
547 |
+ : _size(size), lc(10), |
548 |
+ A(lc.fillVector<Scalar>(size*size)), x(lc.fillVector<Scalar>(size)), |
549 |
+ y(size), y_work(size) |
550 |
+ { |
551 |
+ MESSAGE("Action_SymMatrixVector Constructor"); |
552 |
+ } |
553 |
+ |
554 |
+ // Action name |
555 |
+ static std::string name() |
556 |
+ { |
557 |
+ return "SymMatrixVector_" + Interface::name(); |
558 |
+ } |
559 |
+ |
560 |
+ double fpo() { |
561 |
+ return double(_size)*double(_size); |
562 |
+ } |
563 |
+ |
564 |
+ inline void initialize(){ |
565 |
+ std::copy(y.begin(), y.end(), y_work.begin()); |
566 |
+ } |
567 |
+ |
568 |
+ inline void calculate() { |
569 |
+ Interface::SymMatrixVector('U', _size, 1., &A[0], &x[0], |
570 |
+ 0., &y_work[0]); |
571 |
+ } |
572 |
+ |
573 |
+ Scalar getResidual() { |
574 |
+ return 0.; |
575 |
+ } |
576 |
+ |
577 |
+private: |
578 |
+ const int _size; |
579 |
+ LinearCongruential<> lc; |
580 |
+ |
581 |
+ const vector_t A, x, y; |
582 |
+ vector_t y_work; |
583 |
+ |
584 |
+}; |
585 |
+ |
586 |
+#endif // ACTION_MATRIXVECTOR |
587 |
|
588 |
diff --git a/btl/actions/action_TriSolveVector.hpp b/btl/actions/action_TriSolveVector.hpp |
589 |
new file mode 100644 |
590 |
index 0000000..2bfefb8 |
591 |
--- /dev/null |
592 |
+++ b/btl/actions/action_TriSolveVector.hpp |
593 |
@@ -0,0 +1,81 @@ |
594 |
+//===================================================== |
595 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
596 |
+//===================================================== |
597 |
+// |
598 |
+// This program is free software; you can redistribute it and/or |
599 |
+// modify it under the terms of the GNU General Public License |
600 |
+// as published by the Free Software Foundation; either version 2 |
601 |
+// of the License, or (at your option) any later version. |
602 |
+// |
603 |
+// This program is distributed in the hope that it will be useful, |
604 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
605 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
606 |
+// GNU General Public License for more details. |
607 |
+// You should have received a copy of the GNU General Public License |
608 |
+// along with this program; if not, write to the Free Software |
609 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
610 |
+// |
611 |
+#ifndef ACTION_TRISOLVEVECTOR |
612 |
+#define ACTION_TRISOLVEVECTOR |
613 |
+ |
614 |
+#include "LinearCongruential.hpp" |
615 |
+#include <vector> |
616 |
+#include <algorithm> |
617 |
+ |
618 |
+template<class Interface> |
619 |
+class Action_TriSolveVector { |
620 |
+ |
621 |
+ typedef typename Interface::Scalar Scalar; |
622 |
+ typedef std::vector<Scalar> vector_t; |
623 |
+ |
624 |
+private: |
625 |
+ // Invalidate copy constructor |
626 |
+ Action_TriSolveVector(const Action_TriSolveVector&); |
627 |
+ |
628 |
+public: |
629 |
+ |
630 |
+ // Constructor |
631 |
+ Action_TriSolveVector(int size) |
632 |
+ : _size(size), lc(10), |
633 |
+ A(lc.fillVector<Scalar>(size*size)), x(lc.fillVector<Scalar>(size)), |
634 |
+ x_work(size) |
635 |
+ { |
636 |
+ MESSAGE("Action_TriSolveVector Constructor"); |
637 |
+ } |
638 |
+ |
639 |
+ // Action name |
640 |
+ static std::string name() |
641 |
+ { |
642 |
+ return "TriSolveVector_" + Interface::name(); |
643 |
+ } |
644 |
+ |
645 |
+ double fpo() { |
646 |
+ return double(_size)*double(_size) - 2*double(_size); |
647 |
+ } |
648 |
+ |
649 |
+ inline void initialize(){ |
650 |
+ std::copy(x.begin(), x.end(), x_work.begin()); |
651 |
+ } |
652 |
+ |
653 |
+ inline void calculate() { |
654 |
+ Interface::TriSolveVector('U', _size, &A[0], &x_work[0]); |
655 |
+ } |
656 |
+ |
657 |
+ Scalar getResidual() { |
658 |
+ initialize(); |
659 |
+ calculate(); |
660 |
+ Interface::TriMatrixVector('U', _size, &A[0], &x_work[0]); |
661 |
+ Interface::axpy(_size, -1., &x[0], &x_work[0]); |
662 |
+ return Interface::norm(_size, &x_work[0]); |
663 |
+ } |
664 |
+ |
665 |
+private: |
666 |
+ const int _size; |
667 |
+ LinearCongruential<> lc; |
668 |
+ |
669 |
+ const vector_t A, x; |
670 |
+ vector_t x_work; |
671 |
+ |
672 |
+}; |
673 |
+ |
674 |
+#endif // ACTION_TRISOLVEVECTOR |
675 |
|
676 |
diff --git a/btl/actions/action_aat_product.hh b/btl/actions/action_aat_product.hh |
677 |
deleted file mode 100644 |
678 |
index aa5b35c..0000000 |
679 |
--- a/btl/actions/action_aat_product.hh |
680 |
+++ /dev/null |
681 |
@@ -1,145 +0,0 @@ |
682 |
-//===================================================== |
683 |
-// File : action_aat_product.hh |
684 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
685 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
686 |
-//===================================================== |
687 |
-// |
688 |
-// This program is free software; you can redistribute it and/or |
689 |
-// modify it under the terms of the GNU General Public License |
690 |
-// as published by the Free Software Foundation; either version 2 |
691 |
-// of the License, or (at your option) any later version. |
692 |
-// |
693 |
-// This program is distributed in the hope that it will be useful, |
694 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
695 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
696 |
-// GNU General Public License for more details. |
697 |
-// You should have received a copy of the GNU General Public License |
698 |
-// along with this program; if not, write to the Free Software |
699 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
700 |
-// |
701 |
-#ifndef ACTION_AAT_PRODUCT |
702 |
-#define ACTION_AAT_PRODUCT |
703 |
-#include "utilities.h" |
704 |
-#include "STL_interface.hh" |
705 |
-#include <string> |
706 |
-#include "init/init_function.hh" |
707 |
-#include "init/init_vector.hh" |
708 |
-#include "init/init_matrix.hh" |
709 |
- |
710 |
-using namespace std; |
711 |
- |
712 |
-template<class Interface> |
713 |
-class Action_aat_product { |
714 |
- |
715 |
-public : |
716 |
- |
717 |
- // Ctor |
718 |
- |
719 |
- Action_aat_product( int size ):_size(size) |
720 |
- { |
721 |
- MESSAGE("Action_aat_product Ctor"); |
722 |
- |
723 |
- // STL matrix and vector initialization |
724 |
- |
725 |
- init_matrix<pseudo_random>(A_stl,_size); |
726 |
- init_matrix<null_function>(X_stl,_size); |
727 |
- init_matrix<null_function>(resu_stl,_size); |
728 |
- |
729 |
- // generic matrix and vector initialization |
730 |
- |
731 |
- Interface::matrix_from_stl(A_ref,A_stl); |
732 |
- Interface::matrix_from_stl(X_ref,X_stl); |
733 |
- |
734 |
- Interface::matrix_from_stl(A,A_stl); |
735 |
- Interface::matrix_from_stl(X,X_stl); |
736 |
- |
737 |
- } |
738 |
- |
739 |
- // invalidate copy ctor |
740 |
- |
741 |
- Action_aat_product( const Action_aat_product & ) |
742 |
- { |
743 |
- INFOS("illegal call to Action_aat_product Copy Ctor"); |
744 |
- exit(0); |
745 |
- } |
746 |
- |
747 |
- // Dtor |
748 |
- |
749 |
- ~Action_aat_product( void ){ |
750 |
- |
751 |
- MESSAGE("Action_aat_product Dtor"); |
752 |
- |
753 |
- // deallocation |
754 |
- |
755 |
- Interface::free_matrix(A,_size); |
756 |
- Interface::free_matrix(X,_size); |
757 |
- |
758 |
- Interface::free_matrix(A_ref,_size); |
759 |
- Interface::free_matrix(X_ref,_size); |
760 |
- |
761 |
- } |
762 |
- |
763 |
- // action name |
764 |
- |
765 |
- static inline std::string name( void ) |
766 |
- { |
767 |
- return "aat_"+Interface::name(); |
768 |
- } |
769 |
- |
770 |
- double nb_op_base( void ){ |
771 |
- return double(_size)*double(_size)*double(_size); |
772 |
- } |
773 |
- |
774 |
- inline void initialize( void ){ |
775 |
- |
776 |
- Interface::copy_matrix(A_ref,A,_size); |
777 |
- Interface::copy_matrix(X_ref,X,_size); |
778 |
- |
779 |
- } |
780 |
- |
781 |
- inline void calculate( void ) { |
782 |
- |
783 |
- Interface::aat_product(A,X,_size); |
784 |
- |
785 |
- } |
786 |
- |
787 |
- void check_result( void ){ |
788 |
- if (_size>128) return; |
789 |
- // calculation check |
790 |
- |
791 |
- Interface::matrix_to_stl(X,resu_stl); |
792 |
- |
793 |
- STL_interface<typename Interface::real_type>::aat_product(A_stl,X_stl,_size); |
794 |
- |
795 |
- typename Interface::real_type error= |
796 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
797 |
- |
798 |
- if (error>1.e-6){ |
799 |
- INFOS("WRONG CALCULATION...residual=" << error); |
800 |
- exit(1); |
801 |
- } |
802 |
- |
803 |
- } |
804 |
- |
805 |
-private : |
806 |
- |
807 |
- typename Interface::stl_matrix A_stl; |
808 |
- typename Interface::stl_matrix X_stl; |
809 |
- typename Interface::stl_matrix resu_stl; |
810 |
- |
811 |
- typename Interface::gene_matrix A_ref; |
812 |
- typename Interface::gene_matrix X_ref; |
813 |
- |
814 |
- typename Interface::gene_matrix A; |
815 |
- typename Interface::gene_matrix X; |
816 |
- |
817 |
- |
818 |
- int _size; |
819 |
- |
820 |
-}; |
821 |
- |
822 |
- |
823 |
-#endif |
824 |
- |
825 |
- |
826 |
- |
827 |
|
828 |
diff --git a/btl/actions/action_ata_product.hh b/btl/actions/action_ata_product.hh |
829 |
deleted file mode 100644 |
830 |
index 04364fe..0000000 |
831 |
--- a/btl/actions/action_ata_product.hh |
832 |
+++ /dev/null |
833 |
@@ -1,145 +0,0 @@ |
834 |
-//===================================================== |
835 |
-// File : action_ata_product.hh |
836 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
837 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
838 |
-//===================================================== |
839 |
-// |
840 |
-// This program is free software; you can redistribute it and/or |
841 |
-// modify it under the terms of the GNU General Public License |
842 |
-// as published by the Free Software Foundation; either version 2 |
843 |
-// of the License, or (at your option) any later version. |
844 |
-// |
845 |
-// This program is distributed in the hope that it will be useful, |
846 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
847 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
848 |
-// GNU General Public License for more details. |
849 |
-// You should have received a copy of the GNU General Public License |
850 |
-// along with this program; if not, write to the Free Software |
851 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
852 |
-// |
853 |
-#ifndef ACTION_ATA_PRODUCT |
854 |
-#define ACTION_ATA_PRODUCT |
855 |
-#include "utilities.h" |
856 |
-#include "STL_interface.hh" |
857 |
-#include <string> |
858 |
-#include "init/init_function.hh" |
859 |
-#include "init/init_vector.hh" |
860 |
-#include "init/init_matrix.hh" |
861 |
- |
862 |
-using namespace std; |
863 |
- |
864 |
-template<class Interface> |
865 |
-class Action_ata_product { |
866 |
- |
867 |
-public : |
868 |
- |
869 |
- // Ctor |
870 |
- |
871 |
- Action_ata_product( int size ):_size(size) |
872 |
- { |
873 |
- MESSAGE("Action_ata_product Ctor"); |
874 |
- |
875 |
- // STL matrix and vector initialization |
876 |
- |
877 |
- init_matrix<pseudo_random>(A_stl,_size); |
878 |
- init_matrix<null_function>(X_stl,_size); |
879 |
- init_matrix<null_function>(resu_stl,_size); |
880 |
- |
881 |
- // generic matrix and vector initialization |
882 |
- |
883 |
- Interface::matrix_from_stl(A_ref,A_stl); |
884 |
- Interface::matrix_from_stl(X_ref,X_stl); |
885 |
- |
886 |
- Interface::matrix_from_stl(A,A_stl); |
887 |
- Interface::matrix_from_stl(X,X_stl); |
888 |
- |
889 |
- } |
890 |
- |
891 |
- // invalidate copy ctor |
892 |
- |
893 |
- Action_ata_product( const Action_ata_product & ) |
894 |
- { |
895 |
- INFOS("illegal call to Action_ata_product Copy Ctor"); |
896 |
- exit(0); |
897 |
- } |
898 |
- |
899 |
- // Dtor |
900 |
- |
901 |
- ~Action_ata_product( void ){ |
902 |
- |
903 |
- MESSAGE("Action_ata_product Dtor"); |
904 |
- |
905 |
- // deallocation |
906 |
- |
907 |
- Interface::free_matrix(A,_size); |
908 |
- Interface::free_matrix(X,_size); |
909 |
- |
910 |
- Interface::free_matrix(A_ref,_size); |
911 |
- Interface::free_matrix(X_ref,_size); |
912 |
- |
913 |
- } |
914 |
- |
915 |
- // action name |
916 |
- |
917 |
- static inline std::string name( void ) |
918 |
- { |
919 |
- return "ata_"+Interface::name(); |
920 |
- } |
921 |
- |
922 |
- double nb_op_base( void ){ |
923 |
- return 2.0*_size*_size*_size; |
924 |
- } |
925 |
- |
926 |
- inline void initialize( void ){ |
927 |
- |
928 |
- Interface::copy_matrix(A_ref,A,_size); |
929 |
- Interface::copy_matrix(X_ref,X,_size); |
930 |
- |
931 |
- } |
932 |
- |
933 |
- inline void calculate( void ) { |
934 |
- |
935 |
- Interface::ata_product(A,X,_size); |
936 |
- |
937 |
- } |
938 |
- |
939 |
- void check_result( void ){ |
940 |
- if (_size>128) return; |
941 |
- // calculation check |
942 |
- |
943 |
- Interface::matrix_to_stl(X,resu_stl); |
944 |
- |
945 |
- STL_interface<typename Interface::real_type>::ata_product(A_stl,X_stl,_size); |
946 |
- |
947 |
- typename Interface::real_type error= |
948 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
949 |
- |
950 |
- if (error>1.e-6){ |
951 |
- INFOS("WRONG CALCULATION...residual=" << error); |
952 |
- exit(1); |
953 |
- } |
954 |
- |
955 |
- } |
956 |
- |
957 |
-private : |
958 |
- |
959 |
- typename Interface::stl_matrix A_stl; |
960 |
- typename Interface::stl_matrix X_stl; |
961 |
- typename Interface::stl_matrix resu_stl; |
962 |
- |
963 |
- typename Interface::gene_matrix A_ref; |
964 |
- typename Interface::gene_matrix X_ref; |
965 |
- |
966 |
- typename Interface::gene_matrix A; |
967 |
- typename Interface::gene_matrix X; |
968 |
- |
969 |
- |
970 |
- int _size; |
971 |
- |
972 |
-}; |
973 |
- |
974 |
- |
975 |
-#endif |
976 |
- |
977 |
- |
978 |
- |
979 |
|
980 |
diff --git a/btl/actions/action_atv_product.hh b/btl/actions/action_atv_product.hh |
981 |
deleted file mode 100644 |
982 |
index a823451..0000000 |
983 |
--- a/btl/actions/action_atv_product.hh |
984 |
+++ /dev/null |
985 |
@@ -1,134 +0,0 @@ |
986 |
-//===================================================== |
987 |
-// File : action_atv_product.hh |
988 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
989 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
990 |
-//===================================================== |
991 |
-// |
992 |
-// This program is free software; you can redistribute it and/or |
993 |
-// modify it under the terms of the GNU General Public License |
994 |
-// as published by the Free Software Foundation; either version 2 |
995 |
-// of the License, or (at your option) any later version. |
996 |
-// |
997 |
-// This program is distributed in the hope that it will be useful, |
998 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
999 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1000 |
-// GNU General Public License for more details. |
1001 |
-// You should have received a copy of the GNU General Public License |
1002 |
-// along with this program; if not, write to the Free Software |
1003 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1004 |
-// |
1005 |
-#ifndef ACTION_ATV_PRODUCT |
1006 |
-#define ACTION_ATV_PRODUCT |
1007 |
-#include "utilities.h" |
1008 |
-#include "STL_interface.hh" |
1009 |
-#include <string> |
1010 |
-#include "init/init_function.hh" |
1011 |
-#include "init/init_vector.hh" |
1012 |
-#include "init/init_matrix.hh" |
1013 |
- |
1014 |
-using namespace std; |
1015 |
- |
1016 |
-template<class Interface> |
1017 |
-class Action_atv_product { |
1018 |
- |
1019 |
-public : |
1020 |
- |
1021 |
- Action_atv_product( int size ) : _size(size) |
1022 |
- { |
1023 |
- MESSAGE("Action_atv_product Ctor"); |
1024 |
- |
1025 |
- // STL matrix and vector initialization |
1026 |
- |
1027 |
- init_matrix<pseudo_random>(A_stl,_size); |
1028 |
- init_vector<pseudo_random>(B_stl,_size); |
1029 |
- init_vector<null_function>(X_stl,_size); |
1030 |
- init_vector<null_function>(resu_stl,_size); |
1031 |
- |
1032 |
- // generic matrix and vector initialization |
1033 |
- |
1034 |
- Interface::matrix_from_stl(A_ref,A_stl); |
1035 |
- Interface::vector_from_stl(B_ref,B_stl); |
1036 |
- Interface::vector_from_stl(X_ref,X_stl); |
1037 |
- |
1038 |
- Interface::matrix_from_stl(A,A_stl); |
1039 |
- Interface::vector_from_stl(B,B_stl); |
1040 |
- Interface::vector_from_stl(X,X_stl); |
1041 |
- } |
1042 |
- |
1043 |
- // invalidate copy ctor |
1044 |
- Action_atv_product( const Action_atv_product & ) |
1045 |
- { |
1046 |
- INFOS("illegal call to Action_atv_product Copy Ctor"); |
1047 |
- exit(1); |
1048 |
- } |
1049 |
- |
1050 |
- ~Action_atv_product( void ) |
1051 |
- { |
1052 |
- MESSAGE("Action_atv_product Dtor"); |
1053 |
- |
1054 |
- Interface::free_matrix(A,_size); |
1055 |
- Interface::free_vector(B); |
1056 |
- Interface::free_vector(X); |
1057 |
- |
1058 |
- Interface::free_matrix(A_ref,_size); |
1059 |
- Interface::free_vector(B_ref); |
1060 |
- Interface::free_vector(X_ref); |
1061 |
- } |
1062 |
- |
1063 |
- static inline std::string name() { return "atv_" + Interface::name(); } |
1064 |
- |
1065 |
- double nb_op_base( void ) { return 2.0*_size*_size; } |
1066 |
- |
1067 |
- inline void initialize( void ){ |
1068 |
- Interface::copy_matrix(A_ref,A,_size); |
1069 |
- Interface::copy_vector(B_ref,B,_size); |
1070 |
- Interface::copy_vector(X_ref,X,_size); |
1071 |
- } |
1072 |
- |
1073 |
- BTL_DONT_INLINE void calculate( void ) { |
1074 |
- BTL_ASM_COMMENT("begin atv"); |
1075 |
- Interface::atv_product(A,B,X,_size); |
1076 |
- BTL_ASM_COMMENT("end atv"); |
1077 |
- } |
1078 |
- |
1079 |
- void check_result( void ) |
1080 |
- { |
1081 |
- if (_size>128) return; |
1082 |
- Interface::vector_to_stl(X,resu_stl); |
1083 |
- |
1084 |
- STL_interface<typename Interface::real_type>::atv_product(A_stl,B_stl,X_stl,_size); |
1085 |
- |
1086 |
- typename Interface::real_type error= |
1087 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
1088 |
- |
1089 |
- if (error>1.e-6){ |
1090 |
- INFOS("WRONG CALCULATION...residual=" << error); |
1091 |
- exit(1); |
1092 |
- } |
1093 |
- } |
1094 |
- |
1095 |
-private : |
1096 |
- |
1097 |
- typename Interface::stl_matrix A_stl; |
1098 |
- typename Interface::stl_vector B_stl; |
1099 |
- typename Interface::stl_vector X_stl; |
1100 |
- typename Interface::stl_vector resu_stl; |
1101 |
- |
1102 |
- typename Interface::gene_matrix A_ref; |
1103 |
- typename Interface::gene_vector B_ref; |
1104 |
- typename Interface::gene_vector X_ref; |
1105 |
- |
1106 |
- typename Interface::gene_matrix A; |
1107 |
- typename Interface::gene_vector B; |
1108 |
- typename Interface::gene_vector X; |
1109 |
- |
1110 |
- |
1111 |
- int _size; |
1112 |
- |
1113 |
-}; |
1114 |
- |
1115 |
- |
1116 |
-#endif |
1117 |
- |
1118 |
- |
1119 |
- |
1120 |
|
1121 |
diff --git a/btl/actions/action_axpby.hh b/btl/actions/action_axpby.hh |
1122 |
deleted file mode 100644 |
1123 |
index 98511ab..0000000 |
1124 |
--- a/btl/actions/action_axpby.hh |
1125 |
+++ /dev/null |
1126 |
@@ -1,127 +0,0 @@ |
1127 |
-//===================================================== |
1128 |
-// File : action_axpby.hh |
1129 |
-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@×××××.fr> |
1130 |
-//===================================================== |
1131 |
-// |
1132 |
-// This program is free software; you can redistribute it and/or |
1133 |
-// modify it under the terms of the GNU General Public License |
1134 |
-// as published by the Free Software Foundation; either version 2 |
1135 |
-// of the License, or (at your option) any later version. |
1136 |
-// |
1137 |
-// This program is distributed in the hope that it will be useful, |
1138 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1139 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1140 |
-// GNU General Public License for more details. |
1141 |
-// You should have received a copy of the GNU General Public License |
1142 |
-// along with this program; if not, write to the Free Software |
1143 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1144 |
-// |
1145 |
-#ifndef ACTION_AXPBY |
1146 |
-#define ACTION_AXPBY |
1147 |
-#include "utilities.h" |
1148 |
-#include "STL_interface.hh" |
1149 |
-#include <string> |
1150 |
-#include "init/init_function.hh" |
1151 |
-#include "init/init_vector.hh" |
1152 |
-#include "init/init_matrix.hh" |
1153 |
- |
1154 |
-using namespace std; |
1155 |
- |
1156 |
-template<class Interface> |
1157 |
-class Action_axpby { |
1158 |
- |
1159 |
-public : |
1160 |
- |
1161 |
- // Ctor |
1162 |
- Action_axpby( int size ):_size(size),_alpha(0.5),_beta(0.95) |
1163 |
- { |
1164 |
- MESSAGE("Action_axpby Ctor"); |
1165 |
- |
1166 |
- // STL vector initialization |
1167 |
- init_vector<pseudo_random>(X_stl,_size); |
1168 |
- init_vector<pseudo_random>(Y_stl,_size); |
1169 |
- init_vector<null_function>(resu_stl,_size); |
1170 |
- |
1171 |
- // generic matrix and vector initialization |
1172 |
- Interface::vector_from_stl(X_ref,X_stl); |
1173 |
- Interface::vector_from_stl(Y_ref,Y_stl); |
1174 |
- |
1175 |
- Interface::vector_from_stl(X,X_stl); |
1176 |
- Interface::vector_from_stl(Y,Y_stl); |
1177 |
- } |
1178 |
- |
1179 |
- // invalidate copy ctor |
1180 |
- Action_axpby( const Action_axpby & ) |
1181 |
- { |
1182 |
- INFOS("illegal call to Action_axpby Copy Ctor"); |
1183 |
- exit(1); |
1184 |
- } |
1185 |
- |
1186 |
- // Dtor |
1187 |
- ~Action_axpby( void ){ |
1188 |
- MESSAGE("Action_axpby Dtor"); |
1189 |
- |
1190 |
- // deallocation |
1191 |
- Interface::free_vector(X_ref); |
1192 |
- Interface::free_vector(Y_ref); |
1193 |
- |
1194 |
- Interface::free_vector(X); |
1195 |
- Interface::free_vector(Y); |
1196 |
- } |
1197 |
- |
1198 |
- // action name |
1199 |
- static inline std::string name( void ) |
1200 |
- { |
1201 |
- return "axpby_"+Interface::name(); |
1202 |
- } |
1203 |
- |
1204 |
- double nb_op_base( void ){ |
1205 |
- return 3.0*_size; |
1206 |
- } |
1207 |
- |
1208 |
- inline void initialize( void ){ |
1209 |
- Interface::copy_vector(X_ref,X,_size); |
1210 |
- Interface::copy_vector(Y_ref,Y,_size); |
1211 |
- } |
1212 |
- |
1213 |
- inline void calculate( void ) { |
1214 |
- BTL_ASM_COMMENT("mybegin axpby"); |
1215 |
- Interface::axpby(_alpha,X,_beta,Y,_size); |
1216 |
- BTL_ASM_COMMENT("myend axpby"); |
1217 |
- } |
1218 |
- |
1219 |
- void check_result( void ){ |
1220 |
- if (_size>128) return; |
1221 |
- // calculation check |
1222 |
- Interface::vector_to_stl(Y,resu_stl); |
1223 |
- |
1224 |
- STL_interface<typename Interface::real_type>::axpby(_alpha,X_stl,_beta,Y_stl,_size); |
1225 |
- |
1226 |
- typename Interface::real_type error= |
1227 |
- STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl); |
1228 |
- |
1229 |
- if (error>1.e-6){ |
1230 |
- INFOS("WRONG CALCULATION...residual=" << error); |
1231 |
- exit(2); |
1232 |
- } |
1233 |
- } |
1234 |
- |
1235 |
-private : |
1236 |
- |
1237 |
- typename Interface::stl_vector X_stl; |
1238 |
- typename Interface::stl_vector Y_stl; |
1239 |
- typename Interface::stl_vector resu_stl; |
1240 |
- |
1241 |
- typename Interface::gene_vector X_ref; |
1242 |
- typename Interface::gene_vector Y_ref; |
1243 |
- |
1244 |
- typename Interface::gene_vector X; |
1245 |
- typename Interface::gene_vector Y; |
1246 |
- |
1247 |
- typename Interface::real_type _alpha; |
1248 |
- typename Interface::real_type _beta; |
1249 |
- |
1250 |
- int _size; |
1251 |
-}; |
1252 |
- |
1253 |
-#endif |
1254 |
|
1255 |
diff --git a/btl/actions/action_axpy.hh b/btl/actions/action_axpy.hh |
1256 |
deleted file mode 100644 |
1257 |
index e4cb3a5..0000000 |
1258 |
--- a/btl/actions/action_axpy.hh |
1259 |
+++ /dev/null |
1260 |
@@ -1,139 +0,0 @@ |
1261 |
-//===================================================== |
1262 |
-// File : action_axpy.hh |
1263 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
1264 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
1265 |
-//===================================================== |
1266 |
-// |
1267 |
-// This program is free software; you can redistribute it and/or |
1268 |
-// modify it under the terms of the GNU General Public License |
1269 |
-// as published by the Free Software Foundation; either version 2 |
1270 |
-// of the License, or (at your option) any later version. |
1271 |
-// |
1272 |
-// This program is distributed in the hope that it will be useful, |
1273 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1274 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1275 |
-// GNU General Public License for more details. |
1276 |
-// You should have received a copy of the GNU General Public License |
1277 |
-// along with this program; if not, write to the Free Software |
1278 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1279 |
-// |
1280 |
-#ifndef ACTION_AXPY |
1281 |
-#define ACTION_AXPY |
1282 |
-#include "utilities.h" |
1283 |
-#include "STL_interface.hh" |
1284 |
-#include <string> |
1285 |
-#include "init/init_function.hh" |
1286 |
-#include "init/init_vector.hh" |
1287 |
-#include "init/init_matrix.hh" |
1288 |
- |
1289 |
-using namespace std; |
1290 |
- |
1291 |
-template<class Interface> |
1292 |
-class Action_axpy { |
1293 |
- |
1294 |
-public : |
1295 |
- |
1296 |
- // Ctor |
1297 |
- |
1298 |
- Action_axpy( int size ):_size(size),_coef(1.0) |
1299 |
- { |
1300 |
- MESSAGE("Action_axpy Ctor"); |
1301 |
- |
1302 |
- // STL vector initialization |
1303 |
- |
1304 |
- init_vector<pseudo_random>(X_stl,_size); |
1305 |
- init_vector<pseudo_random>(Y_stl,_size); |
1306 |
- init_vector<null_function>(resu_stl,_size); |
1307 |
- |
1308 |
- // generic matrix and vector initialization |
1309 |
- |
1310 |
- Interface::vector_from_stl(X_ref,X_stl); |
1311 |
- Interface::vector_from_stl(Y_ref,Y_stl); |
1312 |
- |
1313 |
- Interface::vector_from_stl(X,X_stl); |
1314 |
- Interface::vector_from_stl(Y,Y_stl); |
1315 |
- |
1316 |
- |
1317 |
- } |
1318 |
- |
1319 |
- // invalidate copy ctor |
1320 |
- |
1321 |
- Action_axpy( const Action_axpy & ) |
1322 |
- { |
1323 |
- INFOS("illegal call to Action_axpy Copy Ctor"); |
1324 |
- exit(1); |
1325 |
- } |
1326 |
- |
1327 |
- // Dtor |
1328 |
- |
1329 |
- ~Action_axpy( void ){ |
1330 |
- |
1331 |
- MESSAGE("Action_axpy Dtor"); |
1332 |
- |
1333 |
- // deallocation |
1334 |
- |
1335 |
- Interface::free_vector(X_ref); |
1336 |
- Interface::free_vector(Y_ref); |
1337 |
- |
1338 |
- Interface::free_vector(X); |
1339 |
- Interface::free_vector(Y); |
1340 |
- } |
1341 |
- |
1342 |
- // action name |
1343 |
- |
1344 |
- static inline std::string name( void ) |
1345 |
- { |
1346 |
- return "axpy_"+Interface::name(); |
1347 |
- } |
1348 |
- |
1349 |
- double nb_op_base( void ){ |
1350 |
- return 2.0*_size; |
1351 |
- } |
1352 |
- |
1353 |
- inline void initialize( void ){ |
1354 |
- Interface::copy_vector(X_ref,X,_size); |
1355 |
- Interface::copy_vector(Y_ref,Y,_size); |
1356 |
- } |
1357 |
- |
1358 |
- inline void calculate( void ) { |
1359 |
- BTL_ASM_COMMENT("mybegin axpy"); |
1360 |
- Interface::axpy(_coef,X,Y,_size); |
1361 |
- BTL_ASM_COMMENT("myend axpy"); |
1362 |
- } |
1363 |
- |
1364 |
- void check_result( void ){ |
1365 |
- if (_size>128) return; |
1366 |
- // calculation check |
1367 |
- |
1368 |
- Interface::vector_to_stl(Y,resu_stl); |
1369 |
- |
1370 |
- STL_interface<typename Interface::real_type>::axpy(_coef,X_stl,Y_stl,_size); |
1371 |
- |
1372 |
- typename Interface::real_type error= |
1373 |
- STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl); |
1374 |
- |
1375 |
- if (error>1.e-6){ |
1376 |
- INFOS("WRONG CALCULATION...residual=" << error); |
1377 |
- exit(0); |
1378 |
- } |
1379 |
- |
1380 |
- } |
1381 |
- |
1382 |
-private : |
1383 |
- |
1384 |
- typename Interface::stl_vector X_stl; |
1385 |
- typename Interface::stl_vector Y_stl; |
1386 |
- typename Interface::stl_vector resu_stl; |
1387 |
- |
1388 |
- typename Interface::gene_vector X_ref; |
1389 |
- typename Interface::gene_vector Y_ref; |
1390 |
- |
1391 |
- typename Interface::gene_vector X; |
1392 |
- typename Interface::gene_vector Y; |
1393 |
- |
1394 |
- typename Interface::real_type _coef; |
1395 |
- |
1396 |
- int _size; |
1397 |
-}; |
1398 |
- |
1399 |
-#endif |
1400 |
|
1401 |
diff --git a/btl/actions/action_axpy.hpp b/btl/actions/action_axpy.hpp |
1402 |
new file mode 100644 |
1403 |
index 0000000..85cb40e |
1404 |
--- /dev/null |
1405 |
+++ b/btl/actions/action_axpy.hpp |
1406 |
@@ -0,0 +1,77 @@ |
1407 |
+//===================================================== |
1408 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
1409 |
+//===================================================== |
1410 |
+// |
1411 |
+// This program is free software; you can redistribute it and/or |
1412 |
+// modify it under the terms of the GNU General Public License |
1413 |
+// as published by the Free Software Foundation; either version 2 |
1414 |
+// of the License, or (at your option) any later version. |
1415 |
+// |
1416 |
+// This program is distributed in the hope that it will be useful, |
1417 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1418 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1419 |
+// GNU General Public License for more details. |
1420 |
+// You should have received a copy of the GNU General Public License |
1421 |
+// along with this program; if not, write to the Free Software |
1422 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1423 |
+// |
1424 |
+#ifndef ACTION_AXPY |
1425 |
+#define ACTION_AXPY |
1426 |
+ |
1427 |
+#include "LinearCongruential.hpp" |
1428 |
+#include <vector> |
1429 |
+#include <algorithm> |
1430 |
+ |
1431 |
+template<class Interface> |
1432 |
+class Action_axpy { |
1433 |
+ |
1434 |
+ typedef typename Interface::Scalar Scalar; |
1435 |
+ typedef std::vector<Scalar> vector_t; |
1436 |
+ |
1437 |
+private: |
1438 |
+ // Invalidate copy constructor |
1439 |
+ Action_axpy(const Action_axpy&); |
1440 |
+ |
1441 |
+public: |
1442 |
+ |
1443 |
+ // Constructor |
1444 |
+ Action_axpy(int size) |
1445 |
+ : _size(size), lc(10), |
1446 |
+ x(lc.fillVector<Scalar>(size)), |
1447 |
+ x_work(size), y_work(size) |
1448 |
+ { |
1449 |
+ MESSAGE("Action_axpy Constructor"); |
1450 |
+ } |
1451 |
+ |
1452 |
+ // Action name |
1453 |
+ static std::string name() |
1454 |
+ { |
1455 |
+ return "axpy_" + Interface::name(); |
1456 |
+ } |
1457 |
+ |
1458 |
+ double fpo() { |
1459 |
+ return 2*double(_size); |
1460 |
+ } |
1461 |
+ |
1462 |
+ inline void initialize(){ |
1463 |
+ std::copy(x.begin(), x.end(), x_work.begin()); |
1464 |
+ } |
1465 |
+ |
1466 |
+ inline void calculate() { |
1467 |
+ Interface::axpy(_size, 1., &x_work[0], &y_work[0]); |
1468 |
+ } |
1469 |
+ |
1470 |
+ Scalar getResidual() { |
1471 |
+ return 0.; |
1472 |
+ } |
1473 |
+ |
1474 |
+private: |
1475 |
+ const int _size; |
1476 |
+ LinearCongruential<> lc; |
1477 |
+ |
1478 |
+ const vector_t x; |
1479 |
+ vector_t x_work, y_work; |
1480 |
+ |
1481 |
+}; |
1482 |
+ |
1483 |
+#endif // ACTION_AXPY |
1484 |
|
1485 |
diff --git a/btl/actions/action_cholesky.hh b/btl/actions/action_cholesky.hh |
1486 |
deleted file mode 100644 |
1487 |
index a1c751b..0000000 |
1488 |
--- a/btl/actions/action_cholesky.hh |
1489 |
+++ /dev/null |
1490 |
@@ -1,129 +0,0 @@ |
1491 |
-//===================================================== |
1492 |
-// File : action_cholesky.hh |
1493 |
-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@×××××.fr> |
1494 |
-//===================================================== |
1495 |
-// |
1496 |
-// This program is free software; you can redistribute it and/or |
1497 |
-// modify it under the terms of the GNU General Public License |
1498 |
-// as published by the Free Software Foundation; either version 2 |
1499 |
-// of the License, or (at your option) any later version. |
1500 |
-// |
1501 |
-// This program is distributed in the hope that it will be useful, |
1502 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1503 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1504 |
-// GNU General Public License for more details. |
1505 |
-// You should have received a copy of the GNU General Public License |
1506 |
-// along with this program; if not, write to the Free Software |
1507 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1508 |
-// |
1509 |
-#ifndef ACTION_CHOLESKY |
1510 |
-#define ACTION_CHOLESKY |
1511 |
-#include "utilities.h" |
1512 |
-#include "STL_interface.hh" |
1513 |
-#include <string> |
1514 |
-#include <cmath> |
1515 |
-#include "init/init_function.hh" |
1516 |
-#include "init/init_vector.hh" |
1517 |
-#include "init/init_matrix.hh" |
1518 |
- |
1519 |
-using namespace std; |
1520 |
- |
1521 |
-template<class Interface> |
1522 |
-class Action_cholesky { |
1523 |
- |
1524 |
-public : |
1525 |
- |
1526 |
- // Ctor |
1527 |
- |
1528 |
- Action_cholesky( int size ):_size(size) |
1529 |
- { |
1530 |
- MESSAGE("Action_cholesky Ctor"); |
1531 |
- |
1532 |
- // STL mat/vec initialization |
1533 |
- init_matrix_symm<pseudo_random>(X_stl,_size); |
1534 |
- init_matrix<null_function>(C_stl,_size); |
1535 |
- |
1536 |
- // make sure X is invertible |
1537 |
- for (int i=0; i<_size; ++i) |
1538 |
- X_stl[i][i] = std::abs(X_stl[i][i]) * 1e2 + 100; |
1539 |
- |
1540 |
- // generic matrix and vector initialization |
1541 |
- Interface::matrix_from_stl(X_ref,X_stl); |
1542 |
- Interface::matrix_from_stl(X,X_stl); |
1543 |
- Interface::matrix_from_stl(C,C_stl); |
1544 |
- |
1545 |
- _cost = 0; |
1546 |
- for (int j=0; j<_size; ++j) |
1547 |
- { |
1548 |
- double r = std::max(_size - j -1,0); |
1549 |
- _cost += 2*(r*j+r+j); |
1550 |
- } |
1551 |
- } |
1552 |
- |
1553 |
- // invalidate copy ctor |
1554 |
- |
1555 |
- Action_cholesky( const Action_cholesky & ) |
1556 |
- { |
1557 |
- INFOS("illegal call to Action_cholesky Copy Ctor"); |
1558 |
- exit(1); |
1559 |
- } |
1560 |
- |
1561 |
- // Dtor |
1562 |
- |
1563 |
- ~Action_cholesky( void ){ |
1564 |
- |
1565 |
- MESSAGE("Action_cholesky Dtor"); |
1566 |
- |
1567 |
- // deallocation |
1568 |
- Interface::free_matrix(X_ref,_size); |
1569 |
- Interface::free_matrix(X,_size); |
1570 |
- Interface::free_matrix(C,_size); |
1571 |
- } |
1572 |
- |
1573 |
- // action name |
1574 |
- |
1575 |
- static inline std::string name( void ) |
1576 |
- { |
1577 |
- return "cholesky_"+Interface::name(); |
1578 |
- } |
1579 |
- |
1580 |
- double nb_op_base( void ){ |
1581 |
- return _cost; |
1582 |
- } |
1583 |
- |
1584 |
- inline void initialize( void ){ |
1585 |
- Interface::copy_matrix(X_ref,X,_size); |
1586 |
- } |
1587 |
- |
1588 |
- inline void calculate( void ) { |
1589 |
- Interface::cholesky(X,C,_size); |
1590 |
- } |
1591 |
- |
1592 |
- void check_result( void ){ |
1593 |
- // calculation check |
1594 |
-// STL_interface<typename Interface::real_type>::cholesky(X_stl,C_stl,_size); |
1595 |
-// |
1596 |
-// typename Interface::real_type error= |
1597 |
-// STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl); |
1598 |
-// |
1599 |
-// if (error>1.e-6){ |
1600 |
-// INFOS("WRONG CALCULATION...residual=" << error); |
1601 |
-// exit(0); |
1602 |
-// } |
1603 |
- |
1604 |
- } |
1605 |
- |
1606 |
-private : |
1607 |
- |
1608 |
- typename Interface::stl_matrix X_stl; |
1609 |
- typename Interface::stl_matrix C_stl; |
1610 |
- |
1611 |
- typename Interface::gene_matrix X_ref; |
1612 |
- typename Interface::gene_matrix X; |
1613 |
- typename Interface::gene_matrix C; |
1614 |
- |
1615 |
- int _size; |
1616 |
- double _cost; |
1617 |
-}; |
1618 |
- |
1619 |
-#endif |
1620 |
|
1621 |
diff --git a/btl/actions/action_general_solve.hh b/btl/actions/action_general_solve.hh |
1622 |
deleted file mode 100644 |
1623 |
index 78aebd8..0000000 |
1624 |
--- a/btl/actions/action_general_solve.hh |
1625 |
+++ /dev/null |
1626 |
@@ -1,137 +0,0 @@ |
1627 |
-//===================================================== |
1628 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
1629 |
-//===================================================== |
1630 |
-// |
1631 |
-// This program is free software; you can redistribute it and/or |
1632 |
-// modify it under the terms of the GNU General Public License |
1633 |
-// as published by the Free Software Foundation; either version 2 |
1634 |
-// of the License, or (at your option) any later version. |
1635 |
-// |
1636 |
-// This program is distributed in the hope that it will be useful, |
1637 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1638 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1639 |
-// GNU General Public License for more details. |
1640 |
-// You should have received a copy of the GNU General Public License |
1641 |
-// along with this program; if not, write to the Free Software |
1642 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1643 |
-// |
1644 |
-#ifndef ACTION_GENERAL_SOLVE |
1645 |
-#define ACTION_GENERAL_SOLVE |
1646 |
- |
1647 |
-#include "utilities.h" |
1648 |
-#include "STL_interface.hh" |
1649 |
-#include <string> |
1650 |
-#include "init/init_function.hh" |
1651 |
-#include "init/init_vector.hh" |
1652 |
-#include "init/init_matrix.hh" |
1653 |
- |
1654 |
-using namespace std; |
1655 |
- |
1656 |
-template<class Interface> |
1657 |
-class Action_general_solve { |
1658 |
- |
1659 |
-public: |
1660 |
- |
1661 |
- // Ctor |
1662 |
- Action_general_solve( int size ) : _size(size) |
1663 |
- { |
1664 |
- MESSAGE("Action_general_solve Ctor"); |
1665 |
- |
1666 |
- // STL matrix and vector initialization |
1667 |
- |
1668 |
- init_matrix<pseudo_random>(A_stl,_size); |
1669 |
- init_vector<pseudo_random>(B_stl,_size); |
1670 |
- init_vector<null_function>(X_stl,_size); |
1671 |
- init_vector<null_function>(resu_stl,_size); |
1672 |
- |
1673 |
- // generic matrix and vector initialization |
1674 |
- |
1675 |
- Interface::matrix_from_stl(A_ref,A_stl); |
1676 |
- Interface::matrix_from_stl(A,A_stl); |
1677 |
- Interface::vector_from_stl(B_ref,B_stl); |
1678 |
- Interface::vector_from_stl(B,B_stl); |
1679 |
- Interface::vector_from_stl(X_ref,X_stl); |
1680 |
- Interface::vector_from_stl(X,X_stl); |
1681 |
- |
1682 |
- |
1683 |
- } |
1684 |
- |
1685 |
- // invalidate copy ctor |
1686 |
- |
1687 |
- Action_general_solve( const Action_general_solve & ) |
1688 |
- { |
1689 |
- INFOS("illegal call to Action_general_solve Copy Ctor"); |
1690 |
- exit(0); |
1691 |
- } |
1692 |
- |
1693 |
- // Dtor |
1694 |
- |
1695 |
- BTL_DONT_INLINE ~Action_general_solve( void ){ |
1696 |
- |
1697 |
- MESSAGE("Action_general_solve Dtor"); |
1698 |
- |
1699 |
- // deallocation |
1700 |
- |
1701 |
- Interface::free_matrix(A,_size); |
1702 |
- Interface::free_vector(B); |
1703 |
- Interface::free_vector(X); |
1704 |
- |
1705 |
- Interface::free_matrix(A_ref,_size); |
1706 |
- Interface::free_vector(B_ref); |
1707 |
- Interface::free_vector(X_ref); |
1708 |
- |
1709 |
- } |
1710 |
- |
1711 |
- // action name |
1712 |
- |
1713 |
- static inline std::string name( void ) |
1714 |
- { |
1715 |
- return "general_solve_" + Interface::name(); |
1716 |
- } |
1717 |
- |
1718 |
- double nb_op_base( void ){ |
1719 |
- return 2.0*_size*_size*_size; |
1720 |
- } |
1721 |
- |
1722 |
- BTL_DONT_INLINE void initialize( void ){ |
1723 |
- |
1724 |
- Interface::copy_matrix(A_ref,A,_size); |
1725 |
- Interface::copy_vector(B_ref,B,_size); |
1726 |
- Interface::copy_vector(X_ref,X,_size); |
1727 |
- |
1728 |
- } |
1729 |
- |
1730 |
- BTL_DONT_INLINE void calculate( void ) { |
1731 |
- BTL_ASM_COMMENT("#begin general_solve"); |
1732 |
- Interface::general_solve(A,B,X,_size); |
1733 |
- BTL_ASM_COMMENT("end general_solve"); |
1734 |
- } |
1735 |
- |
1736 |
- BTL_DONT_INLINE void check_result() { |
1737 |
- // TODO: check result |
1738 |
- } |
1739 |
- |
1740 |
- |
1741 |
-private: |
1742 |
- |
1743 |
- typename Interface::stl_matrix A_stl; |
1744 |
- typename Interface::stl_vector B_stl; |
1745 |
- typename Interface::stl_vector X_stl; |
1746 |
- typename Interface::stl_vector resu_stl; |
1747 |
- |
1748 |
- typename Interface::gene_matrix A_ref; |
1749 |
- typename Interface::gene_vector B_ref; |
1750 |
- typename Interface::gene_vector X_ref; |
1751 |
- |
1752 |
- typename Interface::gene_matrix A; |
1753 |
- typename Interface::gene_vector B; |
1754 |
- typename Interface::gene_vector X; |
1755 |
- |
1756 |
- |
1757 |
- int _size; |
1758 |
- |
1759 |
- |
1760 |
-}; |
1761 |
- |
1762 |
- |
1763 |
-#endif// ACTION_GENERAL_SOLVE |
1764 |
|
1765 |
diff --git a/btl/actions/action_ger.hh b/btl/actions/action_ger.hh |
1766 |
deleted file mode 100644 |
1767 |
index dc766ef..0000000 |
1768 |
--- a/btl/actions/action_ger.hh |
1769 |
+++ /dev/null |
1770 |
@@ -1,128 +0,0 @@ |
1771 |
- |
1772 |
-// This program is free software; you can redistribute it and/or |
1773 |
-// modify it under the terms of the GNU General Public License |
1774 |
-// as published by the Free Software Foundation; either version 2 |
1775 |
-// of the License, or (at your option) any later version. |
1776 |
-// |
1777 |
-// This program is distributed in the hope that it will be useful, |
1778 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1779 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1780 |
-// GNU General Public License for more details. |
1781 |
-// You should have received a copy of the GNU General Public License |
1782 |
-// along with this program; if not, write to the Free Software |
1783 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1784 |
-// |
1785 |
-#ifndef ACTION_GER |
1786 |
-#define ACTION_GER |
1787 |
-#include "utilities.h" |
1788 |
-#include "STL_interface.hh" |
1789 |
-#include <string> |
1790 |
-#include "init/init_function.hh" |
1791 |
-#include "init/init_vector.hh" |
1792 |
-#include "init/init_matrix.hh" |
1793 |
- |
1794 |
-using namespace std; |
1795 |
- |
1796 |
-template<class Interface> |
1797 |
-class Action_ger { |
1798 |
- |
1799 |
-public : |
1800 |
- |
1801 |
- // Ctor |
1802 |
- BTL_DONT_INLINE Action_ger( int size ):_size(size) |
1803 |
- { |
1804 |
- MESSAGE("Action_ger Ctor"); |
1805 |
- |
1806 |
- // STL matrix and vector initialization |
1807 |
- typename Interface::stl_matrix tmp; |
1808 |
- init_matrix<pseudo_random>(A_stl,_size); |
1809 |
- init_vector<pseudo_random>(B_stl,_size); |
1810 |
- init_vector<pseudo_random>(X_stl,_size); |
1811 |
- init_vector<null_function>(resu_stl,_size); |
1812 |
- |
1813 |
- // generic matrix and vector initialization |
1814 |
- Interface::matrix_from_stl(A_ref,A_stl); |
1815 |
- Interface::matrix_from_stl(A,A_stl); |
1816 |
- Interface::vector_from_stl(B_ref,B_stl); |
1817 |
- Interface::vector_from_stl(B,B_stl); |
1818 |
- Interface::vector_from_stl(X_ref,X_stl); |
1819 |
- Interface::vector_from_stl(X,X_stl); |
1820 |
- } |
1821 |
- |
1822 |
- // invalidate copy ctor |
1823 |
- Action_ger( const Action_ger & ) |
1824 |
- { |
1825 |
- INFOS("illegal call to Action_ger Copy Ctor"); |
1826 |
- exit(1); |
1827 |
- } |
1828 |
- |
1829 |
- // Dtor |
1830 |
- BTL_DONT_INLINE ~Action_ger( void ){ |
1831 |
- MESSAGE("Action_ger Dtor"); |
1832 |
- Interface::free_matrix(A,_size); |
1833 |
- Interface::free_vector(B); |
1834 |
- Interface::free_vector(X); |
1835 |
- Interface::free_matrix(A_ref,_size); |
1836 |
- Interface::free_vector(B_ref); |
1837 |
- Interface::free_vector(X_ref); |
1838 |
- |
1839 |
- } |
1840 |
- |
1841 |
- // action name |
1842 |
- static inline std::string name( void ) |
1843 |
- { |
1844 |
- return "ger_" + Interface::name(); |
1845 |
- } |
1846 |
- |
1847 |
- double nb_op_base( void ){ |
1848 |
- return 2.0*_size*_size; |
1849 |
- } |
1850 |
- |
1851 |
- BTL_DONT_INLINE void initialize( void ){ |
1852 |
- Interface::copy_matrix(A_ref,A,_size); |
1853 |
- Interface::copy_vector(B_ref,B,_size); |
1854 |
- Interface::copy_vector(X_ref,X,_size); |
1855 |
- } |
1856 |
- |
1857 |
- BTL_DONT_INLINE void calculate( void ) { |
1858 |
- BTL_ASM_COMMENT("#begin ger"); |
1859 |
- Interface::ger(A,B,X,_size); |
1860 |
- BTL_ASM_COMMENT("end ger"); |
1861 |
- } |
1862 |
- |
1863 |
- BTL_DONT_INLINE void check_result( void ){ |
1864 |
- // calculation check |
1865 |
- Interface::vector_to_stl(X,resu_stl); |
1866 |
- |
1867 |
- STL_interface<typename Interface::real_type>::ger(A_stl,B_stl,X_stl,_size); |
1868 |
- |
1869 |
- typename Interface::real_type error= |
1870 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
1871 |
- |
1872 |
- if (error>1.e-3){ |
1873 |
- INFOS("WRONG CALCULATION...residual=" << error); |
1874 |
-// exit(0); |
1875 |
- } |
1876 |
- |
1877 |
- } |
1878 |
- |
1879 |
-private : |
1880 |
- |
1881 |
- typename Interface::stl_matrix A_stl; |
1882 |
- typename Interface::stl_vector B_stl; |
1883 |
- typename Interface::stl_vector X_stl; |
1884 |
- typename Interface::stl_vector resu_stl; |
1885 |
- |
1886 |
- typename Interface::gene_matrix A_ref; |
1887 |
- typename Interface::gene_vector B_ref; |
1888 |
- typename Interface::gene_vector X_ref; |
1889 |
- |
1890 |
- typename Interface::gene_matrix A; |
1891 |
- typename Interface::gene_vector B; |
1892 |
- typename Interface::gene_vector X; |
1893 |
- |
1894 |
- int _size; |
1895 |
-}; |
1896 |
- |
1897 |
- |
1898 |
-#endif |
1899 |
|
1900 |
diff --git a/btl/actions/action_hessenberg.hh b/btl/actions/action_hessenberg.hh |
1901 |
deleted file mode 100644 |
1902 |
index 2100ebd..0000000 |
1903 |
--- a/btl/actions/action_hessenberg.hh |
1904 |
+++ /dev/null |
1905 |
@@ -1,233 +0,0 @@ |
1906 |
-//===================================================== |
1907 |
-// File : action_hessenberg.hh |
1908 |
-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@×××××.fr> |
1909 |
-//===================================================== |
1910 |
-// |
1911 |
-// This program is free software; you can redistribute it and/or |
1912 |
-// modify it under the terms of the GNU General Public License |
1913 |
-// as published by the Free Software Foundation; either version 2 |
1914 |
-// of the License, or (at your option) any later version. |
1915 |
-// |
1916 |
-// This program is distributed in the hope that it will be useful, |
1917 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1918 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1919 |
-// GNU General Public License for more details. |
1920 |
-// You should have received a copy of the GNU General Public License |
1921 |
-// along with this program; if not, write to the Free Software |
1922 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1923 |
-// |
1924 |
-#ifndef ACTION_HESSENBERG |
1925 |
-#define ACTION_HESSENBERG |
1926 |
-#include "utilities.h" |
1927 |
-#include "STL_interface.hh" |
1928 |
-#include <string> |
1929 |
-#include "init/init_function.hh" |
1930 |
-#include "init/init_vector.hh" |
1931 |
-#include "init/init_matrix.hh" |
1932 |
- |
1933 |
-using namespace std; |
1934 |
- |
1935 |
-template<class Interface> |
1936 |
-class Action_hessenberg { |
1937 |
- |
1938 |
-public : |
1939 |
- |
1940 |
- // Ctor |
1941 |
- |
1942 |
- Action_hessenberg( int size ):_size(size) |
1943 |
- { |
1944 |
- MESSAGE("Action_hessenberg Ctor"); |
1945 |
- |
1946 |
- // STL vector initialization |
1947 |
- init_matrix<pseudo_random>(X_stl,_size); |
1948 |
- |
1949 |
- init_matrix<null_function>(C_stl,_size); |
1950 |
- init_matrix<null_function>(resu_stl,_size); |
1951 |
- |
1952 |
- // generic matrix and vector initialization |
1953 |
- Interface::matrix_from_stl(X_ref,X_stl); |
1954 |
- Interface::matrix_from_stl(X,X_stl); |
1955 |
- Interface::matrix_from_stl(C,C_stl); |
1956 |
- |
1957 |
- _cost = 0; |
1958 |
- for (int j=0; j<_size-2; ++j) |
1959 |
- { |
1960 |
- double r = std::max(0,_size-j-1); |
1961 |
- double b = std::max(0,_size-j-2); |
1962 |
- _cost += 6 + 3*b + r*r*4 + r*_size*4; |
1963 |
- } |
1964 |
- } |
1965 |
- |
1966 |
- // invalidate copy ctor |
1967 |
- |
1968 |
- Action_hessenberg( const Action_hessenberg & ) |
1969 |
- { |
1970 |
- INFOS("illegal call to Action_hessenberg Copy Ctor"); |
1971 |
- exit(1); |
1972 |
- } |
1973 |
- |
1974 |
- // Dtor |
1975 |
- |
1976 |
- ~Action_hessenberg( void ){ |
1977 |
- |
1978 |
- MESSAGE("Action_hessenberg Dtor"); |
1979 |
- |
1980 |
- // deallocation |
1981 |
- Interface::free_matrix(X_ref,_size); |
1982 |
- Interface::free_matrix(X,_size); |
1983 |
- Interface::free_matrix(C,_size); |
1984 |
- } |
1985 |
- |
1986 |
- // action name |
1987 |
- |
1988 |
- static inline std::string name( void ) |
1989 |
- { |
1990 |
- return "hessenberg_"+Interface::name(); |
1991 |
- } |
1992 |
- |
1993 |
- double nb_op_base( void ){ |
1994 |
- return _cost; |
1995 |
- } |
1996 |
- |
1997 |
- inline void initialize( void ){ |
1998 |
- Interface::copy_matrix(X_ref,X,_size); |
1999 |
- } |
2000 |
- |
2001 |
- inline void calculate( void ) { |
2002 |
- Interface::hessenberg(X,C,_size); |
2003 |
- } |
2004 |
- |
2005 |
- void check_result( void ){ |
2006 |
- // calculation check |
2007 |
- Interface::matrix_to_stl(C,resu_stl); |
2008 |
- |
2009 |
-// STL_interface<typename Interface::real_type>::hessenberg(X_stl,C_stl,_size); |
2010 |
-// |
2011 |
-// typename Interface::real_type error= |
2012 |
-// STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl); |
2013 |
-// |
2014 |
-// if (error>1.e-6){ |
2015 |
-// INFOS("WRONG CALCULATION...residual=" << error); |
2016 |
-// exit(0); |
2017 |
-// } |
2018 |
- |
2019 |
- } |
2020 |
- |
2021 |
-private : |
2022 |
- |
2023 |
- typename Interface::stl_matrix X_stl; |
2024 |
- typename Interface::stl_matrix C_stl; |
2025 |
- typename Interface::stl_matrix resu_stl; |
2026 |
- |
2027 |
- typename Interface::gene_matrix X_ref; |
2028 |
- typename Interface::gene_matrix X; |
2029 |
- typename Interface::gene_matrix C; |
2030 |
- |
2031 |
- int _size; |
2032 |
- double _cost; |
2033 |
-}; |
2034 |
- |
2035 |
-template<class Interface> |
2036 |
-class Action_tridiagonalization { |
2037 |
- |
2038 |
-public : |
2039 |
- |
2040 |
- // Ctor |
2041 |
- |
2042 |
- Action_tridiagonalization( int size ):_size(size) |
2043 |
- { |
2044 |
- MESSAGE("Action_tridiagonalization Ctor"); |
2045 |
- |
2046 |
- // STL vector initialization |
2047 |
- init_matrix<pseudo_random>(X_stl,_size); |
2048 |
- |
2049 |
- for(int i=0; i<_size; ++i) |
2050 |
- { |
2051 |
- for(int j=0; j<i; ++j) |
2052 |
- X_stl[i][j] = X_stl[j][i]; |
2053 |
- } |
2054 |
- |
2055 |
- init_matrix<null_function>(C_stl,_size); |
2056 |
- init_matrix<null_function>(resu_stl,_size); |
2057 |
- |
2058 |
- // generic matrix and vector initialization |
2059 |
- Interface::matrix_from_stl(X_ref,X_stl); |
2060 |
- Interface::matrix_from_stl(X,X_stl); |
2061 |
- Interface::matrix_from_stl(C,C_stl); |
2062 |
- |
2063 |
- _cost = 0; |
2064 |
- for (int j=0; j<_size-2; ++j) |
2065 |
- { |
2066 |
- double r = std::max(0,_size-j-1); |
2067 |
- double b = std::max(0,_size-j-2); |
2068 |
- _cost += 6. + 3.*b + r*r*8.; |
2069 |
- } |
2070 |
- } |
2071 |
- |
2072 |
- // invalidate copy ctor |
2073 |
- |
2074 |
- Action_tridiagonalization( const Action_tridiagonalization & ) |
2075 |
- { |
2076 |
- INFOS("illegal call to Action_tridiagonalization Copy Ctor"); |
2077 |
- exit(1); |
2078 |
- } |
2079 |
- |
2080 |
- // Dtor |
2081 |
- |
2082 |
- ~Action_tridiagonalization( void ){ |
2083 |
- |
2084 |
- MESSAGE("Action_tridiagonalization Dtor"); |
2085 |
- |
2086 |
- // deallocation |
2087 |
- Interface::free_matrix(X_ref,_size); |
2088 |
- Interface::free_matrix(X,_size); |
2089 |
- Interface::free_matrix(C,_size); |
2090 |
- } |
2091 |
- |
2092 |
- // action name |
2093 |
- |
2094 |
- static inline std::string name( void ) { return "tridiagonalization_"+Interface::name(); } |
2095 |
- |
2096 |
- double nb_op_base( void ){ |
2097 |
- return _cost; |
2098 |
- } |
2099 |
- |
2100 |
- inline void initialize( void ){ |
2101 |
- Interface::copy_matrix(X_ref,X,_size); |
2102 |
- } |
2103 |
- |
2104 |
- inline void calculate( void ) { |
2105 |
- Interface::tridiagonalization(X,C,_size); |
2106 |
- } |
2107 |
- |
2108 |
- void check_result( void ){ |
2109 |
- // calculation check |
2110 |
- Interface::matrix_to_stl(C,resu_stl); |
2111 |
- |
2112 |
-// STL_interface<typename Interface::real_type>::tridiagonalization(X_stl,C_stl,_size); |
2113 |
-// |
2114 |
-// typename Interface::real_type error= |
2115 |
-// STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl); |
2116 |
-// |
2117 |
-// if (error>1.e-6){ |
2118 |
-// INFOS("WRONG CALCULATION...residual=" << error); |
2119 |
-// exit(0); |
2120 |
-// } |
2121 |
- |
2122 |
- } |
2123 |
- |
2124 |
-private : |
2125 |
- |
2126 |
- typename Interface::stl_matrix X_stl; |
2127 |
- typename Interface::stl_matrix C_stl; |
2128 |
- typename Interface::stl_matrix resu_stl; |
2129 |
- |
2130 |
- typename Interface::gene_matrix X_ref; |
2131 |
- typename Interface::gene_matrix X; |
2132 |
- typename Interface::gene_matrix C; |
2133 |
- |
2134 |
- int _size; |
2135 |
- double _cost; |
2136 |
-}; |
2137 |
- |
2138 |
-#endif |
2139 |
|
2140 |
diff --git a/btl/actions/action_least_squares.hh b/btl/actions/action_least_squares.hh |
2141 |
deleted file mode 100644 |
2142 |
index f13c7dc..0000000 |
2143 |
--- a/btl/actions/action_least_squares.hh |
2144 |
+++ /dev/null |
2145 |
@@ -1,137 +0,0 @@ |
2146 |
-//===================================================== |
2147 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
2148 |
-//===================================================== |
2149 |
-// |
2150 |
-// This program is free software; you can redistribute it and/or |
2151 |
-// modify it under the terms of the GNU General Public License |
2152 |
-// as published by the Free Software Foundation; either version 2 |
2153 |
-// of the License, or (at your option) any later version. |
2154 |
-// |
2155 |
-// This program is distributed in the hope that it will be useful, |
2156 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2157 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2158 |
-// GNU General Public License for more details. |
2159 |
-// You should have received a copy of the GNU General Public License |
2160 |
-// along with this program; if not, write to the Free Software |
2161 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2162 |
-// |
2163 |
-#ifndef ACTION_LEAST_SQUARES |
2164 |
-#define ACTION_LEAST_SQUARES |
2165 |
- |
2166 |
-#include "utilities.h" |
2167 |
-#include "STL_interface.hh" |
2168 |
-#include <string> |
2169 |
-#include "init/init_function.hh" |
2170 |
-#include "init/init_vector.hh" |
2171 |
-#include "init/init_matrix.hh" |
2172 |
- |
2173 |
-using namespace std; |
2174 |
- |
2175 |
-template<class Interface> |
2176 |
-class Action_least_squares { |
2177 |
- |
2178 |
-public: |
2179 |
- |
2180 |
- // Ctor |
2181 |
- Action_least_squares( int size ) : _size(size) |
2182 |
- { |
2183 |
- MESSAGE("Action_least_squares Ctor"); |
2184 |
- |
2185 |
- // STL matrix and vector initialization |
2186 |
- |
2187 |
- init_matrix<pseudo_random>(A_stl,_size); |
2188 |
- init_vector<pseudo_random>(B_stl,_size); |
2189 |
- init_vector<null_function>(X_stl,_size); |
2190 |
- init_vector<null_function>(resu_stl,_size); |
2191 |
- |
2192 |
- // generic matrix and vector initialization |
2193 |
- |
2194 |
- Interface::matrix_from_stl(A_ref,A_stl); |
2195 |
- Interface::matrix_from_stl(A,A_stl); |
2196 |
- Interface::vector_from_stl(B_ref,B_stl); |
2197 |
- Interface::vector_from_stl(B,B_stl); |
2198 |
- Interface::vector_from_stl(X_ref,X_stl); |
2199 |
- Interface::vector_from_stl(X,X_stl); |
2200 |
- |
2201 |
- |
2202 |
- } |
2203 |
- |
2204 |
- // invalidate copy ctor |
2205 |
- |
2206 |
- Action_least_squares( const Action_least_squares & ) |
2207 |
- { |
2208 |
- INFOS("illegal call to Action_least_squares Copy Ctor"); |
2209 |
- exit(0); |
2210 |
- } |
2211 |
- |
2212 |
- // Dtor |
2213 |
- |
2214 |
- BTL_DONT_INLINE ~Action_least_squares( void ){ |
2215 |
- |
2216 |
- MESSAGE("Action_least_squares Dtor"); |
2217 |
- |
2218 |
- // deallocation |
2219 |
- |
2220 |
- Interface::free_matrix(A,_size); |
2221 |
- Interface::free_vector(B); |
2222 |
- Interface::free_vector(X); |
2223 |
- |
2224 |
- Interface::free_matrix(A_ref,_size); |
2225 |
- Interface::free_vector(B_ref); |
2226 |
- Interface::free_vector(X_ref); |
2227 |
- |
2228 |
- } |
2229 |
- |
2230 |
- // action name |
2231 |
- |
2232 |
- static inline std::string name( void ) |
2233 |
- { |
2234 |
- return "least_squares_" + Interface::name(); |
2235 |
- } |
2236 |
- |
2237 |
- double nb_op_base( void ){ |
2238 |
- return 2.0*_size*_size*_size; |
2239 |
- } |
2240 |
- |
2241 |
- BTL_DONT_INLINE void initialize( void ){ |
2242 |
- |
2243 |
- Interface::copy_matrix(A_ref,A,_size); |
2244 |
- Interface::copy_vector(B_ref,B,_size); |
2245 |
- Interface::copy_vector(X_ref,X,_size); |
2246 |
- |
2247 |
- } |
2248 |
- |
2249 |
- BTL_DONT_INLINE void calculate( void ) { |
2250 |
- BTL_ASM_COMMENT("#begin least_squares"); |
2251 |
- Interface::least_squares(A,B,X,_size); |
2252 |
- BTL_ASM_COMMENT("end least_squares"); |
2253 |
- } |
2254 |
- |
2255 |
- BTL_DONT_INLINE void check_result() { |
2256 |
- // TODO: check result |
2257 |
- } |
2258 |
- |
2259 |
- |
2260 |
-private: |
2261 |
- |
2262 |
- typename Interface::stl_matrix A_stl; |
2263 |
- typename Interface::stl_vector B_stl; |
2264 |
- typename Interface::stl_vector X_stl; |
2265 |
- typename Interface::stl_vector resu_stl; |
2266 |
- |
2267 |
- typename Interface::gene_matrix A_ref; |
2268 |
- typename Interface::gene_vector B_ref; |
2269 |
- typename Interface::gene_vector X_ref; |
2270 |
- |
2271 |
- typename Interface::gene_matrix A; |
2272 |
- typename Interface::gene_vector B; |
2273 |
- typename Interface::gene_vector X; |
2274 |
- |
2275 |
- |
2276 |
- int _size; |
2277 |
- |
2278 |
- |
2279 |
-}; |
2280 |
- |
2281 |
- |
2282 |
-#endif // ACTION_LEAST_SQUARES |
2283 |
|
2284 |
diff --git a/btl/actions/action_lu_decomp.hh b/btl/actions/action_lu_decomp.hh |
2285 |
deleted file mode 100644 |
2286 |
index 770c87d..0000000 |
2287 |
--- a/btl/actions/action_lu_decomp.hh |
2288 |
+++ /dev/null |
2289 |
@@ -1,109 +0,0 @@ |
2290 |
-//===================================================== |
2291 |
-// File : action_lu_decomp.hh |
2292 |
-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@×××××.fr> |
2293 |
-//===================================================== |
2294 |
-// |
2295 |
-// This program is free software; you can redistribute it and/or |
2296 |
-// modify it under the terms of the GNU General Public License |
2297 |
-// as published by the Free Software Foundation; either version 2 |
2298 |
-// of the License, or (at your option) any later version. |
2299 |
-// |
2300 |
-// This program is distributed in the hope that it will be useful, |
2301 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2302 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2303 |
-// GNU General Public License for more details. |
2304 |
-// You should have received a copy of the GNU General Public License |
2305 |
-// along with this program; if not, write to the Free Software |
2306 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2307 |
-// |
2308 |
-#ifndef ACTION_LU_DECOMP |
2309 |
-#define ACTION_LU_DECOMP |
2310 |
-#include "utilities.h" |
2311 |
-#include "STL_interface.hh" |
2312 |
-#include <string> |
2313 |
-#include "init/init_function.hh" |
2314 |
-#include "init/init_vector.hh" |
2315 |
-#include "init/init_matrix.hh" |
2316 |
- |
2317 |
-using namespace std; |
2318 |
- |
2319 |
-template<class Interface> |
2320 |
-class Action_lu_decomp { |
2321 |
- |
2322 |
-public : |
2323 |
- |
2324 |
- // Ctor |
2325 |
- |
2326 |
- Action_lu_decomp( int size ):_size(size) |
2327 |
- { |
2328 |
- MESSAGE("Action_lu_decomp Ctor"); |
2329 |
- |
2330 |
- // STL vector initialization |
2331 |
- init_matrix<pseudo_random>(X_stl,_size); |
2332 |
- |
2333 |
- init_matrix<null_function>(C_stl,_size); |
2334 |
- |
2335 |
- // generic matrix and vector initialization |
2336 |
- Interface::matrix_from_stl(X_ref,X_stl); |
2337 |
- Interface::matrix_from_stl(X,X_stl); |
2338 |
- Interface::matrix_from_stl(C,C_stl); |
2339 |
- |
2340 |
- _cost = 2.0*size*size*size/3.0 + size*size; |
2341 |
- } |
2342 |
- |
2343 |
- // invalidate copy ctor |
2344 |
- |
2345 |
- Action_lu_decomp( const Action_lu_decomp & ) |
2346 |
- { |
2347 |
- INFOS("illegal call to Action_lu_decomp Copy Ctor"); |
2348 |
- exit(1); |
2349 |
- } |
2350 |
- |
2351 |
- // Dtor |
2352 |
- |
2353 |
- ~Action_lu_decomp( void ){ |
2354 |
- |
2355 |
- MESSAGE("Action_lu_decomp Dtor"); |
2356 |
- |
2357 |
- // deallocation |
2358 |
- Interface::free_matrix(X_ref,_size); |
2359 |
- Interface::free_matrix(X,_size); |
2360 |
- Interface::free_matrix(C,_size); |
2361 |
- } |
2362 |
- |
2363 |
- // action name |
2364 |
- |
2365 |
- static inline std::string name( void ) |
2366 |
- { |
2367 |
- return "lu_decomp_"+Interface::name(); |
2368 |
- } |
2369 |
- |
2370 |
- double nb_op_base( void ){ |
2371 |
- return _cost; |
2372 |
- } |
2373 |
- |
2374 |
- inline void initialize( void ){ |
2375 |
- Interface::copy_matrix(X_ref,X,_size); |
2376 |
- } |
2377 |
- |
2378 |
- inline void calculate( void ) { |
2379 |
- Interface::lu_decomp(X,C,_size); |
2380 |
- } |
2381 |
- |
2382 |
- void check_result( void ){ |
2383 |
- } |
2384 |
- |
2385 |
-private : |
2386 |
- |
2387 |
- typename Interface::stl_matrix X_stl; |
2388 |
- typename Interface::stl_matrix C_stl; |
2389 |
- |
2390 |
- typename Interface::gene_matrix X_ref; |
2391 |
- typename Interface::gene_matrix X; |
2392 |
- typename Interface::gene_matrix C; |
2393 |
- |
2394 |
- int _size; |
2395 |
- double _cost; |
2396 |
-}; |
2397 |
- |
2398 |
-#endif |
2399 |
|
2400 |
diff --git a/btl/actions/action_lu_solve.hh b/btl/actions/action_lu_solve.hh |
2401 |
deleted file mode 100644 |
2402 |
index 5a81e63..0000000 |
2403 |
--- a/btl/actions/action_lu_solve.hh |
2404 |
+++ /dev/null |
2405 |
@@ -1,136 +0,0 @@ |
2406 |
-//===================================================== |
2407 |
-// File : action_lu_solve.hh |
2408 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
2409 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
2410 |
-//===================================================== |
2411 |
-// |
2412 |
-// This program is free software; you can redistribute it and/or |
2413 |
-// modify it under the terms of the GNU General Public License |
2414 |
-// as published by the Free Software Foundation; either version 2 |
2415 |
-// of the License, or (at your option) any later version. |
2416 |
-// |
2417 |
-// This program is distributed in the hope that it will be useful, |
2418 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2419 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2420 |
-// GNU General Public License for more details. |
2421 |
-// You should have received a copy of the GNU General Public License |
2422 |
-// along with this program; if not, write to the Free Software |
2423 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2424 |
-// |
2425 |
-#ifndef ACTION_LU_SOLVE |
2426 |
-#define ACTION_LU_SOLVE |
2427 |
-#include "utilities.h" |
2428 |
-#include "STL_interface.hh" |
2429 |
-#include <string> |
2430 |
-#include "init/init_function.hh" |
2431 |
-#include "init/init_vector.hh" |
2432 |
-#include "init/init_matrix.hh" |
2433 |
- |
2434 |
-using namespace std; |
2435 |
- |
2436 |
-template<class Interface> |
2437 |
-class Action_lu_solve |
2438 |
-{ |
2439 |
- |
2440 |
-public : |
2441 |
- |
2442 |
- static inline std::string name( void ) |
2443 |
- { |
2444 |
- return "lu_solve_"+Interface::name(); |
2445 |
- } |
2446 |
- |
2447 |
- static double nb_op_base(int size){ |
2448 |
- return 2.0*size*size*size/3.0; // questionable but not really important |
2449 |
- } |
2450 |
- |
2451 |
- |
2452 |
- static double calculate( int nb_calc, int size ) { |
2453 |
- |
2454 |
- // STL matrix and vector initialization |
2455 |
- |
2456 |
- typename Interface::stl_matrix A_stl; |
2457 |
- typename Interface::stl_vector B_stl; |
2458 |
- typename Interface::stl_vector X_stl; |
2459 |
- |
2460 |
- init_matrix<pseudo_random>(A_stl,size); |
2461 |
- init_vector<pseudo_random>(B_stl,size); |
2462 |
- init_vector<null_function>(X_stl,size); |
2463 |
- |
2464 |
- // generic matrix and vector initialization |
2465 |
- |
2466 |
- typename Interface::gene_matrix A; |
2467 |
- typename Interface::gene_vector B; |
2468 |
- typename Interface::gene_vector X; |
2469 |
- |
2470 |
- typename Interface::gene_matrix LU; |
2471 |
- |
2472 |
- Interface::matrix_from_stl(A,A_stl); |
2473 |
- Interface::vector_from_stl(B,B_stl); |
2474 |
- Interface::vector_from_stl(X,X_stl); |
2475 |
- Interface::matrix_from_stl(LU,A_stl); |
2476 |
- |
2477 |
- // local variable : |
2478 |
- |
2479 |
- typename Interface::Pivot_Vector pivot; // pivot vector |
2480 |
- Interface::new_Pivot_Vector(pivot,size); |
2481 |
- |
2482 |
- // timer utilities |
2483 |
- |
2484 |
- Portable_Timer chronos; |
2485 |
- |
2486 |
- // time measurement |
2487 |
- |
2488 |
- chronos.start(); |
2489 |
- |
2490 |
- for (int ii=0;ii<nb_calc;ii++){ |
2491 |
- |
2492 |
- // LU factorization |
2493 |
- Interface::copy_matrix(A,LU,size); |
2494 |
- Interface::LU_factor(LU,pivot,size); |
2495 |
- |
2496 |
- // LU solve |
2497 |
- |
2498 |
- Interface::LU_solve(LU,pivot,B,X,size); |
2499 |
- |
2500 |
- } |
2501 |
- |
2502 |
- // Time stop |
2503 |
- |
2504 |
- chronos.stop(); |
2505 |
- |
2506 |
- double time=chronos.user_time(); |
2507 |
- |
2508 |
- // check result : |
2509 |
- |
2510 |
- typename Interface::stl_vector B_new_stl(size); |
2511 |
- Interface::vector_to_stl(X,X_stl); |
2512 |
- |
2513 |
- STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl,X_stl,B_new_stl,size); |
2514 |
- |
2515 |
- typename Interface::real_type error= |
2516 |
- STL_interface<typename Interface::real_type>::norm_diff(B_stl,B_new_stl); |
2517 |
- |
2518 |
- if (error>1.e-5){ |
2519 |
- INFOS("WRONG CALCULATION...residual=" << error); |
2520 |
- STL_interface<typename Interface::real_type>::display_vector(B_stl); |
2521 |
- STL_interface<typename Interface::real_type>::display_vector(B_new_stl); |
2522 |
- exit(0); |
2523 |
- } |
2524 |
- |
2525 |
- // deallocation and return time |
2526 |
- |
2527 |
- Interface::free_matrix(A,size); |
2528 |
- Interface::free_vector(B); |
2529 |
- Interface::free_vector(X); |
2530 |
- Interface::free_Pivot_Vector(pivot); |
2531 |
- |
2532 |
- return time; |
2533 |
- } |
2534 |
- |
2535 |
-}; |
2536 |
- |
2537 |
- |
2538 |
-#endif |
2539 |
- |
2540 |
- |
2541 |
- |
2542 |
|
2543 |
diff --git a/btl/actions/action_matrix_matrix_product.hh b/btl/actions/action_matrix_matrix_product.hh |
2544 |
deleted file mode 100644 |
2545 |
index f65ee05..0000000 |
2546 |
--- a/btl/actions/action_matrix_matrix_product.hh |
2547 |
+++ /dev/null |
2548 |
@@ -1,150 +0,0 @@ |
2549 |
-//===================================================== |
2550 |
-// File : action_matrix_matrix_product.hh |
2551 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
2552 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
2553 |
-//===================================================== |
2554 |
-// |
2555 |
-// This program is free software; you can redistribute it and/or |
2556 |
-// modify it under the terms of the GNU General Public License |
2557 |
-// as published by the Free Software Foundation; either version 2 |
2558 |
-// of the License, or (at your option) any later version. |
2559 |
-// |
2560 |
-// This program is distributed in the hope that it will be useful, |
2561 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2562 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2563 |
-// GNU General Public License for more details. |
2564 |
-// You should have received a copy of the GNU General Public License |
2565 |
-// along with this program; if not, write to the Free Software |
2566 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2567 |
-// |
2568 |
-#ifndef ACTION_MATRIX_MATRIX_PRODUCT |
2569 |
-#define ACTION_MATRIX_MATRIX_PRODUCT |
2570 |
-#include "utilities.h" |
2571 |
-#include "STL_interface.hh" |
2572 |
-#include <string> |
2573 |
-#include "init/init_function.hh" |
2574 |
-#include "init/init_vector.hh" |
2575 |
-#include "init/init_matrix.hh" |
2576 |
- |
2577 |
-using namespace std; |
2578 |
- |
2579 |
-template<class Interface> |
2580 |
-class Action_matrix_matrix_product { |
2581 |
- |
2582 |
-public : |
2583 |
- |
2584 |
- // Ctor |
2585 |
- |
2586 |
- Action_matrix_matrix_product( int size ):_size(size) |
2587 |
- { |
2588 |
- MESSAGE("Action_matrix_matrix_product Ctor"); |
2589 |
- |
2590 |
- // STL matrix and vector initialization |
2591 |
- |
2592 |
- init_matrix<pseudo_random>(A_stl,_size); |
2593 |
- init_matrix<pseudo_random>(B_stl,_size); |
2594 |
- init_matrix<null_function>(X_stl,_size); |
2595 |
- init_matrix<null_function>(resu_stl,_size); |
2596 |
- |
2597 |
- // generic matrix and vector initialization |
2598 |
- |
2599 |
- Interface::matrix_from_stl(A_ref,A_stl); |
2600 |
- Interface::matrix_from_stl(B_ref,B_stl); |
2601 |
- Interface::matrix_from_stl(X_ref,X_stl); |
2602 |
- |
2603 |
- Interface::matrix_from_stl(A,A_stl); |
2604 |
- Interface::matrix_from_stl(B,B_stl); |
2605 |
- Interface::matrix_from_stl(X,X_stl); |
2606 |
- |
2607 |
- } |
2608 |
- |
2609 |
- // invalidate copy ctor |
2610 |
- |
2611 |
- Action_matrix_matrix_product( const Action_matrix_matrix_product & ) |
2612 |
- { |
2613 |
- INFOS("illegal call to Action_matrix_matrix_product Copy Ctor"); |
2614 |
- exit(0); |
2615 |
- } |
2616 |
- |
2617 |
- // Dtor |
2618 |
- |
2619 |
- ~Action_matrix_matrix_product( void ){ |
2620 |
- |
2621 |
- MESSAGE("Action_matrix_matrix_product Dtor"); |
2622 |
- |
2623 |
- // deallocation |
2624 |
- |
2625 |
- Interface::free_matrix(A,_size); |
2626 |
- Interface::free_matrix(B,_size); |
2627 |
- Interface::free_matrix(X,_size); |
2628 |
- |
2629 |
- Interface::free_matrix(A_ref,_size); |
2630 |
- Interface::free_matrix(B_ref,_size); |
2631 |
- Interface::free_matrix(X_ref,_size); |
2632 |
- |
2633 |
- } |
2634 |
- |
2635 |
- // action name |
2636 |
- |
2637 |
- static inline std::string name( void ) |
2638 |
- { |
2639 |
- return "matrix_matrix_"+Interface::name(); |
2640 |
- } |
2641 |
- |
2642 |
- double nb_op_base( void ){ |
2643 |
- return 2.0*_size*_size*_size; |
2644 |
- } |
2645 |
- |
2646 |
- inline void initialize( void ){ |
2647 |
- |
2648 |
- Interface::copy_matrix(A_ref,A,_size); |
2649 |
- Interface::copy_matrix(B_ref,B,_size); |
2650 |
- Interface::copy_matrix(X_ref,X,_size); |
2651 |
- |
2652 |
- } |
2653 |
- |
2654 |
- inline void calculate( void ) { |
2655 |
- Interface::matrix_matrix_product(A,B,X,_size); |
2656 |
- } |
2657 |
- |
2658 |
- void check_result( void ){ |
2659 |
- |
2660 |
- // calculation check |
2661 |
- if (_size<200) |
2662 |
- { |
2663 |
- Interface::matrix_to_stl(X,resu_stl); |
2664 |
- STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size); |
2665 |
- typename Interface::real_type error= |
2666 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
2667 |
- if (error>1.e-6){ |
2668 |
- INFOS("WRONG CALCULATION...residual=" << error); |
2669 |
- exit(1); |
2670 |
- } |
2671 |
- } |
2672 |
- } |
2673 |
- |
2674 |
-private : |
2675 |
- |
2676 |
- typename Interface::stl_matrix A_stl; |
2677 |
- typename Interface::stl_matrix B_stl; |
2678 |
- typename Interface::stl_matrix X_stl; |
2679 |
- typename Interface::stl_matrix resu_stl; |
2680 |
- |
2681 |
- typename Interface::gene_matrix A_ref; |
2682 |
- typename Interface::gene_matrix B_ref; |
2683 |
- typename Interface::gene_matrix X_ref; |
2684 |
- |
2685 |
- typename Interface::gene_matrix A; |
2686 |
- typename Interface::gene_matrix B; |
2687 |
- typename Interface::gene_matrix X; |
2688 |
- |
2689 |
- |
2690 |
- int _size; |
2691 |
- |
2692 |
-}; |
2693 |
- |
2694 |
- |
2695 |
-#endif |
2696 |
- |
2697 |
- |
2698 |
- |
2699 |
|
2700 |
diff --git a/btl/actions/action_matrix_matrix_product_bis.hh b/btl/actions/action_matrix_matrix_product_bis.hh |
2701 |
deleted file mode 100644 |
2702 |
index 29c10a6..0000000 |
2703 |
--- a/btl/actions/action_matrix_matrix_product_bis.hh |
2704 |
+++ /dev/null |
2705 |
@@ -1,152 +0,0 @@ |
2706 |
-//===================================================== |
2707 |
-// File : action_matrix_matrix_product_bis.hh |
2708 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
2709 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
2710 |
-//===================================================== |
2711 |
-// |
2712 |
-// This program is free software; you can redistribute it and/or |
2713 |
-// modify it under the terms of the GNU General Public License |
2714 |
-// as published by the Free Software Foundation; either version 2 |
2715 |
-// of the License, or (at your option) any later version. |
2716 |
-// |
2717 |
-// This program is distributed in the hope that it will be useful, |
2718 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2719 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2720 |
-// GNU General Public License for more details. |
2721 |
-// You should have received a copy of the GNU General Public License |
2722 |
-// along with this program; if not, write to the Free Software |
2723 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2724 |
-// |
2725 |
-#ifndef ACTION_MATRIX_MATRIX_PRODUCT_BIS |
2726 |
-#define ACTION_MATRIX_MATRIX_PRODUCT_BIS |
2727 |
-#include "utilities.h" |
2728 |
-#include "STL_interface.hh" |
2729 |
-#include "STL_timer.hh" |
2730 |
-#include <string> |
2731 |
-#include "init_function.hh" |
2732 |
-#include "init_vector.hh" |
2733 |
-#include "init_matrix.hh" |
2734 |
- |
2735 |
-using namespace std; |
2736 |
- |
2737 |
-template<class Interface> |
2738 |
-class Action_matrix_matrix_product_bis { |
2739 |
- |
2740 |
-public : |
2741 |
- |
2742 |
- static inline std::string name( void ) |
2743 |
- { |
2744 |
- return "matrix_matrix_"+Interface::name(); |
2745 |
- } |
2746 |
- |
2747 |
- static double nb_op_base(int size){ |
2748 |
- return 2.0*size*size*size; |
2749 |
- } |
2750 |
- |
2751 |
- static double calculate( int nb_calc, int size ) { |
2752 |
- |
2753 |
- // STL matrix and vector initialization |
2754 |
- |
2755 |
- typename Interface::stl_matrix A_stl; |
2756 |
- typename Interface::stl_matrix B_stl; |
2757 |
- typename Interface::stl_matrix X_stl; |
2758 |
- |
2759 |
- init_matrix<pseudo_random>(A_stl,size); |
2760 |
- init_matrix<pseudo_random>(B_stl,size); |
2761 |
- init_matrix<null_function>(X_stl,size); |
2762 |
- |
2763 |
- // generic matrix and vector initialization |
2764 |
- |
2765 |
- typename Interface::gene_matrix A_ref; |
2766 |
- typename Interface::gene_matrix B_ref; |
2767 |
- typename Interface::gene_matrix X_ref; |
2768 |
- |
2769 |
- typename Interface::gene_matrix A; |
2770 |
- typename Interface::gene_matrix B; |
2771 |
- typename Interface::gene_matrix X; |
2772 |
- |
2773 |
- |
2774 |
- Interface::matrix_from_stl(A_ref,A_stl); |
2775 |
- Interface::matrix_from_stl(B_ref,B_stl); |
2776 |
- Interface::matrix_from_stl(X_ref,X_stl); |
2777 |
- |
2778 |
- Interface::matrix_from_stl(A,A_stl); |
2779 |
- Interface::matrix_from_stl(B,B_stl); |
2780 |
- Interface::matrix_from_stl(X,X_stl); |
2781 |
- |
2782 |
- |
2783 |
- // STL_timer utilities |
2784 |
- |
2785 |
- STL_timer chronos; |
2786 |
- |
2787 |
- // Baseline evaluation |
2788 |
- |
2789 |
- chronos.start_baseline(nb_calc); |
2790 |
- |
2791 |
- do { |
2792 |
- |
2793 |
- Interface::copy_matrix(A_ref,A,size); |
2794 |
- Interface::copy_matrix(B_ref,B,size); |
2795 |
- Interface::copy_matrix(X_ref,X,size); |
2796 |
- |
2797 |
- |
2798 |
- // Interface::matrix_matrix_product(A,B,X,size); This line must be commented !!!! |
2799 |
- } |
2800 |
- while(chronos.check()); |
2801 |
- |
2802 |
- chronos.report(true); |
2803 |
- |
2804 |
- // Time measurement |
2805 |
- |
2806 |
- chronos.start(nb_calc); |
2807 |
- |
2808 |
- do { |
2809 |
- |
2810 |
- Interface::copy_matrix(A_ref,A,size); |
2811 |
- Interface::copy_matrix(B_ref,B,size); |
2812 |
- Interface::copy_matrix(X_ref,X,size); |
2813 |
- |
2814 |
- Interface::matrix_matrix_product(A,B,X,size); // here it is not commented !!!! |
2815 |
- } |
2816 |
- while(chronos.check()); |
2817 |
- |
2818 |
- chronos.report(true); |
2819 |
- |
2820 |
- double time=chronos.calculated_time/2000.0; |
2821 |
- |
2822 |
- // calculation check |
2823 |
- |
2824 |
- typename Interface::stl_matrix resu_stl(size); |
2825 |
- |
2826 |
- Interface::matrix_to_stl(X,resu_stl); |
2827 |
- |
2828 |
- STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,size); |
2829 |
- |
2830 |
- typename Interface::real_type error= |
2831 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
2832 |
- |
2833 |
- if (error>1.e-6){ |
2834 |
- INFOS("WRONG CALCULATION...residual=" << error); |
2835 |
- exit(1); |
2836 |
- } |
2837 |
- |
2838 |
- // deallocation and return time |
2839 |
- |
2840 |
- Interface::free_matrix(A,size); |
2841 |
- Interface::free_matrix(B,size); |
2842 |
- Interface::free_matrix(X,size); |
2843 |
- |
2844 |
- Interface::free_matrix(A_ref,size); |
2845 |
- Interface::free_matrix(B_ref,size); |
2846 |
- Interface::free_matrix(X_ref,size); |
2847 |
- |
2848 |
- return time; |
2849 |
- } |
2850 |
- |
2851 |
-}; |
2852 |
- |
2853 |
- |
2854 |
-#endif |
2855 |
- |
2856 |
- |
2857 |
- |
2858 |
|
2859 |
diff --git a/btl/actions/action_matrix_vector_product.hh b/btl/actions/action_matrix_vector_product.hh |
2860 |
deleted file mode 100644 |
2861 |
index 8bab79d..0000000 |
2862 |
--- a/btl/actions/action_matrix_vector_product.hh |
2863 |
+++ /dev/null |
2864 |
@@ -1,153 +0,0 @@ |
2865 |
-//===================================================== |
2866 |
-// File : action_matrix_vector_product.hh |
2867 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
2868 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
2869 |
-//===================================================== |
2870 |
-// |
2871 |
-// This program is free software; you can redistribute it and/or |
2872 |
-// modify it under the terms of the GNU General Public License |
2873 |
-// as published by the Free Software Foundation; either version 2 |
2874 |
-// of the License, or (at your option) any later version. |
2875 |
-// |
2876 |
-// This program is distributed in the hope that it will be useful, |
2877 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2878 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2879 |
-// GNU General Public License for more details. |
2880 |
-// You should have received a copy of the GNU General Public License |
2881 |
-// along with this program; if not, write to the Free Software |
2882 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2883 |
-// |
2884 |
-#ifndef ACTION_MATRIX_VECTOR_PRODUCT |
2885 |
-#define ACTION_MATRIX_VECTOR_PRODUCT |
2886 |
-#include "utilities.h" |
2887 |
-#include "STL_interface.hh" |
2888 |
-#include <string> |
2889 |
-#include "init/init_function.hh" |
2890 |
-#include "init/init_vector.hh" |
2891 |
-#include "init/init_matrix.hh" |
2892 |
- |
2893 |
-using namespace std; |
2894 |
- |
2895 |
-template<class Interface> |
2896 |
-class Action_matrix_vector_product { |
2897 |
- |
2898 |
-public : |
2899 |
- |
2900 |
- // Ctor |
2901 |
- |
2902 |
- BTL_DONT_INLINE Action_matrix_vector_product( int size ):_size(size) |
2903 |
- { |
2904 |
- MESSAGE("Action_matrix_vector_product Ctor"); |
2905 |
- |
2906 |
- // STL matrix and vector initialization |
2907 |
- |
2908 |
- init_matrix<pseudo_random>(A_stl,_size); |
2909 |
- init_vector<pseudo_random>(B_stl,_size); |
2910 |
- init_vector<null_function>(X_stl,_size); |
2911 |
- init_vector<null_function>(resu_stl,_size); |
2912 |
- |
2913 |
- // generic matrix and vector initialization |
2914 |
- |
2915 |
- Interface::matrix_from_stl(A_ref,A_stl); |
2916 |
- Interface::matrix_from_stl(A,A_stl); |
2917 |
- Interface::vector_from_stl(B_ref,B_stl); |
2918 |
- Interface::vector_from_stl(B,B_stl); |
2919 |
- Interface::vector_from_stl(X_ref,X_stl); |
2920 |
- Interface::vector_from_stl(X,X_stl); |
2921 |
- |
2922 |
- } |
2923 |
- |
2924 |
- // invalidate copy ctor |
2925 |
- |
2926 |
- Action_matrix_vector_product( const Action_matrix_vector_product & ) |
2927 |
- { |
2928 |
- INFOS("illegal call to Action_matrix_vector_product Copy Ctor"); |
2929 |
- exit(1); |
2930 |
- } |
2931 |
- |
2932 |
- // Dtor |
2933 |
- |
2934 |
- BTL_DONT_INLINE ~Action_matrix_vector_product( void ){ |
2935 |
- |
2936 |
- MESSAGE("Action_matrix_vector_product Dtor"); |
2937 |
- |
2938 |
- // deallocation |
2939 |
- |
2940 |
- Interface::free_matrix(A,_size); |
2941 |
- Interface::free_vector(B); |
2942 |
- Interface::free_vector(X); |
2943 |
- |
2944 |
- Interface::free_matrix(A_ref,_size); |
2945 |
- Interface::free_vector(B_ref); |
2946 |
- Interface::free_vector(X_ref); |
2947 |
- |
2948 |
- } |
2949 |
- |
2950 |
- // action name |
2951 |
- |
2952 |
- static inline std::string name( void ) |
2953 |
- { |
2954 |
- return "matrix_vector_" + Interface::name(); |
2955 |
- } |
2956 |
- |
2957 |
- double nb_op_base( void ){ |
2958 |
- return 2.0*_size*_size; |
2959 |
- } |
2960 |
- |
2961 |
- BTL_DONT_INLINE void initialize( void ){ |
2962 |
- |
2963 |
- Interface::copy_matrix(A_ref,A,_size); |
2964 |
- Interface::copy_vector(B_ref,B,_size); |
2965 |
- Interface::copy_vector(X_ref,X,_size); |
2966 |
- |
2967 |
- } |
2968 |
- |
2969 |
- BTL_DONT_INLINE void calculate( void ) { |
2970 |
- BTL_ASM_COMMENT("#begin matrix_vector_product"); |
2971 |
- Interface::matrix_vector_product(A,B,X,_size); |
2972 |
- BTL_ASM_COMMENT("end matrix_vector_product"); |
2973 |
- } |
2974 |
- |
2975 |
- BTL_DONT_INLINE void check_result( void ){ |
2976 |
- |
2977 |
- // calculation check |
2978 |
- |
2979 |
- Interface::vector_to_stl(X,resu_stl); |
2980 |
- |
2981 |
- STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl,B_stl,X_stl,_size); |
2982 |
- |
2983 |
- typename Interface::real_type error= |
2984 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
2985 |
- |
2986 |
- if (error>1.e-5){ |
2987 |
- INFOS("WRONG CALCULATION...residual=" << error); |
2988 |
- exit(0); |
2989 |
- } |
2990 |
- |
2991 |
- } |
2992 |
- |
2993 |
-private : |
2994 |
- |
2995 |
- typename Interface::stl_matrix A_stl; |
2996 |
- typename Interface::stl_vector B_stl; |
2997 |
- typename Interface::stl_vector X_stl; |
2998 |
- typename Interface::stl_vector resu_stl; |
2999 |
- |
3000 |
- typename Interface::gene_matrix A_ref; |
3001 |
- typename Interface::gene_vector B_ref; |
3002 |
- typename Interface::gene_vector X_ref; |
3003 |
- |
3004 |
- typename Interface::gene_matrix A; |
3005 |
- typename Interface::gene_vector B; |
3006 |
- typename Interface::gene_vector X; |
3007 |
- |
3008 |
- |
3009 |
- int _size; |
3010 |
- |
3011 |
-}; |
3012 |
- |
3013 |
- |
3014 |
-#endif |
3015 |
- |
3016 |
- |
3017 |
- |
3018 |
|
3019 |
diff --git a/btl/actions/action_parallel_axpy.hh b/btl/actions/action_parallel_axpy.hh |
3020 |
deleted file mode 100644 |
3021 |
index 5053446..0000000 |
3022 |
--- a/btl/actions/action_parallel_axpy.hh |
3023 |
+++ /dev/null |
3024 |
@@ -1,158 +0,0 @@ |
3025 |
-//===================================================== |
3026 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
3027 |
-//===================================================== |
3028 |
-// |
3029 |
-// This program is free software; you can redistribute it and/or |
3030 |
-// modify it under the terms of the GNU General Public License |
3031 |
-// as published by the Free Software Foundation; either version 2 |
3032 |
-// of the License, or (at your option) any later version. |
3033 |
-// |
3034 |
-// This program is distributed in the hope that it will be useful, |
3035 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3036 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3037 |
-// GNU General Public License for more details. |
3038 |
-// You should have received a copy of the GNU General Public License |
3039 |
-// along with this program; if not, write to the Free Software |
3040 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3041 |
-// |
3042 |
-#ifndef ACTION_PARALLEL_AXPY |
3043 |
-#define ACTION_PARALLEL_AXPY |
3044 |
-#include "utilities.h" |
3045 |
-#include "STL_interface.hh" |
3046 |
-#include <string> |
3047 |
-#include <algorithm> |
3048 |
-#include "init/init_function.hh" |
3049 |
-#include "init/init_vector.hh" |
3050 |
-#include "init/init_matrix.hh" |
3051 |
- |
3052 |
-#include "blas.h" |
3053 |
- |
3054 |
-using namespace std; |
3055 |
- |
3056 |
-template<class Interface> |
3057 |
-class Action_parallel_axpy { |
3058 |
-public: |
3059 |
- BTL_DONT_INLINE Action_parallel_axpy( int size ):_size(size), _coef(1.) |
3060 |
- { |
3061 |
- MESSAGE("Action_parallel_axpy Ctor"); |
3062 |
- int iZERO = 0, iONE = 1; |
3063 |
- |
3064 |
- GlobalRows = _size; |
3065 |
- GlobalCols = 1; |
3066 |
- BlockRows = 2; |
3067 |
- BlockCols= 1; |
3068 |
- |
3069 |
- int myid, procnum; |
3070 |
- blacs_pinfo_(&myid, &procnum); |
3071 |
- iamroot = (myid == 0); |
3072 |
- |
3073 |
- // STL matrix and vector initialization |
3074 |
- if (iamroot) { |
3075 |
- init_vector<pseudo_random>(Global_x_stl, _size); |
3076 |
- init_vector<pseudo_random>(Global_y_stl, _size); |
3077 |
- } |
3078 |
- |
3079 |
- Interface::scatter_matrix(Global_x_stl, Local_x_stl, GlobalRows, GlobalCols, BlockRows, BlockCols, LocalRows, LocalCols); |
3080 |
- Interface::scatter_matrix(Global_y_stl, Local_y_stl, GlobalRows, GlobalCols, BlockRows, BlockCols, LocalRows, LocalCols); |
3081 |
- |
3082 |
- Interface::vector_from_stl(Local_x_ref, Local_x_stl); |
3083 |
- Interface::vector_from_stl(Local_x , Local_x_stl); |
3084 |
- Interface::vector_from_stl(Local_y_ref, Local_y_stl); |
3085 |
- Interface::vector_from_stl(Local_y , Local_y_stl); |
3086 |
- |
3087 |
- // Descinit |
3088 |
- int context = Interface::context(); |
3089 |
- int info; |
3090 |
- int LD = std::max(1, LocalRows); |
3091 |
- descinit_(descX, &_size, &iONE, &BlockRows, &BlockCols, &iZERO, &iZERO, &context, &LD, &info); |
3092 |
- descinit_(descY, &_size, &iONE, &BlockRows, &BlockCols, &iZERO, &iZERO, &context, &LD, &info); |
3093 |
- |
3094 |
- // Copy Y to Test_y |
3095 |
- Test_y_stl = Global_y_stl; |
3096 |
- } |
3097 |
- |
3098 |
- // Invalidate copy constructor |
3099 |
- Action_parallel_axpy (const Action_parallel_axpy&) |
3100 |
- { |
3101 |
- INFOS("illegal call to Action_parallel_axpy Copy Ctor"); |
3102 |
- exit(1); |
3103 |
- } |
3104 |
- |
3105 |
- // Destructor |
3106 |
- BTL_DONT_INLINE ~Action_parallel_axpy(){ |
3107 |
- |
3108 |
- MESSAGE("Action_parallel_axpy Dtor"); |
3109 |
- |
3110 |
- // deallocation |
3111 |
- |
3112 |
- Interface::free_vector(Local_x_ref); |
3113 |
- Interface::free_vector(Local_y_ref); |
3114 |
- |
3115 |
- Interface::free_vector(Local_x); |
3116 |
- Interface::free_vector(Local_y); |
3117 |
- } |
3118 |
- |
3119 |
- // action name |
3120 |
- static inline std::string name() |
3121 |
- { |
3122 |
- return "axpy_" + Interface::name(); |
3123 |
- } |
3124 |
- |
3125 |
- double nb_op_base( void ){ |
3126 |
- return 2.0*_size; |
3127 |
- } |
3128 |
- |
3129 |
- BTL_DONT_INLINE void initialize(){ |
3130 |
- Interface::copy_vector(Local_x_ref, Local_x, LocalRows*LocalCols); |
3131 |
- Interface::copy_vector(Local_y_ref, Local_y, LocalRows*LocalCols); |
3132 |
- } |
3133 |
- |
3134 |
- BTL_DONT_INLINE void calculate( void ) { |
3135 |
- BTL_ASM_COMMENT("#begin axpy"); |
3136 |
- Interface::parallel_axpy(_coef, Local_x, descX, Local_y, descY, _size); |
3137 |
- BTL_ASM_COMMENT("end axpy"); |
3138 |
- } |
3139 |
- |
3140 |
- void check_result( void ){ |
3141 |
- int iONE = 1; |
3142 |
- Interface::vector_to_stl(Local_y, Local_y_stl); |
3143 |
- Interface::gather_matrix(Global_y_stl, Local_y_stl, GlobalRows, GlobalCols, BlockRows, BlockCols, LocalRows, LocalCols); |
3144 |
- |
3145 |
- // calculation check |
3146 |
- if (iamroot) { |
3147 |
- |
3148 |
- // Compute YTest |
3149 |
- STL_interface<typename Interface::real_type>::axpy(_coef, Global_x_stl, Test_y_stl, _size); |
3150 |
- |
3151 |
- typename Interface::real_type error = |
3152 |
- STL_interface<typename Interface::real_type>::norm_diff(Global_y_stl, Test_y_stl); |
3153 |
- |
3154 |
- if (error > 1e-5) |
3155 |
- std::cerr << "Error: " << error << std::endl; |
3156 |
- } |
3157 |
- |
3158 |
- } |
3159 |
- |
3160 |
-private: |
3161 |
- int _size; |
3162 |
- int GlobalRows, GlobalCols, BlockRows, BlockCols, LocalRows, LocalCols; |
3163 |
- typename Interface::real_type _coef; |
3164 |
- bool iamroot; |
3165 |
- |
3166 |
- typename Interface::stl_vector Global_x_stl; |
3167 |
- typename Interface::stl_vector Global_y_stl; |
3168 |
- typename Interface::stl_vector Test_y_stl; |
3169 |
- |
3170 |
- typename Interface::stl_vector Local_x_stl; |
3171 |
- typename Interface::stl_vector Local_y_stl; |
3172 |
- |
3173 |
- typename Interface::gene_vector Local_x_ref; |
3174 |
- typename Interface::gene_vector Local_y_ref; |
3175 |
- |
3176 |
- typename Interface::gene_vector Local_x; |
3177 |
- typename Interface::gene_vector Local_y; |
3178 |
- |
3179 |
- int descX[9], descY[9]; |
3180 |
-}; |
3181 |
- |
3182 |
-#endif |
3183 |
|
3184 |
diff --git a/btl/actions/action_parallel_cholesky.hh b/btl/actions/action_parallel_cholesky.hh |
3185 |
deleted file mode 100644 |
3186 |
index d6bef14..0000000 |
3187 |
--- a/btl/actions/action_parallel_cholesky.hh |
3188 |
+++ /dev/null |
3189 |
@@ -1,130 +0,0 @@ |
3190 |
-//===================================================== |
3191 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
3192 |
-//===================================================== |
3193 |
-// |
3194 |
-// This program is free software; you can redistribute it and/or |
3195 |
-// modify it under the terms of the GNU General Public License |
3196 |
-// as published by the Free Software Foundation; either version 2 |
3197 |
-// of the License, or (at your option) any later version. |
3198 |
-// |
3199 |
-// This program is distributed in the hope that it will be useful, |
3200 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3201 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3202 |
-// GNU General Public License for more details. |
3203 |
-// You should have received a copy of the GNU General Public License |
3204 |
-// along with this program; if not, write to the Free Software |
3205 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3206 |
-// |
3207 |
-#ifndef ACTION_PARALLEL_CHOLESKY_HH_ |
3208 |
-#define ACTION_PARALLEL_CHOLESKY_HH_ |
3209 |
- |
3210 |
-#include "utilities.h" |
3211 |
-#include "init/init_function.hh" |
3212 |
-#include "init/init_vector.hh" |
3213 |
- |
3214 |
-#include "lapack_interface.hh" |
3215 |
-#include "STL_interface.hh" |
3216 |
- |
3217 |
-#include <string> |
3218 |
-#include <sstream> |
3219 |
-#include <fstream> |
3220 |
- |
3221 |
-template<class Interface> |
3222 |
-class Action_parallel_cholesky { |
3223 |
- typedef lapack_interface<typename Interface::real_type> LapackInterface; |
3224 |
- |
3225 |
-public : |
3226 |
- |
3227 |
- // Constructor |
3228 |
- BTL_DONT_INLINE Action_parallel_cholesky( int size ) : _size(size) |
3229 |
- { |
3230 |
- MESSAGE("Action_parallel_cholesky Ctor"); |
3231 |
- |
3232 |
- int myid, procnum; |
3233 |
- blacs_pinfo_(&myid, &procnum); |
3234 |
- iamroot = (myid == 0); |
3235 |
- |
3236 |
- // STL matrix and vector initialization |
3237 |
- if (iamroot) { |
3238 |
- /* Using a constant seed */ |
3239 |
- const unsigned seed = 3; |
3240 |
- init_SPD_matrix(Global_A_stl, size, seed); |
3241 |
- } |
3242 |
- |
3243 |
- const int blocksize = std::max(std::min(size/4, 64), 2); |
3244 |
- scatter_matrix(Global_A_stl, Local_A_stl, desc, size, size, blocksize, blocksize); |
3245 |
- LocalRows = desc[8]; |
3246 |
- LocalCols = Local_A_stl.size()/desc[8]; |
3247 |
- |
3248 |
- // Generic local matrix and vectors initialization |
3249 |
- Interface::matrix_from_stl(Local_A , Local_A_stl); |
3250 |
- |
3251 |
- _cost = 0; |
3252 |
- for (int j=0; j<_size; ++j) { |
3253 |
- double r = std::max(_size - j -1,0); |
3254 |
- _cost += 2*(r*j+r+j); |
3255 |
- } |
3256 |
- } |
3257 |
- |
3258 |
- |
3259 |
- // Invalidate copy constructor |
3260 |
- Action_parallel_cholesky(const Action_parallel_cholesky&) |
3261 |
- { |
3262 |
- INFOS("illegal call to Action_parallel_cholesky copy constructor"); |
3263 |
- exit(1); |
3264 |
- } |
3265 |
- |
3266 |
- // Destructor |
3267 |
- ~Action_parallel_cholesky() |
3268 |
- { |
3269 |
- MESSAGE("Action_parallel_cholesky destructor"); |
3270 |
- |
3271 |
- // Deallocation |
3272 |
- Interface::free_matrix(Local_A , Local_A_stl.size()); |
3273 |
- } |
3274 |
- |
3275 |
- // Action name |
3276 |
- static inline std::string name() |
3277 |
- { |
3278 |
- return "cholesky_" + Interface::name(); |
3279 |
- } |
3280 |
- |
3281 |
- double nb_op_base() |
3282 |
- { |
3283 |
- return _cost; |
3284 |
- } |
3285 |
- |
3286 |
- BTL_DONT_INLINE void initialize() |
3287 |
- { |
3288 |
- } |
3289 |
- |
3290 |
- BTL_DONT_INLINE void calculate() |
3291 |
- { |
3292 |
- Interface::copy_matrix(&Local_A_stl[0], Local_A, Local_A_stl.size()); |
3293 |
- Interface::parallel_cholesky(Local_A, desc); |
3294 |
- } |
3295 |
- |
3296 |
- BTL_DONT_INLINE void check_result() |
3297 |
- { |
3298 |
- if (_size > 2) { |
3299 |
- double error = Interface::test_cholesky(Global_A_stl, Local_A, desc); |
3300 |
- if (iamroot) |
3301 |
- cout << " {error: " << error << "} "; |
3302 |
- } |
3303 |
- } |
3304 |
- |
3305 |
- |
3306 |
-private: |
3307 |
- int _size, desc[9], LocalRows, LocalCols; |
3308 |
- double _cost; |
3309 |
- bool iamroot; |
3310 |
- |
3311 |
- typename Interface::stl_matrix Global_A_stl; |
3312 |
- typename Interface::stl_matrix Local_A_stl; |
3313 |
- typename Interface::gene_matrix Local_A; |
3314 |
- |
3315 |
- typename Interface::stl_matrix Glotal_Test_stl; |
3316 |
- typename Interface::stl_matrix Local_Test_stl; |
3317 |
-}; |
3318 |
- |
3319 |
-#endif /* ACTION_PARALLEL_CHOLESKY_HH_ */ |
3320 |
|
3321 |
diff --git a/btl/actions/action_parallel_lu_decomp.hh b/btl/actions/action_parallel_lu_decomp.hh |
3322 |
deleted file mode 100644 |
3323 |
index a6b3600..0000000 |
3324 |
--- a/btl/actions/action_parallel_lu_decomp.hh |
3325 |
+++ /dev/null |
3326 |
@@ -1,142 +0,0 @@ |
3327 |
-//===================================================== |
3328 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
3329 |
-//===================================================== |
3330 |
-// |
3331 |
-// This program is free software; you can redistribute it and/or |
3332 |
-// modify it under the terms of the GNU General Public License |
3333 |
-// as published by the Free Software Foundation; either version 2 |
3334 |
-// of the License, or (at your option) any later version. |
3335 |
-// |
3336 |
-// This program is distributed in the hope that it will be useful, |
3337 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3338 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3339 |
-// GNU General Public License for more details. |
3340 |
-// You should have received a copy of the GNU General Public License |
3341 |
-// along with this program; if not, write to the Free Software |
3342 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3343 |
-// |
3344 |
-#ifndef ACTION_PARALLEL_LU_DECOMP_HH_ |
3345 |
-#define ACTION_PARALLEL_LU_DECOMP_HH_ |
3346 |
- |
3347 |
-#include "utilities.h" |
3348 |
-#include "init/init_function.hh" |
3349 |
-#include "init/init_vector.hh" |
3350 |
- |
3351 |
-#include "lapack_interface.hh" |
3352 |
-#include "STL_interface.hh" |
3353 |
- |
3354 |
-#include <string> |
3355 |
- |
3356 |
-template<class Interface> |
3357 |
-class Action_parallel_lu_decomp { |
3358 |
- |
3359 |
-public : |
3360 |
- |
3361 |
- // Constructor |
3362 |
- BTL_DONT_INLINE Action_parallel_lu_decomp( int size ) : _size(size) |
3363 |
- { |
3364 |
- MESSAGE("Action_parallel_lu_decomp Ctor"); |
3365 |
- |
3366 |
- int myid, procnum; |
3367 |
- blacs_pinfo_(&myid, &procnum); |
3368 |
- iamroot = (myid == 0); |
3369 |
- |
3370 |
- // STL matrix and vector initialization |
3371 |
- if (iamroot) { |
3372 |
- /* Using a constant seed */ |
3373 |
- const unsigned seed = 3; |
3374 |
- init_matrix(Global_A_stl, size, seed); |
3375 |
- } |
3376 |
- |
3377 |
- const int blocksize = std::max(std::min(size/4, 64), 2); |
3378 |
- scatter_matrix(Global_A_stl, Local_A_stl, desc, size, size, blocksize, blocksize); |
3379 |
- LocalRows = desc[8]; |
3380 |
- LocalCols = Local_A_stl.size()/desc[8]; |
3381 |
- |
3382 |
- // Generic local matrix and vectors initialization |
3383 |
- Interface::matrix_from_stl(Local_A , Local_A_stl); |
3384 |
- |
3385 |
- _cost = 2.0*size*size*size/3.0 + static_cast<double>(size*size); |
3386 |
- } |
3387 |
- |
3388 |
- |
3389 |
- // Invalidate copy constructor |
3390 |
- Action_parallel_lu_decomp(const Action_parallel_lu_decomp&) |
3391 |
- { |
3392 |
- INFOS("illegal call to Action_parallel_lu_decomp copy constructor"); |
3393 |
- exit(1); |
3394 |
- } |
3395 |
- |
3396 |
- // Destructor |
3397 |
- ~Action_parallel_lu_decomp() |
3398 |
- { |
3399 |
- MESSAGE("Action_parallel_lu_decomp destructor"); |
3400 |
- |
3401 |
- // Deallocation |
3402 |
- Interface::free_matrix(Local_A , Local_A_stl.size()); |
3403 |
- } |
3404 |
- |
3405 |
- // Action name |
3406 |
- static inline std::string name() |
3407 |
- { |
3408 |
- return "lu_decomp_" + Interface::name(); |
3409 |
- } |
3410 |
- |
3411 |
- double nb_op_base() |
3412 |
- { |
3413 |
- return _cost; |
3414 |
- } |
3415 |
- |
3416 |
- BTL_DONT_INLINE void initialize() |
3417 |
- { |
3418 |
- } |
3419 |
- |
3420 |
- BTL_DONT_INLINE void calculate() |
3421 |
- { |
3422 |
- Interface::copy_matrix(&Local_A_stl[0], Local_A, Local_A_stl.size()); |
3423 |
- Interface::parallel_lu_decomp(Local_A, ipiv_stl, desc); |
3424 |
- } |
3425 |
- |
3426 |
- BTL_DONT_INLINE void check_result() |
3427 |
- { |
3428 |
-// /* Gather */ |
3429 |
-// typename Interface::stl_matrix Global_Y; |
3430 |
-// typename Interface::stl_matrix Local_Y(Local_A_stl.size()); |
3431 |
-// Interface::matrix_to_stl(Local_A, Local_Y); |
3432 |
-// Interface::gather_matrix(Global_Y, Local_Y, desc); |
3433 |
-// |
3434 |
-// if (iamroot) { |
3435 |
-// |
3436 |
-// typename Interface::gene_matrix A; |
3437 |
-// Interface::matrix_from_stl(A, Global_A_stl); |
3438 |
-// lapack_interface<typename Interface::real_type>::lu_decomp(&Global_A_stl[0], A, _size); |
3439 |
-// typename Interface::stl_vector correct(A, A+_size*_size); |
3440 |
-// typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(Global_Y, correct); |
3441 |
-// if (error > 10e-5) |
3442 |
-// cerr << " { !! error : " << error << " !! } "; |
3443 |
-// |
3444 |
-// Interface::free_matrix(A, _size*_size); |
3445 |
-// } |
3446 |
- |
3447 |
- |
3448 |
-// if (_size > 2) { |
3449 |
-// double error = Interface::test_LU(Global_A_stl, Local_A, desc); |
3450 |
-// if (iamroot) |
3451 |
-// cout << " {error: " << error << "} "; |
3452 |
-// } |
3453 |
- } |
3454 |
- |
3455 |
-private: |
3456 |
- int _size, desc[9], LocalRows, LocalCols; |
3457 |
- double _cost; |
3458 |
- bool iamroot; |
3459 |
- |
3460 |
- typename Interface::stl_matrix Global_A_stl; |
3461 |
- typename Interface::stl_matrix Local_A_stl; |
3462 |
- typename Interface::gene_matrix Local_A; |
3463 |
- |
3464 |
- std::vector<int> ipiv_stl; |
3465 |
-}; |
3466 |
- |
3467 |
- |
3468 |
-#endif /* ACTION_PARALLEL_LU_DECOMP_HH_ */ |
3469 |
|
3470 |
diff --git a/btl/actions/action_parallel_matrix_vector_product.hh b/btl/actions/action_parallel_matrix_vector_product.hh |
3471 |
deleted file mode 100644 |
3472 |
index 51eafb9..0000000 |
3473 |
--- a/btl/actions/action_parallel_matrix_vector_product.hh |
3474 |
+++ /dev/null |
3475 |
@@ -1,159 +0,0 @@ |
3476 |
-//===================================================== |
3477 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
3478 |
-//===================================================== |
3479 |
-// |
3480 |
-// This program is free software; you can redistribute it and/or |
3481 |
-// modify it under the terms of the GNU General Public License |
3482 |
-// as published by the Free Software Foundation; either version 2 |
3483 |
-// of the License, or (at your option) any later version. |
3484 |
-// |
3485 |
-// This program is distributed in the hope that it will be useful, |
3486 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3487 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3488 |
-// GNU General Public License for more details. |
3489 |
-// You should have received a copy of the GNU General Public License |
3490 |
-// along with this program; if not, write to the Free Software |
3491 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3492 |
-// |
3493 |
-#ifndef ACTION_PARALLEL_MATRIX_VECTOR_PRODUCT |
3494 |
-#define ACTION_PARALLEL_MATRIX_VECTOR_PRODUCT |
3495 |
-#include "utilities.h" |
3496 |
-#include "STL_interface.hh" |
3497 |
-#include <string> |
3498 |
-#include <algorithm> |
3499 |
-#include "init/init_function.hh" |
3500 |
-#include "init/init_vector.hh" |
3501 |
-#include "init/init_matrix.hh" |
3502 |
- |
3503 |
-#include "blas.h" |
3504 |
- |
3505 |
-template<class Interface> |
3506 |
-class Action_parallel_matrix_vector_product { |
3507 |
- |
3508 |
-public : |
3509 |
- |
3510 |
- // Ctor |
3511 |
- |
3512 |
- BTL_DONT_INLINE Action_parallel_matrix_vector_product( int size ):_size(size) |
3513 |
- { |
3514 |
- MESSAGE("Action_parallel_matrix_vector_product Ctor"); |
3515 |
- int iZERO = 0, iONE = 1; |
3516 |
- |
3517 |
- int myid, procnum; |
3518 |
- blacs_pinfo_(&myid, &procnum); |
3519 |
- iamroot = (myid == 0); |
3520 |
- |
3521 |
- // STL matrix and vector initialization |
3522 |
- if (iamroot) { |
3523 |
- init_vector<pseudo_random>(Global_A_stl, size*size); |
3524 |
- init_vector<pseudo_random>(Global_x_stl, size); |
3525 |
- init_vector<null_function>(Global_y_stl, size); |
3526 |
- } |
3527 |
- |
3528 |
- const int blocksize = std::max(std::min(size/4, 64), 2); |
3529 |
- Interface::scatter_matrix(Global_A_stl, Local_A_stl, descA, size, size, blocksize, blocksize); |
3530 |
- Interface::scatter_matrix(Global_x_stl, Local_x_stl, descX, size, 1, blocksize, blocksize); |
3531 |
- Interface::scatter_matrix(Global_y_stl, Local_y_stl, descY, size, 1, blocksize, blocksize); |
3532 |
- |
3533 |
- // generic local matrix and vectors initialization |
3534 |
- |
3535 |
- Interface::matrix_from_stl(Local_A_ref, Local_A_stl); |
3536 |
- Interface::matrix_from_stl(Local_A , Local_A_stl); |
3537 |
- Interface::vector_from_stl(Local_x_ref, Local_x_stl); |
3538 |
- Interface::vector_from_stl(Local_x , Local_x_stl); |
3539 |
- Interface::vector_from_stl(Local_y_ref, Local_y_stl); |
3540 |
- Interface::vector_from_stl(Local_y , Local_y_stl); |
3541 |
- } |
3542 |
- |
3543 |
- // invalidate copy ctor |
3544 |
- Action_parallel_matrix_vector_product( const Action_parallel_matrix_vector_product & ) |
3545 |
- { |
3546 |
- INFOS("illegal call to Action_parallel_matrix_vector_product copy constructor"); |
3547 |
- exit(1); |
3548 |
- } |
3549 |
- |
3550 |
- // Dtor |
3551 |
- BTL_DONT_INLINE ~Action_parallel_matrix_vector_product(){ |
3552 |
- |
3553 |
- MESSAGE("Action_parallel_matrix_vector_product destructor"); |
3554 |
- |
3555 |
- // deallocation |
3556 |
- |
3557 |
- Interface::free_matrix(Local_A_ref, _size*_size); |
3558 |
- Interface::free_vector(Local_x_ref); |
3559 |
- Interface::free_vector(Local_y_ref); |
3560 |
- |
3561 |
- Interface::free_matrix(Local_A, _size*_size); |
3562 |
- Interface::free_vector(Local_x); |
3563 |
- Interface::free_vector(Local_y); |
3564 |
- |
3565 |
- } |
3566 |
- |
3567 |
- // action name |
3568 |
- static inline std::string name( void ) |
3569 |
- { |
3570 |
- return "matrix_vector_" + Interface::name(); |
3571 |
- } |
3572 |
- |
3573 |
- double nb_op_base( void ){ |
3574 |
- return 2.0*_size*_size; |
3575 |
- } |
3576 |
- |
3577 |
- BTL_DONT_INLINE void initialize( void ){ |
3578 |
- Interface::copy_matrix(Local_A_ref, Local_A, Local_A_stl.size()); |
3579 |
- Interface::copy_vector(Local_x_ref, Local_x, Local_x_stl.size()); |
3580 |
- Interface::copy_vector(Local_y_ref, Local_y, Local_y_stl.size()); |
3581 |
- } |
3582 |
- |
3583 |
- BTL_DONT_INLINE void calculate( void ) { |
3584 |
- Interface::parallel_matrix_vector_product(_size, _size, Local_A, descA, Local_x, descX, Local_y, descY); |
3585 |
- } |
3586 |
- |
3587 |
- BTL_DONT_INLINE void check_result( void ){ |
3588 |
- int GlobalYCols; |
3589 |
- Interface::vector_to_stl(Local_y, Local_y_stl); |
3590 |
- |
3591 |
- Interface::gather_matrix(Global_y_stl, Local_y_stl, descY); |
3592 |
- |
3593 |
- // calculation check |
3594 |
- if (iamroot) { |
3595 |
- |
3596 |
- // Compute YTest |
3597 |
- Test_y_stl.resize(_size); |
3598 |
- STL_interface<typename Interface::real_type>::matrix_vector_product(Global_A_stl, Global_x_stl, Test_y_stl, _size); |
3599 |
- |
3600 |
- typename Interface::real_type error = STL_interface<typename Interface::real_type>::norm_diff(Global_y_stl, Test_y_stl); |
3601 |
- |
3602 |
- if (error > 1e-5) |
3603 |
- std::cerr << "Error: " << error << " "; |
3604 |
- } |
3605 |
- |
3606 |
- } |
3607 |
- |
3608 |
-private : |
3609 |
- |
3610 |
- typename Interface::stl_matrix Global_A_stl; |
3611 |
- typename Interface::stl_vector Global_x_stl; |
3612 |
- typename Interface::stl_vector Global_y_stl; |
3613 |
- typename Interface::stl_vector Test_y_stl; |
3614 |
- |
3615 |
- typename Interface::stl_matrix Local_A_stl; |
3616 |
- typename Interface::stl_vector Local_x_stl; |
3617 |
- typename Interface::stl_vector Local_y_stl; |
3618 |
- |
3619 |
- typename Interface::gene_matrix Local_A_ref; |
3620 |
- typename Interface::gene_vector Local_x_ref; |
3621 |
- typename Interface::gene_vector Local_y_ref; |
3622 |
- |
3623 |
- typename Interface::gene_matrix Local_A; |
3624 |
- typename Interface::gene_vector Local_x; |
3625 |
- typename Interface::gene_vector Local_y; |
3626 |
- |
3627 |
- bool iamroot; |
3628 |
- int _size; |
3629 |
- int descA[9], descX[9], descY[9]; |
3630 |
- |
3631 |
-}; |
3632 |
- |
3633 |
- |
3634 |
-#endif |
3635 |
|
3636 |
diff --git a/btl/actions/action_parallel_qr_decomp.hh b/btl/actions/action_parallel_qr_decomp.hh |
3637 |
deleted file mode 100644 |
3638 |
index 3c50fb4..0000000 |
3639 |
--- a/btl/actions/action_parallel_qr_decomp.hh |
3640 |
+++ /dev/null |
3641 |
@@ -1,116 +0,0 @@ |
3642 |
-//===================================================== |
3643 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
3644 |
-//===================================================== |
3645 |
-// |
3646 |
-// This program is free software; you can redistribute it and/or |
3647 |
-// modify it under the terms of the GNU General Public License |
3648 |
-// as published by the Free Software Foundation; either version 2 |
3649 |
-// of the License, or (at your option) any later version. |
3650 |
-// |
3651 |
-// This program is distributed in the hope that it will be useful, |
3652 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3653 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3654 |
-// GNU General Public License for more details. |
3655 |
-// You should have received a copy of the GNU General Public License |
3656 |
-// along with this program; if not, write to the Free Software |
3657 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3658 |
-// |
3659 |
-#ifndef ACTION_PARALLEL_QR_DECOMP_HH_ |
3660 |
-#define ACTION_PARALLEL_QR_DECOMP_HH_ |
3661 |
- |
3662 |
-#include "utilities.h" |
3663 |
-#include "init/init_function.hh" |
3664 |
-#include "init/init_vector.hh" |
3665 |
- |
3666 |
-#include "lapack_interface.hh" |
3667 |
-#include "STL_interface.hh" |
3668 |
- |
3669 |
-#include <string> |
3670 |
-#include <algorithm> |
3671 |
- |
3672 |
-template<class Interface> |
3673 |
-class Action_parallel_qr_decomp { |
3674 |
- |
3675 |
-public : |
3676 |
- |
3677 |
- // Constructor |
3678 |
- BTL_DONT_INLINE Action_parallel_qr_decomp( int size ) : _size(size) |
3679 |
- { |
3680 |
- MESSAGE("Action_parallel_qr_decomp Ctor"); |
3681 |
- |
3682 |
- int myid, procnum; |
3683 |
- blacs_pinfo_(&myid, &procnum); |
3684 |
- iamroot = (myid == 0); |
3685 |
- |
3686 |
- // STL matrix and vector initialization |
3687 |
- if (iamroot) { |
3688 |
- /* Using a constant seed */ |
3689 |
- const unsigned seed = 3; |
3690 |
- init_matrix(Global_A_stl, size, seed); |
3691 |
- } |
3692 |
- |
3693 |
- const int blocksize = std::max(std::min(size/4, 64), 2); |
3694 |
- scatter_matrix(Global_A_stl, Local_A_stl, desc, size, size, blocksize, blocksize); |
3695 |
- LocalRows = desc[8]; |
3696 |
- LocalCols = Local_A_stl.size()/desc[8]; |
3697 |
- |
3698 |
- // Generic local matrix and vectors initialization |
3699 |
- Interface::matrix_from_stl(Local_A , Local_A_stl); |
3700 |
- |
3701 |
- _cost = 2.0*size*size*size; |
3702 |
- } |
3703 |
- |
3704 |
- |
3705 |
- // Invalidate copy constructor |
3706 |
- Action_parallel_qr_decomp(const Action_parallel_qr_decomp&) |
3707 |
- { |
3708 |
- INFOS("illegal call to Action_parallel_qr_decomp copy constructor"); |
3709 |
- exit(1); |
3710 |
- } |
3711 |
- |
3712 |
- // Destructor |
3713 |
- ~Action_parallel_qr_decomp() |
3714 |
- { |
3715 |
- MESSAGE("Action_parallel_qr_decomp destructor"); |
3716 |
- |
3717 |
- // Deallocation |
3718 |
- Interface::free_matrix(Local_A , Local_A_stl.size()); |
3719 |
- } |
3720 |
- |
3721 |
- // Action name |
3722 |
- static inline std::string name() |
3723 |
- { |
3724 |
- return "qr_decomp_" + Interface::name(); |
3725 |
- } |
3726 |
- |
3727 |
- double nb_op_base() |
3728 |
- { |
3729 |
- return _cost; |
3730 |
- } |
3731 |
- |
3732 |
- BTL_DONT_INLINE void initialize() |
3733 |
- { |
3734 |
- } |
3735 |
- |
3736 |
- BTL_DONT_INLINE void calculate() |
3737 |
- { |
3738 |
- Interface::copy_matrix(&Local_A_stl[0], Local_A, Local_A_stl.size()); |
3739 |
- Interface::parallel_qr_decomp(Local_A, desc); |
3740 |
- } |
3741 |
- |
3742 |
- BTL_DONT_INLINE void check_result() |
3743 |
- { |
3744 |
- } |
3745 |
- |
3746 |
-private: |
3747 |
- int _size, desc[9], LocalRows, LocalCols; |
3748 |
- double _cost; |
3749 |
- bool iamroot; |
3750 |
- |
3751 |
- typename Interface::stl_matrix Global_A_stl; |
3752 |
- typename Interface::stl_matrix Local_A_stl; |
3753 |
- typename Interface::gene_matrix Local_A; |
3754 |
-}; |
3755 |
- |
3756 |
- |
3757 |
-#endif /* ACTION_PARALLEL_QR_DECOMP_HH_ */ |
3758 |
|
3759 |
diff --git a/btl/actions/action_parallel_svd_decomp.hh b/btl/actions/action_parallel_svd_decomp.hh |
3760 |
deleted file mode 100644 |
3761 |
index 3281886..0000000 |
3762 |
--- a/btl/actions/action_parallel_svd_decomp.hh |
3763 |
+++ /dev/null |
3764 |
@@ -1,151 +0,0 @@ |
3765 |
-//===================================================== |
3766 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
3767 |
-//===================================================== |
3768 |
-// |
3769 |
-// This program is free software; you can redistribute it and/or |
3770 |
-// modify it under the terms of the GNU General Public License |
3771 |
-// as published by the Free Software Foundation; either version 2 |
3772 |
-// of the License, or (at your option) any later version. |
3773 |
-// |
3774 |
-// This program is distributed in the hope that it will be useful, |
3775 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3776 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3777 |
-// GNU General Public License for more details. |
3778 |
-// You should have received a copy of the GNU General Public License |
3779 |
-// along with this program; if not, write to the Free Software |
3780 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3781 |
-// |
3782 |
-#ifndef ACTION_PARALLEL_SVD_DECOMP_HH_ |
3783 |
-#define ACTION_PARALLEL_SVD_DECOMP_HH_ |
3784 |
- |
3785 |
-#include "utilities.h" |
3786 |
-#include "init/init_function.hh" |
3787 |
-#include "init/init_vector.hh" |
3788 |
- |
3789 |
-#include "lapack_interface.hh" |
3790 |
-#include "STL_interface.hh" |
3791 |
- |
3792 |
-#include <string> |
3793 |
-#include <algorithm> |
3794 |
- |
3795 |
-template<class Interface> |
3796 |
-class Action_parallel_svd_decomp { |
3797 |
- |
3798 |
-public : |
3799 |
- |
3800 |
- // Constructor |
3801 |
- BTL_DONT_INLINE Action_parallel_svd_decomp( int size ) : _size(size) |
3802 |
- { |
3803 |
- MESSAGE("Action_parallel_svd_decomp Ctor"); |
3804 |
- |
3805 |
- int myid, procnum; |
3806 |
- blacs_pinfo_(&myid, &procnum); |
3807 |
- iamroot = (myid == 0); |
3808 |
- |
3809 |
- // STL matrix and vector initialization |
3810 |
- if (iamroot) { |
3811 |
- init_vector<pseudo_random>(Global_A_stl, size*size); |
3812 |
- init_vector<pseudo_random>(Global_U_stl, size*size); |
3813 |
- init_vector<pseudo_random>(Global_V_stl, size*size); |
3814 |
- } |
3815 |
- init_vector<null_function>(Local_s_stl, size); |
3816 |
- |
3817 |
- const int blocksize = std::max(std::min(size/4, 64), 2); |
3818 |
- Interface::scatter_matrix(Global_A_stl, Local_A_stl, descA, size, size, blocksize, blocksize); |
3819 |
- Interface::scatter_matrix(Global_U_stl, Local_U_stl, descU, size, size, blocksize, blocksize); |
3820 |
- Interface::scatter_matrix(Global_V_stl, Local_V_stl, descV, size, size, blocksize, blocksize); |
3821 |
- LocalRows = descA[8]; |
3822 |
- LocalCols = Local_A_stl.size()/descA[8]; |
3823 |
- |
3824 |
- // Generic local matrix and vectors initialization |
3825 |
- Interface::matrix_from_stl(Local_A_ref, Local_A_stl); |
3826 |
- Interface::matrix_from_stl(Local_A , Local_A_stl); |
3827 |
- Interface::matrix_from_stl(Local_U_ref, Local_U_stl); |
3828 |
- Interface::matrix_from_stl(Local_U , Local_U_stl); |
3829 |
- Interface::matrix_from_stl(Local_V_ref, Local_V_stl); |
3830 |
- Interface::matrix_from_stl(Local_V , Local_V_stl); |
3831 |
- Interface::vector_from_stl(Local_s_ref, Local_s_stl); |
3832 |
- Interface::vector_from_stl(Local_s , Local_s_stl); |
3833 |
- |
3834 |
- _cost = 2.0*size*size*size; |
3835 |
- } |
3836 |
- |
3837 |
- |
3838 |
- // Invalidate copy constructor |
3839 |
- Action_parallel_svd_decomp(const Action_parallel_svd_decomp&) |
3840 |
- { |
3841 |
- INFOS("illegal call to Action_parallel_svd_decomp copy constructor"); |
3842 |
- exit(1); |
3843 |
- } |
3844 |
- |
3845 |
- // Destructor |
3846 |
- ~Action_parallel_svd_decomp() |
3847 |
- { |
3848 |
- MESSAGE("Action_parallel_svd_decomp destructor"); |
3849 |
- |
3850 |
- // Deallocation |
3851 |
- Interface::free_matrix(Local_A_ref, Local_A_stl.size()); |
3852 |
- Interface::free_matrix(Local_A , Local_A_stl.size()); |
3853 |
- Interface::free_matrix(Local_U_ref, Local_U_stl.size()); |
3854 |
- Interface::free_matrix(Local_U , Local_U_stl.size()); |
3855 |
- Interface::free_matrix(Local_V_ref, Local_V_stl.size()); |
3856 |
- Interface::free_matrix(Local_V , Local_V_stl.size()); |
3857 |
- Interface::free_vector(Local_s_ref); |
3858 |
- Interface::free_vector(Local_s ); |
3859 |
- } |
3860 |
- |
3861 |
- // Action name |
3862 |
- static inline std::string name() |
3863 |
- { |
3864 |
- return "svd_decomp_" + Interface::name(); |
3865 |
- } |
3866 |
- |
3867 |
- double nb_op_base() |
3868 |
- { |
3869 |
- return _cost; |
3870 |
- } |
3871 |
- |
3872 |
- BTL_DONT_INLINE void initialize() |
3873 |
- { |
3874 |
- Interface::copy_matrix(Local_A_ref, Local_A, Local_A_stl.size()); |
3875 |
- Interface::copy_matrix(Local_U_ref, Local_U, Local_U_stl.size()); |
3876 |
- Interface::copy_matrix(Local_V_ref, Local_V, Local_V_stl.size()); |
3877 |
- Interface::copy_vector(Local_s_ref, Local_s, Local_s_stl.size()); |
3878 |
- } |
3879 |
- |
3880 |
- BTL_DONT_INLINE void calculate() |
3881 |
- { |
3882 |
- Interface::parallel_svd_decomp(Local_A, descA, Local_U, descU, Local_V, descV, Local_s); |
3883 |
- } |
3884 |
- |
3885 |
- BTL_DONT_INLINE void check_result() |
3886 |
- { |
3887 |
- } |
3888 |
- |
3889 |
-private: |
3890 |
- int _size, descA[9], descU[9], descV[9], LocalRows, LocalCols; |
3891 |
- double _cost; |
3892 |
- bool iamroot; |
3893 |
- |
3894 |
- typename Interface::stl_matrix Global_A_stl; |
3895 |
- typename Interface::stl_matrix Local_A_stl; |
3896 |
- typename Interface::gene_matrix Local_A_ref; |
3897 |
- typename Interface::gene_matrix Local_A; |
3898 |
- |
3899 |
- typename Interface::stl_matrix Global_U_stl; |
3900 |
- typename Interface::stl_matrix Local_U_stl; |
3901 |
- typename Interface::gene_matrix Local_U_ref; |
3902 |
- typename Interface::gene_matrix Local_U; |
3903 |
- |
3904 |
- typename Interface::stl_matrix Global_V_stl; |
3905 |
- typename Interface::stl_matrix Local_V_stl; |
3906 |
- typename Interface::gene_matrix Local_V_ref; |
3907 |
- typename Interface::gene_matrix Local_V; |
3908 |
- |
3909 |
- typename Interface::stl_vector Local_s_stl; |
3910 |
- typename Interface::gene_vector Local_s_ref; |
3911 |
- typename Interface::gene_vector Local_s; |
3912 |
-}; |
3913 |
- |
3914 |
- |
3915 |
-#endif /* ACTION_PARALLEL_SVD_DECOMP_HH */ |
3916 |
|
3917 |
diff --git a/btl/actions/action_parallel_symm_ev.hh b/btl/actions/action_parallel_symm_ev.hh |
3918 |
deleted file mode 100644 |
3919 |
index 85a1d13..0000000 |
3920 |
--- a/btl/actions/action_parallel_symm_ev.hh |
3921 |
+++ /dev/null |
3922 |
@@ -1,138 +0,0 @@ |
3923 |
-//===================================================== |
3924 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
3925 |
-//===================================================== |
3926 |
-// |
3927 |
-// This program is free software; you can redistribute it and/or |
3928 |
-// modify it under the terms of the GNU General Public License |
3929 |
-// as published by the Free Software Foundation; either version 2 |
3930 |
-// of the License, or (at your option) any later version. |
3931 |
-// |
3932 |
-// This program is distributed in the hope that it will be useful, |
3933 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3934 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3935 |
-// GNU General Public License for more details. |
3936 |
-// You should have received a copy of the GNU General Public License |
3937 |
-// along with this program; if not, write to the Free Software |
3938 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3939 |
-// |
3940 |
-#ifndef ACTION_PARALLEL_SYMM_EV_HH_ |
3941 |
-#define ACTION_PARALLEL_SYMM_EV_HH_ |
3942 |
- |
3943 |
-#include "utilities.h" |
3944 |
-#include "init/init_function.hh" |
3945 |
-#include "init/init_vector.hh" |
3946 |
- |
3947 |
-#include "lapack_interface.hh" |
3948 |
-#include "STL_interface.hh" |
3949 |
- |
3950 |
-#include <string> |
3951 |
- |
3952 |
-template<class Interface> |
3953 |
-class Action_parallel_symm_ev { |
3954 |
- |
3955 |
-public : |
3956 |
- |
3957 |
- // Constructor |
3958 |
- BTL_DONT_INLINE Action_parallel_symm_ev( int size ) : _size(size) |
3959 |
- { |
3960 |
- MESSAGE("Action_parallel_symm_ev constructor"); |
3961 |
- |
3962 |
- int myid, procnum; |
3963 |
- blacs_pinfo_(&myid, &procnum); |
3964 |
- iamroot = (myid == 0); |
3965 |
- |
3966 |
- // STL matrix and vector initialization |
3967 |
- if (iamroot) { |
3968 |
- init_vector<pseudo_random>(Global_A_stl, size*size); |
3969 |
- init_vector<null_function>(Global_Z_stl, size*size); |
3970 |
- } |
3971 |
- init_vector<null_function>(Local_w_stl, size); |
3972 |
- |
3973 |
- const int blocksize = std::max(std::min(size/4, 64), 2); |
3974 |
- Interface::scatter_matrix(Global_A_stl, Local_A_stl, descA, size, size, blocksize, blocksize); |
3975 |
- Interface::scatter_matrix(Global_Z_stl, Local_Z_stl, descZ, size, size, blocksize, blocksize); |
3976 |
- LocalRows = descA[8]; |
3977 |
- LocalCols = Local_A_stl.size()/descA[8]; |
3978 |
- |
3979 |
- // Generic local matrix and vectors initialization |
3980 |
- Interface::matrix_from_stl(Local_A_ref, Local_A_stl); |
3981 |
- Interface::matrix_from_stl(Local_A , Local_A_stl); |
3982 |
- Interface::matrix_from_stl(Local_Z_ref, Local_Z_stl); |
3983 |
- Interface::matrix_from_stl(Local_Z , Local_Z_stl); |
3984 |
- Interface::vector_from_stl(Local_w , Local_w_stl); |
3985 |
- Interface::vector_from_stl(Local_w_ref, Local_w_stl); |
3986 |
- |
3987 |
- _cost = size*size*size; |
3988 |
- } |
3989 |
- |
3990 |
- |
3991 |
- // Invalidate copy constructor |
3992 |
- Action_parallel_symm_ev(const Action_parallel_symm_ev&) |
3993 |
- { |
3994 |
- INFOS("illegal call to Action_parallel_symm_ev copy constructor"); |
3995 |
- exit(1); |
3996 |
- } |
3997 |
- |
3998 |
- // Destructor |
3999 |
- ~Action_parallel_symm_ev() |
4000 |
- { |
4001 |
- MESSAGE("Action_parallel_symm_ev destructor"); |
4002 |
- |
4003 |
- // Deallocation |
4004 |
- Interface::free_matrix(Local_A_ref, Local_A_stl.size()); |
4005 |
- Interface::free_matrix(Local_A , Local_A_stl.size()); |
4006 |
- Interface::free_matrix(Local_Z_ref, Local_Z_stl.size()); |
4007 |
- Interface::free_matrix(Local_Z , Local_Z_stl.size()); |
4008 |
- Interface::free_vector(Local_w_ref); |
4009 |
- Interface::free_vector(Local_w ); |
4010 |
- } |
4011 |
- |
4012 |
- // Action name |
4013 |
- static inline std::string name() |
4014 |
- { |
4015 |
- return "symm_ev_" + Interface::name(); |
4016 |
- } |
4017 |
- |
4018 |
- double nb_op_base() |
4019 |
- { |
4020 |
- return _cost; |
4021 |
- } |
4022 |
- |
4023 |
- BTL_DONT_INLINE void initialize() |
4024 |
- { |
4025 |
- Interface::copy_matrix(Local_A_ref, Local_A, Local_A_stl.size()); |
4026 |
- Interface::copy_matrix(Local_Z_ref, Local_Z, Local_Z_stl.size()); |
4027 |
- Interface::copy_vector(Local_w_ref, Local_w, Local_w_stl.size()); |
4028 |
- } |
4029 |
- |
4030 |
- BTL_DONT_INLINE void calculate() |
4031 |
- { |
4032 |
- Interface::parallel_symm_ev(Local_A, descA, Local_w, Local_Z, descZ); |
4033 |
- } |
4034 |
- |
4035 |
- BTL_DONT_INLINE void check_result() |
4036 |
- { |
4037 |
- } |
4038 |
- |
4039 |
-private: |
4040 |
- int _size, descA[9], descZ[9], LocalRows, LocalCols; |
4041 |
- double _cost; |
4042 |
- bool iamroot; |
4043 |
- |
4044 |
- typename Interface::stl_matrix Global_A_stl; |
4045 |
- typename Interface::stl_matrix Local_A_stl; |
4046 |
- typename Interface::gene_matrix Local_A_ref; |
4047 |
- typename Interface::gene_matrix Local_A; |
4048 |
- |
4049 |
- typename Interface::stl_matrix Global_Z_stl; |
4050 |
- typename Interface::stl_matrix Local_Z_stl; |
4051 |
- typename Interface::gene_matrix Local_Z_ref; |
4052 |
- typename Interface::gene_matrix Local_Z; |
4053 |
- |
4054 |
- typename Interface::stl_vector Local_w_stl; |
4055 |
- typename Interface::gene_vector Local_w_ref; |
4056 |
- typename Interface::gene_vector Local_w; |
4057 |
-}; |
4058 |
- |
4059 |
- |
4060 |
-#endif /* ACTION_PARALLEL_SYMM_EV_HH_ */ |
4061 |
|
4062 |
diff --git a/btl/actions/action_partial_lu.hh b/btl/actions/action_partial_lu.hh |
4063 |
deleted file mode 100644 |
4064 |
index 770ea1d..0000000 |
4065 |
--- a/btl/actions/action_partial_lu.hh |
4066 |
+++ /dev/null |
4067 |
@@ -1,125 +0,0 @@ |
4068 |
-//===================================================== |
4069 |
-// File : action_lu_decomp.hh |
4070 |
-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@×××××.fr> |
4071 |
-//===================================================== |
4072 |
-// |
4073 |
-// This program is free software; you can redistribute it and/or |
4074 |
-// modify it under the terms of the GNU General Public License |
4075 |
-// as published by the Free Software Foundation; either version 2 |
4076 |
-// of the License, or (at your option) any later version. |
4077 |
-// |
4078 |
-// This program is distributed in the hope that it will be useful, |
4079 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4080 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4081 |
-// GNU General Public License for more details. |
4082 |
-// You should have received a copy of the GNU General Public License |
4083 |
-// along with this program; if not, write to the Free Software |
4084 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4085 |
-// |
4086 |
-#ifndef ACTION_PARTIAL_LU |
4087 |
-#define ACTION_PARTIAL_LU |
4088 |
-#include "utilities.h" |
4089 |
-#include "STL_interface.hh" |
4090 |
-#include <string> |
4091 |
-#include "init/init_function.hh" |
4092 |
-#include "init/init_vector.hh" |
4093 |
-#include "init/init_matrix.hh" |
4094 |
- |
4095 |
-using namespace std; |
4096 |
- |
4097 |
-template<class Interface> |
4098 |
-class Action_partial_lu { |
4099 |
- |
4100 |
-public : |
4101 |
- |
4102 |
- // Ctor |
4103 |
- |
4104 |
- Action_partial_lu( int size ):_size(size) |
4105 |
- { |
4106 |
- MESSAGE("Action_partial_lu Ctor"); |
4107 |
- |
4108 |
- // STL vector initialization |
4109 |
- init_matrix<pseudo_random>(X_stl,_size); |
4110 |
- init_matrix<null_function>(C_stl,_size); |
4111 |
- |
4112 |
- // make sure X is invertible |
4113 |
- for (int i=0; i<_size; ++i) |
4114 |
- X_stl[i][i] = X_stl[i][i] * 1e2 + 1; |
4115 |
- |
4116 |
- // generic matrix and vector initialization |
4117 |
- Interface::matrix_from_stl(X_ref,X_stl); |
4118 |
- Interface::matrix_from_stl(X,X_stl); |
4119 |
- Interface::matrix_from_stl(C,C_stl); |
4120 |
- |
4121 |
- _cost = 2.0*size*size*size/3.0 + size*size; |
4122 |
- } |
4123 |
- |
4124 |
- // invalidate copy ctor |
4125 |
- |
4126 |
- Action_partial_lu( const Action_partial_lu & ) |
4127 |
- { |
4128 |
- INFOS("illegal call to Action_partial_lu Copy Ctor"); |
4129 |
- exit(1); |
4130 |
- } |
4131 |
- |
4132 |
- // Dtor |
4133 |
- |
4134 |
- ~Action_partial_lu( void ){ |
4135 |
- |
4136 |
- MESSAGE("Action_partial_lu Dtor"); |
4137 |
- |
4138 |
- // deallocation |
4139 |
- Interface::free_matrix(X_ref,_size); |
4140 |
- Interface::free_matrix(X,_size); |
4141 |
- Interface::free_matrix(C,_size); |
4142 |
- } |
4143 |
- |
4144 |
- // action name |
4145 |
- |
4146 |
- static inline std::string name( void ) |
4147 |
- { |
4148 |
- return "partial_lu_decomp_"+Interface::name(); |
4149 |
- } |
4150 |
- |
4151 |
- double nb_op_base( void ){ |
4152 |
- return _cost; |
4153 |
- } |
4154 |
- |
4155 |
- inline void initialize( void ){ |
4156 |
- Interface::copy_matrix(X_ref,X,_size); |
4157 |
- } |
4158 |
- |
4159 |
- inline void calculate( void ) { |
4160 |
- Interface::partial_lu_decomp(X,C,_size); |
4161 |
- } |
4162 |
- |
4163 |
- void check_result( void ){ |
4164 |
- // calculation check |
4165 |
-// Interface::matrix_to_stl(C,resu_stl); |
4166 |
- |
4167 |
-// STL_interface<typename Interface::real_type>::lu_decomp(X_stl,C_stl,_size); |
4168 |
-// |
4169 |
-// typename Interface::real_type error= |
4170 |
-// STL_interface<typename Interface::real_type>::norm_diff(C_stl,resu_stl); |
4171 |
-// |
4172 |
-// if (error>1.e-6){ |
4173 |
-// INFOS("WRONG CALCULATION...residual=" << error); |
4174 |
-// exit(0); |
4175 |
-// } |
4176 |
- |
4177 |
- } |
4178 |
- |
4179 |
-private : |
4180 |
- |
4181 |
- typename Interface::stl_matrix X_stl; |
4182 |
- typename Interface::stl_matrix C_stl; |
4183 |
- |
4184 |
- typename Interface::gene_matrix X_ref; |
4185 |
- typename Interface::gene_matrix X; |
4186 |
- typename Interface::gene_matrix C; |
4187 |
- |
4188 |
- int _size; |
4189 |
- double _cost; |
4190 |
-}; |
4191 |
- |
4192 |
-#endif |
4193 |
|
4194 |
diff --git a/btl/actions/action_qr_decomp.hh b/btl/actions/action_qr_decomp.hh |
4195 |
deleted file mode 100644 |
4196 |
index 15a4619..0000000 |
4197 |
--- a/btl/actions/action_qr_decomp.hh |
4198 |
+++ /dev/null |
4199 |
@@ -1,112 +0,0 @@ |
4200 |
-//===================================================== |
4201 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
4202 |
-//===================================================== |
4203 |
-// |
4204 |
-// This program is free software; you can redistribute it and/or |
4205 |
-// modify it under the terms of the GNU General Public License |
4206 |
-// as published by the Free Software Foundation; either version 2 |
4207 |
-// of the License, or (at your option) any later version. |
4208 |
-// |
4209 |
-// This program is distributed in the hope that it will be useful, |
4210 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4211 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4212 |
-// GNU General Public License for more details. |
4213 |
-// You should have received a copy of the GNU General Public License |
4214 |
-// along with this program; if not, write to the Free Software |
4215 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4216 |
-// |
4217 |
-#ifndef ACTION_QR_DECOMP |
4218 |
-#define ACTION_QR_DECOMP |
4219 |
-#include "utilities.h" |
4220 |
-#include "STL_interface.hh" |
4221 |
-#include <string> |
4222 |
-#include "init/init_function.hh" |
4223 |
-#include "init/init_vector.hh" |
4224 |
-#include "init/init_matrix.hh" |
4225 |
- |
4226 |
-using namespace std; |
4227 |
- |
4228 |
-template<class Interface> |
4229 |
-class Action_qr_decomp { |
4230 |
- |
4231 |
-public : |
4232 |
- |
4233 |
- // Ctor |
4234 |
- |
4235 |
- Action_qr_decomp( int size ) : _size(size) |
4236 |
- { |
4237 |
- MESSAGE("Action_qr_decomp Ctor"); |
4238 |
- |
4239 |
- // STL vector initialization |
4240 |
- init_matrix<pseudo_random>(X_stl ,_size); |
4241 |
- init_matrix<null_function>(C_stl, _size); |
4242 |
- init_vector<null_function>(tau_stl, _size); |
4243 |
- |
4244 |
- // generic matrix and vector initialization |
4245 |
- Interface::matrix_from_stl(X_ref, X_stl); |
4246 |
- Interface::matrix_from_stl(X, X_stl); |
4247 |
- Interface::matrix_from_stl(C, C_stl); |
4248 |
- Interface::vector_from_stl(tau, tau_stl); |
4249 |
- |
4250 |
- _cost = 2.0*size*size*size/3.0 + size*size + 1.0*size/3.0 - 2; |
4251 |
- } |
4252 |
- |
4253 |
- // invalidate copy ctor |
4254 |
- |
4255 |
- Action_qr_decomp( const Action_qr_decomp & ) |
4256 |
- { |
4257 |
- INFOS("illegal call to Action_qr_decomp Copy Ctor"); |
4258 |
- exit(1); |
4259 |
- } |
4260 |
- |
4261 |
- // Dtor |
4262 |
- |
4263 |
- ~Action_qr_decomp( void ){ |
4264 |
- |
4265 |
- MESSAGE("Action_qr_decomp Dtor"); |
4266 |
- |
4267 |
- // deallocation |
4268 |
- Interface::free_matrix(X_ref, _size); |
4269 |
- Interface::free_matrix(X, _size); |
4270 |
- Interface::free_matrix(C, _size); |
4271 |
- Interface::free_vector(tau); |
4272 |
- } |
4273 |
- |
4274 |
- // action name |
4275 |
- |
4276 |
- static inline std::string name() |
4277 |
- { |
4278 |
- return "qr_decomp_"+Interface::name(); |
4279 |
- } |
4280 |
- |
4281 |
- double nb_op_base( void ){ |
4282 |
- return _cost; |
4283 |
- } |
4284 |
- |
4285 |
- inline void initialize( void ){ |
4286 |
- Interface::copy_matrix(X_ref, X, _size); |
4287 |
- } |
4288 |
- |
4289 |
- inline void calculate( void ) { |
4290 |
- Interface::qr_decomp(X, C, tau, _size); |
4291 |
- } |
4292 |
- |
4293 |
- void check_result( void ){ |
4294 |
- } |
4295 |
- |
4296 |
-private : |
4297 |
- |
4298 |
- typename Interface::stl_matrix X_stl; |
4299 |
- typename Interface::stl_matrix C_stl; |
4300 |
- typename Interface::stl_vector tau_stl; |
4301 |
- |
4302 |
- typename Interface::gene_matrix X_ref; |
4303 |
- typename Interface::gene_matrix X; |
4304 |
- typename Interface::gene_matrix C; |
4305 |
- typename Interface::gene_vector tau; |
4306 |
- |
4307 |
- int _size; |
4308 |
- double _cost; |
4309 |
-}; |
4310 |
- |
4311 |
-#endif |
4312 |
|
4313 |
diff --git a/btl/actions/action_rot.hh b/btl/actions/action_rot.hh |
4314 |
deleted file mode 100644 |
4315 |
index df822a6..0000000 |
4316 |
--- a/btl/actions/action_rot.hh |
4317 |
+++ /dev/null |
4318 |
@@ -1,116 +0,0 @@ |
4319 |
- |
4320 |
-// This program is free software; you can redistribute it and/or |
4321 |
-// modify it under the terms of the GNU General Public License |
4322 |
-// as published by the Free Software Foundation; either version 2 |
4323 |
-// of the License, or (at your option) any later version. |
4324 |
-// |
4325 |
-// This program is distributed in the hope that it will be useful, |
4326 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4327 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4328 |
-// GNU General Public License for more details. |
4329 |
-// You should have received a copy of the GNU General Public License |
4330 |
-// along with this program; if not, write to the Free Software |
4331 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4332 |
-// |
4333 |
-#ifndef ACTION_ROT |
4334 |
-#define ACTION_ROT |
4335 |
-#include "utilities.h" |
4336 |
-#include "STL_interface.hh" |
4337 |
-#include <string> |
4338 |
-#include "init/init_function.hh" |
4339 |
-#include "init/init_vector.hh" |
4340 |
-#include "init/init_matrix.hh" |
4341 |
- |
4342 |
-using namespace std; |
4343 |
- |
4344 |
-template<class Interface> |
4345 |
-class Action_rot { |
4346 |
- |
4347 |
-public : |
4348 |
- |
4349 |
- // Ctor |
4350 |
- BTL_DONT_INLINE Action_rot( int size ):_size(size) |
4351 |
- { |
4352 |
- MESSAGE("Action_rot Ctor"); |
4353 |
- |
4354 |
- // STL matrix and vector initialization |
4355 |
- typename Interface::stl_matrix tmp; |
4356 |
- init_vector<pseudo_random>(A_stl,_size); |
4357 |
- init_vector<pseudo_random>(B_stl,_size); |
4358 |
- |
4359 |
- // generic matrix and vector initialization |
4360 |
- Interface::vector_from_stl(A_ref,A_stl); |
4361 |
- Interface::vector_from_stl(A,A_stl); |
4362 |
- Interface::vector_from_stl(B_ref,B_stl); |
4363 |
- Interface::vector_from_stl(B,B_stl); |
4364 |
- } |
4365 |
- |
4366 |
- // invalidate copy ctor |
4367 |
- Action_rot( const Action_rot & ) |
4368 |
- { |
4369 |
- INFOS("illegal call to Action_rot Copy Ctor"); |
4370 |
- exit(1); |
4371 |
- } |
4372 |
- |
4373 |
- // Dtor |
4374 |
- BTL_DONT_INLINE ~Action_rot( void ){ |
4375 |
- MESSAGE("Action_rot Dtor"); |
4376 |
- Interface::free_vector(A); |
4377 |
- Interface::free_vector(B); |
4378 |
- Interface::free_vector(A_ref); |
4379 |
- Interface::free_vector(B_ref); |
4380 |
- } |
4381 |
- |
4382 |
- // action name |
4383 |
- static inline std::string name( void ) |
4384 |
- { |
4385 |
- return "rot_" + Interface::name(); |
4386 |
- } |
4387 |
- |
4388 |
- double nb_op_base( void ){ |
4389 |
- return 6.0*_size; |
4390 |
- } |
4391 |
- |
4392 |
- BTL_DONT_INLINE void initialize( void ){ |
4393 |
- Interface::copy_vector(A_ref,A,_size); |
4394 |
- Interface::copy_vector(B_ref,B,_size); |
4395 |
- } |
4396 |
- |
4397 |
- BTL_DONT_INLINE void calculate( void ) { |
4398 |
- BTL_ASM_COMMENT("#begin rot"); |
4399 |
- Interface::rot(A,B,0.5,0.6,_size); |
4400 |
- BTL_ASM_COMMENT("end rot"); |
4401 |
- } |
4402 |
- |
4403 |
- BTL_DONT_INLINE void check_result( void ){ |
4404 |
- // calculation check |
4405 |
-// Interface::vector_to_stl(X,resu_stl); |
4406 |
- |
4407 |
-// STL_interface<typename Interface::real_type>::rot(A_stl,B_stl,X_stl,_size); |
4408 |
- |
4409 |
-// typename Interface::real_type error= |
4410 |
-// STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
4411 |
- |
4412 |
-// if (error>1.e-3){ |
4413 |
-// INFOS("WRONG CALCULATION...residual=" << error); |
4414 |
-// exit(0); |
4415 |
-// } |
4416 |
- |
4417 |
- } |
4418 |
- |
4419 |
-private : |
4420 |
- |
4421 |
- typename Interface::stl_vector A_stl; |
4422 |
- typename Interface::stl_vector B_stl; |
4423 |
- |
4424 |
- typename Interface::gene_vector A_ref; |
4425 |
- typename Interface::gene_vector B_ref; |
4426 |
- |
4427 |
- typename Interface::gene_vector A; |
4428 |
- typename Interface::gene_vector B; |
4429 |
- |
4430 |
- int _size; |
4431 |
-}; |
4432 |
- |
4433 |
- |
4434 |
-#endif |
4435 |
|
4436 |
diff --git a/btl/actions/action_rot.hpp b/btl/actions/action_rot.hpp |
4437 |
new file mode 100644 |
4438 |
index 0000000..93cba4e |
4439 |
--- /dev/null |
4440 |
+++ b/btl/actions/action_rot.hpp |
4441 |
@@ -0,0 +1,78 @@ |
4442 |
+//===================================================== |
4443 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
4444 |
+//===================================================== |
4445 |
+// |
4446 |
+// This program is free software; you can redistribute it and/or |
4447 |
+// modify it under the terms of the GNU General Public License |
4448 |
+// as published by the Free Software Foundation; either version 2 |
4449 |
+// of the License, or (at your option) any later version. |
4450 |
+// |
4451 |
+// This program is distributed in the hope that it will be useful, |
4452 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4453 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4454 |
+// GNU General Public License for more details. |
4455 |
+// You should have received a copy of the GNU General Public License |
4456 |
+// along with this program; if not, write to the Free Software |
4457 |
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4458 |
+// |
4459 |
+#ifndef ACTION_ROT |
4460 |
+#define ACTION_ROT |
4461 |
+ |
4462 |
+#include "LinearCongruential.hpp" |
4463 |
+#include <vector> |
4464 |
+#include <algorithm> |
4465 |
+ |
4466 |
+template<class Interface> |
4467 |
+class Action_rot { |
4468 |
+ |
4469 |
+ typedef typename Interface::Scalar Scalar; |
4470 |
+ typedef std::vector<Scalar> vector_t; |
4471 |
+ |
4472 |
+private: |
4473 |
+ // Invalidate copy constructor |
4474 |
+ Action_rot(const Action_rot&); |
4475 |
+ |
4476 |
+public: |
4477 |
+ |
4478 |
+ // Constructor |
4479 |
+ Action_rot(int size) |
4480 |
+ : _size(size), lc(10), |
4481 |
+ x(lc.fillVector<Scalar>(size)), y(lc.fillVector<Scalar>(size)), |
4482 |
+ x_work(size), y_work(size) |
4483 |
+ { |
4484 |
+ MESSAGE("Action_rot Constructor"); |
4485 |
+ } |
4486 |
+ |
4487 |
+ // Action name |
4488 |
+ static std::string name() |
4489 |
+ { |
4490 |
+ return "rot_" + Interface::name(); |
4491 |
+ } |
4492 |
+ |
4493 |
+ double fpo() { |
4494 |
+ return 2*double(_size); |
4495 |
+ } |
4496 |
+ |
4497 |
+ inline void initialize(){ |
4498 |
+ std::copy(x.begin(), x.end(), x_work.begin()); |
4499 |
+ std::copy(y.begin(), y.end(), y_work.begin()); |
4500 |
+ } |
4501 |
+ |
4502 |
+ inline void calculate() { |
4503 |
+ Interface::rot(_size, &x_work[0], &y_work[0], 0.5, 0.6); |
4504 |
+ } |
4505 |
+ |
4506 |
+ Scalar getResidual() { |
4507 |
+ return 0.; |
4508 |
+ } |
4509 |
+ |
4510 |
+private: |
4511 |
+ const int _size; |
4512 |
+ LinearCongruential<> lc; |
4513 |
+ |
4514 |
+ const vector_t x, y; |
4515 |
+ vector_t x_work, y_work; |
4516 |
+ |
4517 |
+}; |
4518 |
+ |
4519 |
+#endif // ACTION_AXPY |
4520 |
|
4521 |
diff --git a/btl/actions/action_stev.hh b/btl/actions/action_stev.hh |
4522 |
deleted file mode 100644 |
4523 |
index e564571..0000000 |
4524 |
--- a/btl/actions/action_stev.hh |
4525 |
+++ /dev/null |
4526 |
@@ -1,119 +0,0 @@ |
4527 |
-//===================================================== |
4528 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
4529 |
-//===================================================== |
4530 |
-// |
4531 |
-// This program is free software; you can redistribute it and/or |
4532 |
-// modify it under the terms of the GNU General Public License |
4533 |
-// as published by the Free Software Foundation; either version 2 |
4534 |
-// of the License, or (at your option) any later version. |
4535 |
-// |
4536 |
-// This program is distributed in the hope that it will be useful, |
4537 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4538 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4539 |
-// GNU General Public License for more details. |
4540 |
-// You should have received a copy of the GNU General Public License |
4541 |
-// along with this program; if not, write to the Free Software |
4542 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4543 |
-// |
4544 |
-#ifndef ACTION_STEV |
4545 |
-#define ACTION_STEV |
4546 |
-#include "utilities.h" |
4547 |
-#include "STL_interface.hh" |
4548 |
-#include <string> |
4549 |
-#include "init/init_function.hh" |
4550 |
-#include "init/init_vector.hh" |
4551 |
-#include "init/init_matrix.hh" |
4552 |
- |
4553 |
-using namespace std; |
4554 |
- |
4555 |
-template<class Interface> |
4556 |
-class Action_stev { |
4557 |
- |
4558 |
-public : |
4559 |
- |
4560 |
- // Ctor |
4561 |
- |
4562 |
- Action_stev( int size ) : _size(size) |
4563 |
- { |
4564 |
- MESSAGE("Action_stev Ctor"); |
4565 |
- |
4566 |
- // STL vector initialization |
4567 |
- init_vector<pseudo_random>(D_stl, _size); |
4568 |
- init_vector<pseudo_random>(E_stl, max(0, _size-1)); |
4569 |
- init_matrix<null_function>(V_stl, _size); |
4570 |
- init_vector<null_function>(W_stl, _size); |
4571 |
- |
4572 |
- // generic matrix and vector initialization |
4573 |
- Interface::vector_from_stl(D_ref, D_stl); |
4574 |
- Interface::vector_from_stl(E_ref, E_stl); |
4575 |
- Interface::vector_from_stl(D, D_stl); |
4576 |
- Interface::vector_from_stl(E, E_stl); |
4577 |
- Interface::matrix_from_stl(V, V_stl); |
4578 |
- Interface::vector_from_stl(W, W_stl); |
4579 |
- |
4580 |
- // FIXME: correct? |
4581 |
- _cost = size*size*size; |
4582 |
- } |
4583 |
- |
4584 |
- // invalidate copy ctor |
4585 |
- |
4586 |
- Action_stev( const Action_stev& ) |
4587 |
- { |
4588 |
- INFOS("illegal call to Action_stev Copy Ctor"); |
4589 |
- exit(1); |
4590 |
- } |
4591 |
- |
4592 |
- // Dtor |
4593 |
- |
4594 |
- ~Action_stev( void ){ |
4595 |
- |
4596 |
- MESSAGE("Action_stev Dtor"); |
4597 |
- |
4598 |
- // deallocation |
4599 |
- Interface::free_vector(D_ref); |
4600 |
- Interface::free_vector(E_ref); |
4601 |
- Interface::free_vector(D); |
4602 |
- Interface::free_vector(E); |
4603 |
- Interface::free_matrix(V, _size); |
4604 |
- Interface::free_vector(W); |
4605 |
- } |
4606 |
- |
4607 |
- // action name |
4608 |
- |
4609 |
- static inline std::string name() |
4610 |
- { |
4611 |
- return "stev_"+Interface::name(); |
4612 |
- } |
4613 |
- |
4614 |
- double nb_op_base( void ){ |
4615 |
- return _cost; |
4616 |
- } |
4617 |
- |
4618 |
- inline void initialize( void ){ |
4619 |
- Interface::copy_vector(D_ref, D, _size); |
4620 |
- Interface::copy_vector(E_ref, E, _size-1); |
4621 |
- } |
4622 |
- |
4623 |
- inline void calculate( void ) { |
4624 |
- Interface::stev(D, E, W, V, _size); |
4625 |
- } |
4626 |
- |
4627 |
- void check_result( void ){ |
4628 |
- } |
4629 |
- |
4630 |
-private : |
4631 |
- |
4632 |
- typename Interface::stl_vector D_stl, E_stl; |
4633 |
- typename Interface::stl_matrix V_stl; |
4634 |
- typename Interface::stl_vector W_stl; |
4635 |
- |
4636 |
- typename Interface::gene_vector D_ref, E_ref; |
4637 |
- typename Interface::gene_vector D, E; |
4638 |
- typename Interface::gene_matrix V; |
4639 |
- typename Interface::gene_vector W; |
4640 |
- |
4641 |
- int _size; |
4642 |
- double _cost; |
4643 |
-}; |
4644 |
- |
4645 |
-#endif |
4646 |
|
4647 |
diff --git a/btl/actions/action_svd_decomp.hh b/btl/actions/action_svd_decomp.hh |
4648 |
deleted file mode 100644 |
4649 |
index be6740a..0000000 |
4650 |
--- a/btl/actions/action_svd_decomp.hh |
4651 |
+++ /dev/null |
4652 |
@@ -1,115 +0,0 @@ |
4653 |
-//===================================================== |
4654 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
4655 |
-//===================================================== |
4656 |
-// |
4657 |
-// This program is free software; you can redistribute it and/or |
4658 |
-// modify it under the terms of the GNU General Public License |
4659 |
-// as published by the Free Software Foundation; either version 2 |
4660 |
-// of the License, or (at your option) any later version. |
4661 |
-// |
4662 |
-// This program is distributed in the hope that it will be useful, |
4663 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4664 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4665 |
-// GNU General Public License for more details. |
4666 |
-// You should have received a copy of the GNU General Public License |
4667 |
-// along with this program; if not, write to the Free Software |
4668 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4669 |
-// |
4670 |
-#ifndef ACTION_SVD_DECOMP |
4671 |
-#define ACTION_SVD_DECOMP |
4672 |
-#include "utilities.h" |
4673 |
-#include "STL_interface.hh" |
4674 |
-#include <string> |
4675 |
-#include "init/init_function.hh" |
4676 |
-#include "init/init_vector.hh" |
4677 |
-#include "init/init_matrix.hh" |
4678 |
- |
4679 |
-using namespace std; |
4680 |
- |
4681 |
-template<class Interface> |
4682 |
-class Action_svd_decomp { |
4683 |
- |
4684 |
-public : |
4685 |
- |
4686 |
- // Ctor |
4687 |
- |
4688 |
- Action_svd_decomp( int size ) : _size(size) |
4689 |
- { |
4690 |
- MESSAGE("Action_svd_decomp Ctor"); |
4691 |
- |
4692 |
- // STL vector initialization |
4693 |
- init_matrix<pseudo_random>(X_stl ,_size); |
4694 |
- init_matrix<null_function>(U_stl, _size); |
4695 |
- init_matrix<null_function>(VT_stl, _size); |
4696 |
- init_vector<null_function>(S_stl, _size); |
4697 |
- |
4698 |
- // generic matrix and vector initialization |
4699 |
- Interface::matrix_from_stl(X_ref, X_stl); |
4700 |
- Interface::matrix_from_stl(X, X_stl); |
4701 |
- Interface::matrix_from_stl(U, U_stl); |
4702 |
- Interface::matrix_from_stl(VT, VT_stl); |
4703 |
- Interface::vector_from_stl(S, S_stl); |
4704 |
- |
4705 |
- _cost = 4*size*size*size; |
4706 |
- } |
4707 |
- |
4708 |
- // invalidate copy ctor |
4709 |
- |
4710 |
- Action_svd_decomp( const Action_svd_decomp & ) |
4711 |
- { |
4712 |
- INFOS("illegal call to Action_svd_decomp Copy Ctor"); |
4713 |
- exit(1); |
4714 |
- } |
4715 |
- |
4716 |
- // Dtor |
4717 |
- |
4718 |
- ~Action_svd_decomp( void ){ |
4719 |
- |
4720 |
- MESSAGE("Action_svd_decomp Dtor"); |
4721 |
- |
4722 |
- // deallocation |
4723 |
- Interface::free_matrix(X_ref, _size); |
4724 |
- Interface::free_matrix(X, _size); |
4725 |
- Interface::free_matrix(U, _size); |
4726 |
- Interface::free_matrix(VT, _size); |
4727 |
- Interface::free_vector(S); |
4728 |
- } |
4729 |
- |
4730 |
- // action name |
4731 |
- |
4732 |
- static inline std::string name() |
4733 |
- { |
4734 |
- return "svd_decomp_"+Interface::name(); |
4735 |
- } |
4736 |
- |
4737 |
- double nb_op_base( void ){ |
4738 |
- return _cost; |
4739 |
- } |
4740 |
- |
4741 |
- inline void initialize( void ){ |
4742 |
- Interface::copy_matrix(X_ref, X, _size); |
4743 |
- } |
4744 |
- |
4745 |
- inline void calculate( void ) { |
4746 |
- Interface::svd_decomp(X, U, S, VT, _size); |
4747 |
- } |
4748 |
- |
4749 |
- void check_result( void ){ |
4750 |
- } |
4751 |
- |
4752 |
-private : |
4753 |
- |
4754 |
- typename Interface::stl_matrix X_stl; |
4755 |
- typename Interface::stl_matrix U_stl, VT_stl; |
4756 |
- typename Interface::stl_vector S_stl; |
4757 |
- |
4758 |
- typename Interface::gene_matrix X_ref; |
4759 |
- typename Interface::gene_matrix X; |
4760 |
- typename Interface::gene_matrix U, VT; |
4761 |
- typename Interface::gene_vector S; |
4762 |
- |
4763 |
- int _size; |
4764 |
- double _cost; |
4765 |
-}; |
4766 |
- |
4767 |
-#endif |
4768 |
|
4769 |
diff --git a/btl/actions/action_syev.hh b/btl/actions/action_syev.hh |
4770 |
deleted file mode 100644 |
4771 |
index b8f33be..0000000 |
4772 |
--- a/btl/actions/action_syev.hh |
4773 |
+++ /dev/null |
4774 |
@@ -1,113 +0,0 @@ |
4775 |
-//===================================================== |
4776 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
4777 |
-//===================================================== |
4778 |
-// |
4779 |
-// This program is free software; you can redistribute it and/or |
4780 |
-// modify it under the terms of the GNU General Public License |
4781 |
-// as published by the Free Software Foundation; either version 2 |
4782 |
-// of the License, or (at your option) any later version. |
4783 |
-// |
4784 |
-// This program is distributed in the hope that it will be useful, |
4785 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4786 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4787 |
-// GNU General Public License for more details. |
4788 |
-// You should have received a copy of the GNU General Public License |
4789 |
-// along with this program; if not, write to the Free Software |
4790 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4791 |
-// |
4792 |
-#ifndef ACTION_SYEV |
4793 |
-#define ACTION_SYEV |
4794 |
-#include "utilities.h" |
4795 |
-#include "STL_interface.hh" |
4796 |
-#include <string> |
4797 |
-#include "init/init_function.hh" |
4798 |
-#include "init/init_vector.hh" |
4799 |
-#include "init/init_matrix.hh" |
4800 |
- |
4801 |
-using namespace std; |
4802 |
- |
4803 |
-template<class Interface> |
4804 |
-class Action_syev { |
4805 |
- |
4806 |
-public : |
4807 |
- |
4808 |
- // Ctor |
4809 |
- |
4810 |
- Action_syev( int size ) : _size(size) |
4811 |
- { |
4812 |
- MESSAGE("Action_syev Ctor"); |
4813 |
- |
4814 |
- // STL vector initialization |
4815 |
- init_matrix_symm<pseudo_random>(X_stl ,_size); |
4816 |
- init_matrix<null_function>(V_stl, _size); |
4817 |
- init_vector<null_function>(W_stl, _size); |
4818 |
- |
4819 |
- // generic matrix and vector initialization |
4820 |
- Interface::matrix_from_stl(X_ref, X_stl); |
4821 |
- Interface::matrix_from_stl(X, X_stl); |
4822 |
- Interface::matrix_from_stl(V, V_stl); |
4823 |
- Interface::vector_from_stl(W, W_stl); |
4824 |
- |
4825 |
- // FIXME: correct? |
4826 |
- _cost = size*size*size; |
4827 |
- } |
4828 |
- |
4829 |
- // invalidate copy ctor |
4830 |
- |
4831 |
- Action_syev( const Action_syev& ) |
4832 |
- { |
4833 |
- INFOS("illegal call to Action_syev Copy Ctor"); |
4834 |
- exit(1); |
4835 |
- } |
4836 |
- |
4837 |
- // Dtor |
4838 |
- |
4839 |
- ~Action_syev( void ){ |
4840 |
- |
4841 |
- MESSAGE("Action_syev Dtor"); |
4842 |
- |
4843 |
- // deallocation |
4844 |
- Interface::free_matrix(X_ref, _size); |
4845 |
- Interface::free_matrix(X, _size); |
4846 |
- Interface::free_matrix(V, _size); |
4847 |
- Interface::free_vector(W); |
4848 |
- } |
4849 |
- |
4850 |
- // action name |
4851 |
- |
4852 |
- static inline std::string name() |
4853 |
- { |
4854 |
- return "syev_"+Interface::name(); |
4855 |
- } |
4856 |
- |
4857 |
- double nb_op_base( void ){ |
4858 |
- return _cost; |
4859 |
- } |
4860 |
- |
4861 |
- inline void initialize( void ){ |
4862 |
- Interface::copy_matrix(X_ref, X, _size); |
4863 |
- } |
4864 |
- |
4865 |
- inline void calculate( void ) { |
4866 |
- Interface::syev(X, V, W, _size); |
4867 |
- } |
4868 |
- |
4869 |
- void check_result( void ){ |
4870 |
- } |
4871 |
- |
4872 |
-private : |
4873 |
- |
4874 |
- typename Interface::stl_matrix X_stl; |
4875 |
- typename Interface::stl_matrix V_stl; |
4876 |
- typename Interface::stl_vector W_stl; |
4877 |
- |
4878 |
- typename Interface::gene_matrix X_ref; |
4879 |
- typename Interface::gene_matrix X; |
4880 |
- typename Interface::gene_matrix V; |
4881 |
- typename Interface::gene_vector W; |
4882 |
- |
4883 |
- int _size; |
4884 |
- double _cost; |
4885 |
-}; |
4886 |
- |
4887 |
-#endif |
4888 |
|
4889 |
diff --git a/btl/actions/action_symm_ev.hh b/btl/actions/action_symm_ev.hh |
4890 |
deleted file mode 100644 |
4891 |
index c696da2..0000000 |
4892 |
--- a/btl/actions/action_symm_ev.hh |
4893 |
+++ /dev/null |
4894 |
@@ -1,104 +0,0 @@ |
4895 |
-//===================================================== |
4896 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
4897 |
-//===================================================== |
4898 |
-// |
4899 |
-// This program is free software; you can redistribute it and/or |
4900 |
-// modify it under the terms of the GNU General Public License |
4901 |
-// as published by the Free Software Foundation; either version 2 |
4902 |
-// of the License, or (at your option) any later version. |
4903 |
-// |
4904 |
-// This program is distributed in the hope that it will be useful, |
4905 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4906 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4907 |
-// GNU General Public License for more details. |
4908 |
-// You should have received a copy of the GNU General Public License |
4909 |
-// along with this program; if not, write to the Free Software |
4910 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4911 |
-// |
4912 |
-#ifndef ACTION_SYMM_EV |
4913 |
-#define ACTION_SYMM_EV |
4914 |
- |
4915 |
-#include "utilities.h" |
4916 |
-#include "STL_interface.hh" |
4917 |
-#include <string> |
4918 |
-#include "init/init_function.hh" |
4919 |
-#include "init/init_vector.hh" |
4920 |
-#include "init/init_matrix.hh" |
4921 |
- |
4922 |
-template<class Interface> |
4923 |
-class Action_symm_ev { |
4924 |
- |
4925 |
-public: |
4926 |
- |
4927 |
- // Ctor |
4928 |
- Action_symm_ev( int size ) : _size(size) |
4929 |
- { |
4930 |
- MESSAGE("Action_symm_ev Ctor"); |
4931 |
- |
4932 |
- // STL matrix initialization |
4933 |
- init_matrix_symm<pseudo_random>(X_stl,_size); |
4934 |
- init_vector<pseudo_random>(W_stl,_size); |
4935 |
- |
4936 |
- // generic matrix and vector initialization |
4937 |
- Interface::matrix_from_stl(X,X_stl); |
4938 |
- Interface::vector_from_stl(W,W_stl); |
4939 |
- |
4940 |
- |
4941 |
- } |
4942 |
- |
4943 |
- // invalidate copy ctor |
4944 |
- |
4945 |
- Action_symm_ev( const Action_symm_ev & ) |
4946 |
- { |
4947 |
- INFOS("illegal call to Action_symm_ev Copy Ctor"); |
4948 |
- exit(1); |
4949 |
- } |
4950 |
- |
4951 |
- // Dtor |
4952 |
- |
4953 |
- ~Action_symm_ev( void ){ |
4954 |
- |
4955 |
- MESSAGE("Action_symm_ev Dtor"); |
4956 |
- |
4957 |
- // deallocation |
4958 |
- Interface::free_matrix(X,_size); |
4959 |
- } |
4960 |
- |
4961 |
- // action name |
4962 |
- |
4963 |
- static inline std::string name( void ) |
4964 |
- { |
4965 |
- return "symm_ev_"+Interface::name(); |
4966 |
- } |
4967 |
- |
4968 |
- double nb_op_base( void ){ |
4969 |
- // TODO: is this right? |
4970 |
- return _size*_size; |
4971 |
- } |
4972 |
- |
4973 |
- inline void initialize( void ){ |
4974 |
- } |
4975 |
- |
4976 |
- inline void calculate( void ) { |
4977 |
- Interface::symm_ev(X,W,_size); |
4978 |
- } |
4979 |
- |
4980 |
- void check_result( void ) { |
4981 |
- // TODO: check result |
4982 |
- } |
4983 |
- |
4984 |
-private : |
4985 |
- |
4986 |
- typename Interface::stl_matrix X_stl; |
4987 |
- typename Interface::stl_vector W_stl; |
4988 |
- |
4989 |
- typename Interface::gene_matrix X; |
4990 |
- typename Interface::gene_vector W; |
4991 |
- |
4992 |
- int _size; |
4993 |
- double _cost; |
4994 |
- |
4995 |
-}; |
4996 |
- |
4997 |
- |
4998 |
-#endif // ACTION_SYMM_EV |
4999 |
|
5000 |
diff --git a/btl/actions/action_symv.hh b/btl/actions/action_symv.hh |
5001 |
deleted file mode 100644 |
5002 |
index a32b9df..0000000 |
5003 |
--- a/btl/actions/action_symv.hh |
5004 |
+++ /dev/null |
5005 |
@@ -1,139 +0,0 @@ |
5006 |
-//===================================================== |
5007 |
-// File : action_symv.hh |
5008 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
5009 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
5010 |
-//===================================================== |
5011 |
-// |
5012 |
-// This program is free software; you can redistribute it and/or |
5013 |
-// modify it under the terms of the GNU General Public License |
5014 |
-// as published by the Free Software Foundation; either version 2 |
5015 |
-// of the License, or (at your option) any later version. |
5016 |
-// |
5017 |
-// This program is distributed in the hope that it will be useful, |
5018 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5019 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5020 |
-// GNU General Public License for more details. |
5021 |
-// You should have received a copy of the GNU General Public License |
5022 |
-// along with this program; if not, write to the Free Software |
5023 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5024 |
-// |
5025 |
-#ifndef ACTION_SYMV |
5026 |
-#define ACTION_SYMV |
5027 |
-#include "utilities.h" |
5028 |
-#include "STL_interface.hh" |
5029 |
-#include <string> |
5030 |
-#include "init/init_function.hh" |
5031 |
-#include "init/init_vector.hh" |
5032 |
-#include "init/init_matrix.hh" |
5033 |
- |
5034 |
-using namespace std; |
5035 |
- |
5036 |
-template<class Interface> |
5037 |
-class Action_symv { |
5038 |
- |
5039 |
-public : |
5040 |
- |
5041 |
- // Ctor |
5042 |
- |
5043 |
- BTL_DONT_INLINE Action_symv( int size ):_size(size) |
5044 |
- { |
5045 |
- MESSAGE("Action_symv Ctor"); |
5046 |
- |
5047 |
- // STL matrix and vector initialization |
5048 |
- init_matrix_symm<pseudo_random>(A_stl,_size); |
5049 |
- init_vector<pseudo_random>(B_stl,_size); |
5050 |
- init_vector<null_function>(X_stl,_size); |
5051 |
- init_vector<null_function>(resu_stl,_size); |
5052 |
- |
5053 |
- // generic matrix and vector initialization |
5054 |
- Interface::matrix_from_stl(A_ref,A_stl); |
5055 |
- Interface::matrix_from_stl(A,A_stl); |
5056 |
- Interface::vector_from_stl(B_ref,B_stl); |
5057 |
- Interface::vector_from_stl(B,B_stl); |
5058 |
- Interface::vector_from_stl(X_ref,X_stl); |
5059 |
- Interface::vector_from_stl(X,X_stl); |
5060 |
- |
5061 |
- } |
5062 |
- |
5063 |
- // invalidate copy ctor |
5064 |
- |
5065 |
- Action_symv( const Action_symv & ) |
5066 |
- { |
5067 |
- INFOS("illegal call to Action_symv Copy Ctor"); |
5068 |
- exit(1); |
5069 |
- } |
5070 |
- |
5071 |
- // Dtor |
5072 |
- BTL_DONT_INLINE ~Action_symv( void ){ |
5073 |
- Interface::free_matrix(A,_size); |
5074 |
- Interface::free_vector(B); |
5075 |
- Interface::free_vector(X); |
5076 |
- Interface::free_matrix(A_ref,_size); |
5077 |
- Interface::free_vector(B_ref); |
5078 |
- Interface::free_vector(X_ref); |
5079 |
- } |
5080 |
- |
5081 |
- // action name |
5082 |
- |
5083 |
- static inline std::string name( void ) |
5084 |
- { |
5085 |
- return "symv_" + Interface::name(); |
5086 |
- } |
5087 |
- |
5088 |
- double nb_op_base( void ){ |
5089 |
- return 2.0*_size*_size; |
5090 |
- } |
5091 |
- |
5092 |
- BTL_DONT_INLINE void initialize( void ){ |
5093 |
- |
5094 |
- Interface::copy_matrix(A_ref,A,_size); |
5095 |
- Interface::copy_vector(B_ref,B,_size); |
5096 |
- Interface::copy_vector(X_ref,X,_size); |
5097 |
- |
5098 |
- } |
5099 |
- |
5100 |
- BTL_DONT_INLINE void calculate( void ) { |
5101 |
- BTL_ASM_COMMENT("#begin symv"); |
5102 |
- Interface::symv(A,B,X,_size); |
5103 |
- BTL_ASM_COMMENT("end symv"); |
5104 |
- } |
5105 |
- |
5106 |
- BTL_DONT_INLINE void check_result( void ){ |
5107 |
- if (_size>128) return; |
5108 |
- // calculation check |
5109 |
- Interface::vector_to_stl(X,resu_stl); |
5110 |
- |
5111 |
- STL_interface<typename Interface::real_type>::symv(A_stl,B_stl,X_stl,_size); |
5112 |
- |
5113 |
- typename Interface::real_type error= |
5114 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
5115 |
- |
5116 |
- if (error>1.e-5){ |
5117 |
- INFOS("WRONG CALCULATION...residual=" << error); |
5118 |
- exit(0); |
5119 |
- } |
5120 |
- |
5121 |
- } |
5122 |
- |
5123 |
-private : |
5124 |
- |
5125 |
- typename Interface::stl_matrix A_stl; |
5126 |
- typename Interface::stl_vector B_stl; |
5127 |
- typename Interface::stl_vector X_stl; |
5128 |
- typename Interface::stl_vector resu_stl; |
5129 |
- |
5130 |
- typename Interface::gene_matrix A_ref; |
5131 |
- typename Interface::gene_vector B_ref; |
5132 |
- typename Interface::gene_vector X_ref; |
5133 |
- |
5134 |
- typename Interface::gene_matrix A; |
5135 |
- typename Interface::gene_vector B; |
5136 |
- typename Interface::gene_vector X; |
5137 |
- |
5138 |
- |
5139 |
- int _size; |
5140 |
- |
5141 |
-}; |
5142 |
- |
5143 |
- |
5144 |
-#endif |
5145 |
|
5146 |
diff --git a/btl/actions/action_syr2.hh b/btl/actions/action_syr2.hh |
5147 |
deleted file mode 100644 |
5148 |
index 7c6712b..0000000 |
5149 |
--- a/btl/actions/action_syr2.hh |
5150 |
+++ /dev/null |
5151 |
@@ -1,133 +0,0 @@ |
5152 |
-//===================================================== |
5153 |
-// File : action_syr2.hh |
5154 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
5155 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
5156 |
-//===================================================== |
5157 |
-// |
5158 |
-// This program is free software; you can redistribute it and/or |
5159 |
-// modify it under the terms of the GNU General Public License |
5160 |
-// as published by the Free Software Foundation; either version 2 |
5161 |
-// of the License, or (at your option) any later version. |
5162 |
-// |
5163 |
-// This program is distributed in the hope that it will be useful, |
5164 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5165 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5166 |
-// GNU General Public License for more details. |
5167 |
-// You should have received a copy of the GNU General Public License |
5168 |
-// along with this program; if not, write to the Free Software |
5169 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5170 |
-// |
5171 |
-#ifndef ACTION_SYR2 |
5172 |
-#define ACTION_SYR2 |
5173 |
-#include "utilities.h" |
5174 |
-#include "STL_interface.hh" |
5175 |
-#include <string> |
5176 |
-#include "init/init_function.hh" |
5177 |
-#include "init/init_vector.hh" |
5178 |
-#include "init/init_matrix.hh" |
5179 |
- |
5180 |
-using namespace std; |
5181 |
- |
5182 |
-template<class Interface> |
5183 |
-class Action_syr2 { |
5184 |
- |
5185 |
-public : |
5186 |
- |
5187 |
- // Ctor |
5188 |
- |
5189 |
- BTL_DONT_INLINE Action_syr2( int size ):_size(size) |
5190 |
- { |
5191 |
- // STL matrix and vector initialization |
5192 |
- typename Interface::stl_matrix tmp; |
5193 |
- init_matrix<pseudo_random>(A_stl,_size); |
5194 |
- init_vector<pseudo_random>(B_stl,_size); |
5195 |
- init_vector<pseudo_random>(X_stl,_size); |
5196 |
- init_vector<null_function>(resu_stl,_size); |
5197 |
- |
5198 |
- // generic matrix and vector initialization |
5199 |
- Interface::matrix_from_stl(A_ref,A_stl); |
5200 |
- Interface::matrix_from_stl(A,A_stl); |
5201 |
- Interface::vector_from_stl(B_ref,B_stl); |
5202 |
- Interface::vector_from_stl(B,B_stl); |
5203 |
- Interface::vector_from_stl(X_ref,X_stl); |
5204 |
- Interface::vector_from_stl(X,X_stl); |
5205 |
- } |
5206 |
- |
5207 |
- // invalidate copy ctor |
5208 |
- Action_syr2( const Action_syr2 & ) |
5209 |
- { |
5210 |
- INFOS("illegal call to Action_syr2 Copy Ctor"); |
5211 |
- exit(1); |
5212 |
- } |
5213 |
- |
5214 |
- // Dtor |
5215 |
- BTL_DONT_INLINE ~Action_syr2( void ){ |
5216 |
- Interface::free_matrix(A,_size); |
5217 |
- Interface::free_vector(B); |
5218 |
- Interface::free_vector(X); |
5219 |
- Interface::free_matrix(A_ref,_size); |
5220 |
- Interface::free_vector(B_ref); |
5221 |
- Interface::free_vector(X_ref); |
5222 |
- } |
5223 |
- |
5224 |
- // action name |
5225 |
- |
5226 |
- static inline std::string name( void ) |
5227 |
- { |
5228 |
- return "syr2_" + Interface::name(); |
5229 |
- } |
5230 |
- |
5231 |
- double nb_op_base( void ){ |
5232 |
- return 2.0*_size*_size; |
5233 |
- } |
5234 |
- |
5235 |
- BTL_DONT_INLINE void initialize( void ){ |
5236 |
- Interface::copy_matrix(A_ref,A,_size); |
5237 |
- Interface::copy_vector(B_ref,B,_size); |
5238 |
- Interface::copy_vector(X_ref,X,_size); |
5239 |
- } |
5240 |
- |
5241 |
- BTL_DONT_INLINE void calculate( void ) { |
5242 |
- BTL_ASM_COMMENT("#begin syr2"); |
5243 |
- Interface::syr2(A,B,X,_size); |
5244 |
- BTL_ASM_COMMENT("end syr2"); |
5245 |
- } |
5246 |
- |
5247 |
- BTL_DONT_INLINE void check_result( void ){ |
5248 |
- // calculation check |
5249 |
- Interface::vector_to_stl(X,resu_stl); |
5250 |
- |
5251 |
- STL_interface<typename Interface::real_type>::syr2(A_stl,B_stl,X_stl,_size); |
5252 |
- |
5253 |
- typename Interface::real_type error= |
5254 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
5255 |
- |
5256 |
- if (error>1.e-3){ |
5257 |
- INFOS("WRONG CALCULATION...residual=" << error); |
5258 |
-// exit(0); |
5259 |
- } |
5260 |
- |
5261 |
- } |
5262 |
- |
5263 |
-private : |
5264 |
- |
5265 |
- typename Interface::stl_matrix A_stl; |
5266 |
- typename Interface::stl_vector B_stl; |
5267 |
- typename Interface::stl_vector X_stl; |
5268 |
- typename Interface::stl_vector resu_stl; |
5269 |
- |
5270 |
- typename Interface::gene_matrix A_ref; |
5271 |
- typename Interface::gene_vector B_ref; |
5272 |
- typename Interface::gene_vector X_ref; |
5273 |
- |
5274 |
- typename Interface::gene_matrix A; |
5275 |
- typename Interface::gene_vector B; |
5276 |
- typename Interface::gene_vector X; |
5277 |
- |
5278 |
- |
5279 |
- int _size; |
5280 |
- |
5281 |
-}; |
5282 |
- |
5283 |
- |
5284 |
-#endif |
5285 |
|
5286 |
diff --git a/btl/actions/action_trisolve.hh b/btl/actions/action_trisolve.hh |
5287 |
deleted file mode 100644 |
5288 |
index d6f0b47..0000000 |
5289 |
--- a/btl/actions/action_trisolve.hh |
5290 |
+++ /dev/null |
5291 |
@@ -1,137 +0,0 @@ |
5292 |
-//===================================================== |
5293 |
-// File : action_trisolve.hh |
5294 |
-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@×××××.fr> |
5295 |
-//===================================================== |
5296 |
-// |
5297 |
-// This program is free software; you can redistribute it and/or |
5298 |
-// modify it under the terms of the GNU General Public License |
5299 |
-// as published by the Free Software Foundation; either version 2 |
5300 |
-// of the License, or (at your option) any later version. |
5301 |
-// |
5302 |
-// This program is distributed in the hope that it will be useful, |
5303 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5304 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5305 |
-// GNU General Public License for more details. |
5306 |
-// You should have received a copy of the GNU General Public License |
5307 |
-// along with this program; if not, write to the Free Software |
5308 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5309 |
-// |
5310 |
-#ifndef ACTION_TRISOLVE |
5311 |
-#define ACTION_TRISOLVE |
5312 |
-#include "utilities.h" |
5313 |
-#include "STL_interface.hh" |
5314 |
-#include <string> |
5315 |
-#include "init/init_function.hh" |
5316 |
-#include "init/init_vector.hh" |
5317 |
-#include "init/init_matrix.hh" |
5318 |
- |
5319 |
-using namespace std; |
5320 |
- |
5321 |
-template<class Interface> |
5322 |
-class Action_trisolve { |
5323 |
- |
5324 |
-public : |
5325 |
- |
5326 |
- // Ctor |
5327 |
- |
5328 |
- Action_trisolve( int size ):_size(size) |
5329 |
- { |
5330 |
- MESSAGE("Action_trisolve Ctor"); |
5331 |
- |
5332 |
- // STL vector initialization |
5333 |
- init_matrix<pseudo_random>(L_stl,_size); |
5334 |
- init_vector<pseudo_random>(B_stl,_size); |
5335 |
- init_vector<null_function>(X_stl,_size); |
5336 |
- for (int j=0; j<_size; ++j) |
5337 |
- { |
5338 |
- for (int i=0; i<j; ++i) |
5339 |
- L_stl[j][i] = 0; |
5340 |
- L_stl[j][j] += 3; |
5341 |
- } |
5342 |
- |
5343 |
- init_vector<null_function>(resu_stl,_size); |
5344 |
- |
5345 |
- // generic matrix and vector initialization |
5346 |
- Interface::matrix_from_stl(L,L_stl); |
5347 |
- Interface::vector_from_stl(X,X_stl); |
5348 |
- Interface::vector_from_stl(B,B_stl); |
5349 |
- |
5350 |
- _cost = 0; |
5351 |
- for (int j=0; j<_size; ++j) |
5352 |
- { |
5353 |
- _cost += 2*j + 1; |
5354 |
- } |
5355 |
- } |
5356 |
- |
5357 |
- // invalidate copy ctor |
5358 |
- |
5359 |
- Action_trisolve( const Action_trisolve & ) |
5360 |
- { |
5361 |
- INFOS("illegal call to Action_trisolve Copy Ctor"); |
5362 |
- exit(1); |
5363 |
- } |
5364 |
- |
5365 |
- // Dtor |
5366 |
- |
5367 |
- ~Action_trisolve( void ){ |
5368 |
- |
5369 |
- MESSAGE("Action_trisolve Dtor"); |
5370 |
- |
5371 |
- // deallocation |
5372 |
- Interface::free_matrix(L,_size); |
5373 |
- Interface::free_vector(B); |
5374 |
- Interface::free_vector(X); |
5375 |
- } |
5376 |
- |
5377 |
- // action name |
5378 |
- |
5379 |
- static inline std::string name( void ) |
5380 |
- { |
5381 |
- return "trisolve_vector_"+Interface::name(); |
5382 |
- } |
5383 |
- |
5384 |
- double nb_op_base( void ){ |
5385 |
- return _cost; |
5386 |
- } |
5387 |
- |
5388 |
- inline void initialize( void ){ |
5389 |
- //Interface::copy_vector(X_ref,X,_size); |
5390 |
- } |
5391 |
- |
5392 |
- inline void calculate( void ) { |
5393 |
- Interface::trisolve_lower(L,B,X,_size); |
5394 |
- } |
5395 |
- |
5396 |
- void check_result(){ |
5397 |
- if (_size>128) return; |
5398 |
- // calculation check |
5399 |
- Interface::vector_to_stl(X,resu_stl); |
5400 |
- |
5401 |
- STL_interface<typename Interface::real_type>::trisolve_lower(L_stl,B_stl,X_stl,_size); |
5402 |
- |
5403 |
- typename Interface::real_type error= |
5404 |
- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
5405 |
- |
5406 |
- if (error>1.e-4){ |
5407 |
- INFOS("WRONG CALCULATION...residual=" << error); |
5408 |
- exit(2); |
5409 |
- } //else INFOS("CALCULATION OK...residual=" << error); |
5410 |
- |
5411 |
- } |
5412 |
- |
5413 |
-private : |
5414 |
- |
5415 |
- typename Interface::stl_matrix L_stl; |
5416 |
- typename Interface::stl_vector X_stl; |
5417 |
- typename Interface::stl_vector B_stl; |
5418 |
- typename Interface::stl_vector resu_stl; |
5419 |
- |
5420 |
- typename Interface::gene_matrix L; |
5421 |
- typename Interface::gene_vector X; |
5422 |
- typename Interface::gene_vector B; |
5423 |
- |
5424 |
- int _size; |
5425 |
- double _cost; |
5426 |
-}; |
5427 |
- |
5428 |
-#endif |
5429 |
|
5430 |
diff --git a/btl/actions/action_trisolve_matrix.hh b/btl/actions/action_trisolve_matrix.hh |
5431 |
deleted file mode 100644 |
5432 |
index 0fc2bb9..0000000 |
5433 |
--- a/btl/actions/action_trisolve_matrix.hh |
5434 |
+++ /dev/null |
5435 |
@@ -1,165 +0,0 @@ |
5436 |
-//===================================================== |
5437 |
-// File : action_matrix_matrix_product.hh |
5438 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
5439 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
5440 |
-//===================================================== |
5441 |
-// |
5442 |
-// This program is free software; you can redistribute it and/or |
5443 |
-// modify it under the terms of the GNU General Public License |
5444 |
-// as published by the Free Software Foundation; either version 2 |
5445 |
-// of the License, or (at your option) any later version. |
5446 |
-// |
5447 |
-// This program is distributed in the hope that it will be useful, |
5448 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5449 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5450 |
-// GNU General Public License for more details. |
5451 |
-// You should have received a copy of the GNU General Public License |
5452 |
-// along with this program; if not, write to the Free Software |
5453 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5454 |
-// |
5455 |
-#ifndef ACTION_TRISOLVE_MATRIX_PRODUCT |
5456 |
-#define ACTION_TRISOLVE_MATRIX_PRODUCT |
5457 |
-#include "utilities.h" |
5458 |
-#include "STL_interface.hh" |
5459 |
-#include <string> |
5460 |
-#include "init/init_function.hh" |
5461 |
-#include "init/init_vector.hh" |
5462 |
-#include "init/init_matrix.hh" |
5463 |
- |
5464 |
-using namespace std; |
5465 |
- |
5466 |
-template<class Interface> |
5467 |
-class Action_trisolve_matrix { |
5468 |
- |
5469 |
-public : |
5470 |
- |
5471 |
- // Ctor |
5472 |
- |
5473 |
- Action_trisolve_matrix( int size ):_size(size) |
5474 |
- { |
5475 |
- MESSAGE("Action_trisolve_matrix Ctor"); |
5476 |
- |
5477 |
- // STL matrix and vector initialization |
5478 |
- |
5479 |
- init_matrix<pseudo_random>(A_stl,_size); |
5480 |
- init_matrix<pseudo_random>(B_stl,_size); |
5481 |
- init_matrix<null_function>(X_stl,_size); |
5482 |
- init_matrix<null_function>(resu_stl,_size); |
5483 |
- |
5484 |
- for (int j=0; j<_size; ++j) |
5485 |
- { |
5486 |
- for (int i=0; i<j; ++i) |
5487 |
- A_stl[j][i] = 0; |
5488 |
- A_stl[j][j] += 3; |
5489 |
- } |
5490 |
- |
5491 |
- // generic matrix and vector initialization |
5492 |
- |
5493 |
- Interface::matrix_from_stl(A_ref,A_stl); |
5494 |
- Interface::matrix_from_stl(B_ref,B_stl); |
5495 |
- Interface::matrix_from_stl(X_ref,X_stl); |
5496 |
- |
5497 |
- Interface::matrix_from_stl(A,A_stl); |
5498 |
- Interface::matrix_from_stl(B,B_stl); |
5499 |
- Interface::matrix_from_stl(X,X_stl); |
5500 |
- |
5501 |
- _cost = 0; |
5502 |
- for (int j=0; j<_size; ++j) |
5503 |
- { |
5504 |
- _cost += 2*j + 1; |
5505 |
- } |
5506 |
- _cost *= _size; |
5507 |
- } |
5508 |
- |
5509 |
- // invalidate copy ctor |
5510 |
- |
5511 |
- Action_trisolve_matrix( const Action_trisolve_matrix & ) |
5512 |
- { |
5513 |
- INFOS("illegal call to Action_trisolve_matrix Copy Ctor"); |
5514 |
- exit(0); |
5515 |
- } |
5516 |
- |
5517 |
- // Dtor |
5518 |
- |
5519 |
- ~Action_trisolve_matrix( void ){ |
5520 |
- |
5521 |
- MESSAGE("Action_trisolve_matrix Dtor"); |
5522 |
- |
5523 |
- // deallocation |
5524 |
- |
5525 |
- Interface::free_matrix(A,_size); |
5526 |
- Interface::free_matrix(B,_size); |
5527 |
- Interface::free_matrix(X,_size); |
5528 |
- |
5529 |
- Interface::free_matrix(A_ref,_size); |
5530 |
- Interface::free_matrix(B_ref,_size); |
5531 |
- Interface::free_matrix(X_ref,_size); |
5532 |
- |
5533 |
- } |
5534 |
- |
5535 |
- // action name |
5536 |
- |
5537 |
- static inline std::string name( void ) |
5538 |
- { |
5539 |
- return "trisolve_matrix_"+Interface::name(); |
5540 |
- } |
5541 |
- |
5542 |
- double nb_op_base( void ){ |
5543 |
- return _cost; |
5544 |
- } |
5545 |
- |
5546 |
- inline void initialize( void ){ |
5547 |
- |
5548 |
- Interface::copy_matrix(A_ref,A,_size); |
5549 |
- Interface::copy_matrix(B_ref,B,_size); |
5550 |
- Interface::copy_matrix(X_ref,X,_size); |
5551 |
- |
5552 |
- } |
5553 |
- |
5554 |
- inline void calculate( void ) { |
5555 |
- Interface::trisolve_lower_matrix(A,B,X,_size); |
5556 |
- } |
5557 |
- |
5558 |
- void check_result( void ){ |
5559 |
- |
5560 |
- // calculation check |
5561 |
- |
5562 |
-// Interface::matrix_to_stl(X,resu_stl); |
5563 |
-// |
5564 |
-// STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size); |
5565 |
-// |
5566 |
-// typename Interface::real_type error= |
5567 |
-// STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
5568 |
-// |
5569 |
-// if (error>1.e-6){ |
5570 |
-// INFOS("WRONG CALCULATION...residual=" << error); |
5571 |
-// // exit(1); |
5572 |
-// } |
5573 |
- |
5574 |
- } |
5575 |
- |
5576 |
-private : |
5577 |
- |
5578 |
- typename Interface::stl_matrix A_stl; |
5579 |
- typename Interface::stl_matrix B_stl; |
5580 |
- typename Interface::stl_matrix X_stl; |
5581 |
- typename Interface::stl_matrix resu_stl; |
5582 |
- |
5583 |
- typename Interface::gene_matrix A_ref; |
5584 |
- typename Interface::gene_matrix B_ref; |
5585 |
- typename Interface::gene_matrix X_ref; |
5586 |
- |
5587 |
- typename Interface::gene_matrix A; |
5588 |
- typename Interface::gene_matrix B; |
5589 |
- typename Interface::gene_matrix X; |
5590 |
- |
5591 |
- int _size; |
5592 |
- double _cost; |
5593 |
- |
5594 |
-}; |
5595 |
- |
5596 |
- |
5597 |
-#endif |
5598 |
- |
5599 |
- |
5600 |
- |
5601 |
|
5602 |
diff --git a/btl/actions/action_trmm.hh b/btl/actions/action_trmm.hh |
5603 |
deleted file mode 100644 |
5604 |
index 8f78138..0000000 |
5605 |
--- a/btl/actions/action_trmm.hh |
5606 |
+++ /dev/null |
5607 |
@@ -1,165 +0,0 @@ |
5608 |
-//===================================================== |
5609 |
-// File : action_matrix_matrix_product.hh |
5610 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
5611 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
5612 |
-//===================================================== |
5613 |
-// |
5614 |
-// This program is free software; you can redistribute it and/or |
5615 |
-// modify it under the terms of the GNU General Public License |
5616 |
-// as published by the Free Software Foundation; either version 2 |
5617 |
-// of the License, or (at your option) any later version. |
5618 |
-// |
5619 |
-// This program is distributed in the hope that it will be useful, |
5620 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5621 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5622 |
-// GNU General Public License for more details. |
5623 |
-// You should have received a copy of the GNU General Public License |
5624 |
-// along with this program; if not, write to the Free Software |
5625 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5626 |
-// |
5627 |
-#ifndef ACTION_TRMM |
5628 |
-#define ACTION_TRMM |
5629 |
-#include "utilities.h" |
5630 |
-#include "STL_interface.hh" |
5631 |
-#include <string> |
5632 |
-#include "init/init_function.hh" |
5633 |
-#include "init/init_vector.hh" |
5634 |
-#include "init/init_matrix.hh" |
5635 |
- |
5636 |
-using namespace std; |
5637 |
- |
5638 |
-template<class Interface> |
5639 |
-class Action_trmm { |
5640 |
- |
5641 |
-public : |
5642 |
- |
5643 |
- // Ctor |
5644 |
- |
5645 |
- Action_trmm( int size ):_size(size) |
5646 |
- { |
5647 |
- MESSAGE("Action_trmm Ctor"); |
5648 |
- |
5649 |
- // STL matrix and vector initialization |
5650 |
- |
5651 |
- init_matrix<pseudo_random>(A_stl,_size); |
5652 |
- init_matrix<pseudo_random>(B_stl,_size); |
5653 |
- init_matrix<null_function>(X_stl,_size); |
5654 |
- init_matrix<null_function>(resu_stl,_size); |
5655 |
- |
5656 |
- for (int j=0; j<_size; ++j) |
5657 |
- { |
5658 |
- for (int i=0; i<j; ++i) |
5659 |
- A_stl[j][i] = 0; |
5660 |
- A_stl[j][j] += 3; |
5661 |
- } |
5662 |
- |
5663 |
- // generic matrix and vector initialization |
5664 |
- |
5665 |
- Interface::matrix_from_stl(A_ref,A_stl); |
5666 |
- Interface::matrix_from_stl(B_ref,B_stl); |
5667 |
- Interface::matrix_from_stl(X_ref,X_stl); |
5668 |
- |
5669 |
- Interface::matrix_from_stl(A,A_stl); |
5670 |
- Interface::matrix_from_stl(B,B_stl); |
5671 |
- Interface::matrix_from_stl(X,X_stl); |
5672 |
- |
5673 |
- _cost = 0; |
5674 |
- for (int j=0; j<_size; ++j) |
5675 |
- { |
5676 |
- _cost += 2*j + 1; |
5677 |
- } |
5678 |
- _cost *= _size; |
5679 |
- } |
5680 |
- |
5681 |
- // invalidate copy ctor |
5682 |
- |
5683 |
- Action_trmm( const Action_trmm & ) |
5684 |
- { |
5685 |
- INFOS("illegal call to Action_trmm Copy Ctor"); |
5686 |
- exit(0); |
5687 |
- } |
5688 |
- |
5689 |
- // Dtor |
5690 |
- |
5691 |
- ~Action_trmm( void ){ |
5692 |
- |
5693 |
- MESSAGE("Action_trmm Dtor"); |
5694 |
- |
5695 |
- // deallocation |
5696 |
- |
5697 |
- Interface::free_matrix(A,_size); |
5698 |
- Interface::free_matrix(B,_size); |
5699 |
- Interface::free_matrix(X,_size); |
5700 |
- |
5701 |
- Interface::free_matrix(A_ref,_size); |
5702 |
- Interface::free_matrix(B_ref,_size); |
5703 |
- Interface::free_matrix(X_ref,_size); |
5704 |
- |
5705 |
- } |
5706 |
- |
5707 |
- // action name |
5708 |
- |
5709 |
- static inline std::string name( void ) |
5710 |
- { |
5711 |
- return "trmm_"+Interface::name(); |
5712 |
- } |
5713 |
- |
5714 |
- double nb_op_base( void ){ |
5715 |
- return _cost; |
5716 |
- } |
5717 |
- |
5718 |
- inline void initialize( void ){ |
5719 |
- |
5720 |
- Interface::copy_matrix(A_ref,A,_size); |
5721 |
- Interface::copy_matrix(B_ref,B,_size); |
5722 |
- Interface::copy_matrix(X_ref,X,_size); |
5723 |
- |
5724 |
- } |
5725 |
- |
5726 |
- inline void calculate( void ) { |
5727 |
- Interface::trmm(A,B,X,_size); |
5728 |
- } |
5729 |
- |
5730 |
- void check_result( void ){ |
5731 |
- |
5732 |
- // calculation check |
5733 |
- |
5734 |
-// Interface::matrix_to_stl(X,resu_stl); |
5735 |
-// |
5736 |
-// STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size); |
5737 |
-// |
5738 |
-// typename Interface::real_type error= |
5739 |
-// STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); |
5740 |
-// |
5741 |
-// if (error>1.e-6){ |
5742 |
-// INFOS("WRONG CALCULATION...residual=" << error); |
5743 |
-// // exit(1); |
5744 |
-// } |
5745 |
- |
5746 |
- } |
5747 |
- |
5748 |
-private : |
5749 |
- |
5750 |
- typename Interface::stl_matrix A_stl; |
5751 |
- typename Interface::stl_matrix B_stl; |
5752 |
- typename Interface::stl_matrix X_stl; |
5753 |
- typename Interface::stl_matrix resu_stl; |
5754 |
- |
5755 |
- typename Interface::gene_matrix A_ref; |
5756 |
- typename Interface::gene_matrix B_ref; |
5757 |
- typename Interface::gene_matrix X_ref; |
5758 |
- |
5759 |
- typename Interface::gene_matrix A; |
5760 |
- typename Interface::gene_matrix B; |
5761 |
- typename Interface::gene_matrix X; |
5762 |
- |
5763 |
- int _size; |
5764 |
- double _cost; |
5765 |
- |
5766 |
-}; |
5767 |
- |
5768 |
- |
5769 |
-#endif |
5770 |
- |
5771 |
- |
5772 |
- |
5773 |
|
5774 |
diff --git a/btl/actions/actionsBLAS.hpp b/btl/actions/actionsBLAS.hpp |
5775 |
new file mode 100644 |
5776 |
index 0000000..0a63675 |
5777 |
--- /dev/null |
5778 |
+++ b/btl/actions/actionsBLAS.hpp |
5779 |
@@ -0,0 +1,16 @@ |
5780 |
+#include "action_axpy.hpp" |
5781 |
+#include "action_rot.hpp" |
5782 |
+ |
5783 |
+#include "action_MatrixVector.hpp" |
5784 |
+#include "action_MatrixTVector.hpp" |
5785 |
+#include "action_SymMatrixVector.hpp" |
5786 |
+#include "action_TriSolveVector.hpp" |
5787 |
+#include "action_Rank1Update.hpp" |
5788 |
+#include "action_Rank2Update.hpp" |
5789 |
+ |
5790 |
+/* |
5791 |
+#include "action_MatrixMatrix.hpp" |
5792 |
+#include "action_MatrixTMatrix.hpp" |
5793 |
+#include "action_TriMatrixMatrix.hpp" |
5794 |
+#include "action_TriSolveMatrix.hpp" |
5795 |
+*/ |
5796 |
|
5797 |
diff --git a/btl/actions/base_action_fftw.hh b/btl/actions/base_action_fftw.hh |
5798 |
deleted file mode 100644 |
5799 |
index fb32b51..0000000 |
5800 |
--- a/btl/actions/base_action_fftw.hh |
5801 |
+++ /dev/null |
5802 |
@@ -1,86 +0,0 @@ |
5803 |
-//===================================================== |
5804 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
5805 |
-//===================================================== |
5806 |
-// |
5807 |
-// This program is free software; you can redistribute it and/or |
5808 |
-// modify it under the terms of the GNU General Public License |
5809 |
-// as published by the Free Software Foundation; either version 2 |
5810 |
-// of the License, or (at your option) any later version. |
5811 |
-// |
5812 |
-// This program is distributed in the hope that it will be useful, |
5813 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5814 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5815 |
-// GNU General Public License for more details. |
5816 |
-// You should have received a copy of the GNU General Public License |
5817 |
-// along with this program; if not, write to the Free Software |
5818 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5819 |
-// |
5820 |
-#ifndef BASE_ACTION_FFTW_HH |
5821 |
-#define BASE_ACTION_FFTW_HH |
5822 |
- |
5823 |
-#include "utilities.h" |
5824 |
-#include "init/init_function.hh" |
5825 |
-#include "init/init_vector.hh" |
5826 |
- |
5827 |
-inline int power(const int& base, const int& exp) { |
5828 |
- int ret = 1; |
5829 |
- for (int i = 0; i < exp; ++i) |
5830 |
- ret *= base; |
5831 |
- return ret; |
5832 |
-} |
5833 |
- |
5834 |
-template<class Interface> |
5835 |
-class Action_FFTW_base |
5836 |
-{ |
5837 |
-public: |
5838 |
- // Constructor |
5839 |
- Action_FFTW_base(const int& size, const int& dimensions) : |
5840 |
- size_(size), dimensions_(dimensions), N_(power(size, dimensions)) |
5841 |
- { |
5842 |
- // STL vector initialization |
5843 |
- init_vector < pseudo_random > (X_stl, N_); |
5844 |
- init_vector < null_function > (Y_stl, N_); |
5845 |
- |
5846 |
- // Generic vector initialization |
5847 |
- Interface::vector_from_stl(X, X_stl); |
5848 |
- Interface::vector_from_stl(Y, Y_stl); |
5849 |
- |
5850 |
- // To be done by the child: |
5851 |
- /* initialize plan! */ |
5852 |
- } |
5853 |
- |
5854 |
- // Invalidate copy constructor |
5855 |
- Action_FFTW_base( const Action_FFTW_base & ) |
5856 |
- { |
5857 |
- INFOS("illegal call to Action_FFTW_base Copy Ctor"); |
5858 |
- exit(1); |
5859 |
- } |
5860 |
- |
5861 |
- // Destructor: |
5862 |
- // frees the memory |
5863 |
- ~Action_FFTW_base() |
5864 |
- { |
5865 |
- Interface::free_vector(X); |
5866 |
- Interface::free_vector(Y); |
5867 |
- } |
5868 |
- |
5869 |
- inline void initialize() { } |
5870 |
- |
5871 |
- inline void calculate( void ) { |
5872 |
- Interface::fftw_run(p); |
5873 |
- } |
5874 |
- |
5875 |
- void check_result( void ){ |
5876 |
- } |
5877 |
- |
5878 |
- |
5879 |
-protected: |
5880 |
- const int size_, dimensions_, N_; |
5881 |
- |
5882 |
- typename Interface::stl_vector X_stl, Y_stl; |
5883 |
- typename Interface::gene_vector X, Y; |
5884 |
- |
5885 |
- typename Interface::plan p; |
5886 |
-}; |
5887 |
- |
5888 |
-#endif /* BASE_ACTION_FFTW_HH */ |
5889 |
|
5890 |
diff --git a/btl/actions/basic_actions.hh b/btl/actions/basic_actions.hh |
5891 |
deleted file mode 100644 |
5892 |
index a3333ea..0000000 |
5893 |
--- a/btl/actions/basic_actions.hh |
5894 |
+++ /dev/null |
5895 |
@@ -1,21 +0,0 @@ |
5896 |
- |
5897 |
-#include "action_axpy.hh" |
5898 |
-#include "action_axpby.hh" |
5899 |
- |
5900 |
-#include "action_matrix_vector_product.hh" |
5901 |
-#include "action_atv_product.hh" |
5902 |
- |
5903 |
-#include "action_matrix_matrix_product.hh" |
5904 |
-// #include "action_ata_product.hh" |
5905 |
-#include "action_aat_product.hh" |
5906 |
- |
5907 |
-#include "action_trisolve.hh" |
5908 |
-#include "action_trmm.hh" |
5909 |
-#include "action_symv.hh" |
5910 |
-// #include "action_symm.hh" |
5911 |
-#include "action_syr2.hh" |
5912 |
-#include "action_ger.hh" |
5913 |
-#include "action_rot.hh" |
5914 |
- |
5915 |
-// #include "action_lu_solve.hh" |
5916 |
- |
5917 |
|
5918 |
diff --git a/btl/generic_bench/init/init_function.hh b/btl/generic_bench/init/init_function.hh |
5919 |
deleted file mode 100644 |
5920 |
index 7b3bdba..0000000 |
5921 |
--- a/btl/generic_bench/init/init_function.hh |
5922 |
+++ /dev/null |
5923 |
@@ -1,54 +0,0 @@ |
5924 |
-//===================================================== |
5925 |
-// File : init_function.hh |
5926 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
5927 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002 |
5928 |
-//===================================================== |
5929 |
-// |
5930 |
-// This program is free software; you can redistribute it and/or |
5931 |
-// modify it under the terms of the GNU General Public License |
5932 |
-// as published by the Free Software Foundation; either version 2 |
5933 |
-// of the License, or (at your option) any later version. |
5934 |
-// |
5935 |
-// This program is distributed in the hope that it will be useful, |
5936 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5937 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5938 |
-// GNU General Public License for more details. |
5939 |
-// You should have received a copy of the GNU General Public License |
5940 |
-// along with this program; if not, write to the Free Software |
5941 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
5942 |
-// |
5943 |
-#ifndef INIT_FUNCTION_HH |
5944 |
-#define INIT_FUNCTION_HH |
5945 |
- |
5946 |
-double simple_function(int index) |
5947 |
-{ |
5948 |
- return index; |
5949 |
-} |
5950 |
- |
5951 |
-double simple_function(int index_i, int index_j) |
5952 |
-{ |
5953 |
- return index_i+index_j; |
5954 |
-} |
5955 |
- |
5956 |
-double pseudo_random(int index) |
5957 |
-{ |
5958 |
- return std::rand()/double(RAND_MAX); |
5959 |
-} |
5960 |
- |
5961 |
-double pseudo_random(int index_i, int index_j) |
5962 |
-{ |
5963 |
- return std::rand()/double(RAND_MAX); |
5964 |
-} |
5965 |
- |
5966 |
- |
5967 |
-double null_function(int index) |
5968 |
-{ |
5969 |
- return 0.0; |
5970 |
-} |
5971 |
- |
5972 |
-double null_function(int index_i, int index_j) |
5973 |
-{ |
5974 |
- return 0.0; |
5975 |
-} |
5976 |
- |
5977 |
-#endif |
5978 |
|
5979 |
diff --git a/btl/generic_bench/init/init_matrix.hh b/btl/generic_bench/init/init_matrix.hh |
5980 |
deleted file mode 100644 |
5981 |
index c598ffc..0000000 |
5982 |
--- a/btl/generic_bench/init/init_matrix.hh |
5983 |
+++ /dev/null |
5984 |
@@ -1,93 +0,0 @@ |
5985 |
-//===================================================== |
5986 |
-// File : init_matrix.hh |
5987 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
5988 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 |
5989 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
5990 |
-//===================================================== |
5991 |
-// |
5992 |
-// This program is free software; you can redistribute it and/or |
5993 |
-// modify it under the terms of the GNU General Public License |
5994 |
-// as published by the Free Software Foundation; either version 2 |
5995 |
-// of the License, or (at your option) any later version. |
5996 |
-// |
5997 |
-// This program is distributed in the hope that it will be useful, |
5998 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
5999 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6000 |
-// GNU General Public License for more details. |
6001 |
-// You should have received a copy of the GNU General Public License |
6002 |
-// along with this program; if not, write to the Free Software |
6003 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6004 |
-// |
6005 |
-#ifndef INIT_MATRIX_HH |
6006 |
-#define INIT_MATRIX_HH |
6007 |
- |
6008 |
-#include "LinearCongruential.hh" |
6009 |
- |
6010 |
-// The Vector class must satisfy the following part of STL vector concept : |
6011 |
-// resize() method |
6012 |
-// [] operator for setting element |
6013 |
-// value_type defined |
6014 |
-template<double init_function(int,int), class Vector> |
6015 |
-BTL_DONT_INLINE void init_row(Vector & X, int size, int row){ |
6016 |
- |
6017 |
- X.resize(size); |
6018 |
- |
6019 |
- for (int j=0;j<X.size();j++){ |
6020 |
- X[j]=typename Vector::value_type(init_function(row,j)); |
6021 |
- } |
6022 |
-} |
6023 |
- |
6024 |
- |
6025 |
-// Matrix is a Vector of Vector |
6026 |
-// The Matrix class must satisfy the following part of STL vector concept : |
6027 |
-// resize() method |
6028 |
-// [] operator for setting rows |
6029 |
-template<double init_function(int,int),class Vector> |
6030 |
-BTL_DONT_INLINE void init_matrix(Vector & A, int size){ |
6031 |
- A.resize(size); |
6032 |
- for (int row=0; row<A.size() ; row++){ |
6033 |
- init_row<init_function>(A[row],size,row); |
6034 |
- } |
6035 |
-} |
6036 |
- |
6037 |
-template<double init_function(int,int),class Matrix> |
6038 |
-BTL_DONT_INLINE void init_matrix_symm(Matrix& A, int size){ |
6039 |
- A.resize(size); |
6040 |
- for (int row=0; row<A.size() ; row++) |
6041 |
- A[row].resize(size); |
6042 |
- for (int row=0; row<A.size() ; row++){ |
6043 |
- A[row][row] = init_function(row,row); |
6044 |
- for (int col=0; col<row ; col++){ |
6045 |
- double x = init_function(row,col); |
6046 |
- A[row][col] = A[col][row] = x; |
6047 |
- } |
6048 |
- } |
6049 |
-} |
6050 |
- |
6051 |
-template<class Matrix> BTL_DONT_INLINE |
6052 |
-void init_matrix(Matrix& A, const int& size, const unsigned& seed) |
6053 |
-{ |
6054 |
- typedef typename Matrix::value_type value_t; |
6055 |
- A.resize(size*size); |
6056 |
- LinearCongruential rng(seed); |
6057 |
- for (typename Matrix::iterator i = A.begin(), end = A.end(); i != end; ++i) |
6058 |
- *i = rng.get_01(); |
6059 |
-} |
6060 |
- |
6061 |
-template<class Matrix> BTL_DONT_INLINE |
6062 |
-void init_SPD_matrix(Matrix& A, const int& size, const unsigned& seed) |
6063 |
-{ |
6064 |
- typedef typename Matrix::value_type value_t; |
6065 |
- A.resize(size*size); |
6066 |
- LinearCongruential rng(seed); |
6067 |
- for (int r = 0; r < size; ++r) { |
6068 |
- A[r+size*r] = rng.get_01() + size; |
6069 |
- for (int c = r+1; c < size; ++c) { |
6070 |
- const value_t v = rng.get_01(); |
6071 |
- A[r+size*c] = v; |
6072 |
- A[c+size*r] = v; |
6073 |
- } |
6074 |
- } |
6075 |
-} |
6076 |
- |
6077 |
-#endif |
6078 |
|
6079 |
diff --git a/btl/generic_bench/init/init_vector.hh b/btl/generic_bench/init/init_vector.hh |
6080 |
deleted file mode 100644 |
6081 |
index efaf0c9..0000000 |
6082 |
--- a/btl/generic_bench/init/init_vector.hh |
6083 |
+++ /dev/null |
6084 |
@@ -1,37 +0,0 @@ |
6085 |
-//===================================================== |
6086 |
-// File : init_vector.hh |
6087 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
6088 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002 |
6089 |
-//===================================================== |
6090 |
-// |
6091 |
-// This program is free software; you can redistribute it and/or |
6092 |
-// modify it under the terms of the GNU General Public License |
6093 |
-// as published by the Free Software Foundation; either version 2 |
6094 |
-// of the License, or (at your option) any later version. |
6095 |
-// |
6096 |
-// This program is distributed in the hope that it will be useful, |
6097 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6098 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6099 |
-// GNU General Public License for more details. |
6100 |
-// You should have received a copy of the GNU General Public License |
6101 |
-// along with this program; if not, write to the Free Software |
6102 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6103 |
-// |
6104 |
-#ifndef INIT_VECTOR_HH |
6105 |
-#define INIT_VECTOR_HH |
6106 |
- |
6107 |
-// The Vector class must satisfy the following part of STL vector concept : |
6108 |
-// resize() method |
6109 |
-// [] operator for setting element |
6110 |
-// value_type defined |
6111 |
-template<double init_function(int), class Vector> |
6112 |
-void init_vector(Vector & X, int size){ |
6113 |
- |
6114 |
- X.resize(size); |
6115 |
- |
6116 |
- for (int i=0;i<X.size();i++){ |
6117 |
- X[i]=typename Vector::value_type(init_function(i)); |
6118 |
- } |
6119 |
-} |
6120 |
- |
6121 |
-#endif |
6122 |
|
6123 |
diff --git a/btl/generic_bench/static/intel_bench_fixed_size.hh b/btl/generic_bench/static/intel_bench_fixed_size.hh |
6124 |
index b4edcbc..926e617 100644 |
6125 |
--- a/btl/generic_bench/static/intel_bench_fixed_size.hh |
6126 |
+++ b/btl/generic_bench/static/intel_bench_fixed_size.hh |
6127 |
@@ -1,7 +1,7 @@ |
6128 |
//===================================================== |
6129 |
// File : intel_bench_fixed_size.hh |
6130 |
// Author : L. Plagne <laurent.plagne@×××.fr)> |
6131 |
-// Copyright (C) EDF R&D, mar déc 3 18:59:37 CET 2002 |
6132 |
+// Copyright (C) EDF R&D, mar d�c 3 18:59:37 CET 2002 |
6133 |
//===================================================== |
6134 |
// |
6135 |
// This program is free software; you can redistribute it and/or |
6136 |
@@ -55,11 +55,9 @@ double bench_fixed_size(int size, unsigned long long & nb_calc,unsigned long lo |
6137 |
|
6138 |
time_action=time_action/(double(nb_calc)); |
6139 |
|
6140 |
- action.check_result(); |
6141 |
- |
6142 |
time_action=time_action-time_baseline; |
6143 |
|
6144 |
- return action.nb_op_base()/(time_action*1000000.0); |
6145 |
+ return action.fpo()/(time_action*1000000.0); |
6146 |
|
6147 |
} |
6148 |
|
6149 |
|
6150 |
diff --git a/btl/generic_bench/timers/STL_perf_analyzer.hh b/btl/generic_bench/timers/STL_perf_analyzer.hh |
6151 |
deleted file mode 100644 |
6152 |
index c9f894b..0000000 |
6153 |
--- a/btl/generic_bench/timers/STL_perf_analyzer.hh |
6154 |
+++ /dev/null |
6155 |
@@ -1,82 +0,0 @@ |
6156 |
-//===================================================== |
6157 |
-// File : STL_perf_analyzer.hh |
6158 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
6159 |
-// Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002 |
6160 |
-//===================================================== |
6161 |
-// |
6162 |
-// This program is free software; you can redistribute it and/or |
6163 |
-// modify it under the terms of the GNU General Public License |
6164 |
-// as published by the Free Software Foundation; either version 2 |
6165 |
-// of the License, or (at your option) any later version. |
6166 |
-// |
6167 |
-// This program is distributed in the hope that it will be useful, |
6168 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6169 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6170 |
-// GNU General Public License for more details. |
6171 |
-// You should have received a copy of the GNU General Public License |
6172 |
-// along with this program; if not, write to the Free Software |
6173 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6174 |
-// |
6175 |
-#ifndef _STL_PERF_ANALYSER_HH |
6176 |
-#define _STL_PERF_ANALYSER_HH |
6177 |
- |
6178 |
-#include "STL_timer.hh" |
6179 |
-#include "bench_parameter.hh" |
6180 |
- |
6181 |
-template<class ACTION> |
6182 |
-class STL_Perf_Analyzer{ |
6183 |
-public: |
6184 |
- STL_Perf_Analyzer(unsigned long long nb_sample=DEFAULT_NB_SAMPLE):_nb_sample(nb_sample),_chronos() |
6185 |
- { |
6186 |
- MESSAGE("STL_Perf_Analyzer Ctor"); |
6187 |
- }; |
6188 |
- STL_Perf_Analyzer( const STL_Perf_Analyzer & ){ |
6189 |
- INFOS("Copy Ctor not implemented"); |
6190 |
- exit(0); |
6191 |
- }; |
6192 |
- ~STL_Perf_Analyzer( void ){ |
6193 |
- MESSAGE("STL_Perf_Analyzer Dtor"); |
6194 |
- }; |
6195 |
- |
6196 |
- |
6197 |
- inline double eval_mflops(int size) |
6198 |
- { |
6199 |
- |
6200 |
- ACTION action(size); |
6201 |
- |
6202 |
- _chronos.start_baseline(_nb_sample); |
6203 |
- |
6204 |
- do { |
6205 |
- |
6206 |
- action.initialize(); |
6207 |
- } while (_chronos.check()); |
6208 |
- |
6209 |
- double baseline_time=_chronos.get_time(); |
6210 |
- |
6211 |
- _chronos.start(_nb_sample); |
6212 |
- do { |
6213 |
- action.initialize(); |
6214 |
- action.calculate(); |
6215 |
- } while (_chronos.check()); |
6216 |
- |
6217 |
- double calculate_time=_chronos.get_time(); |
6218 |
- |
6219 |
- double corrected_time=calculate_time-baseline_time; |
6220 |
- |
6221 |
- // cout << size <<" "<<baseline_time<<" "<<calculate_time<<" "<<corrected_time<<" "<<action.nb_op_base() << endl; |
6222 |
- |
6223 |
- return action.nb_op_base()/(corrected_time*1000000.0); |
6224 |
- //return action.nb_op_base()/(calculate_time*1000000.0); |
6225 |
- |
6226 |
- } |
6227 |
-private: |
6228 |
- |
6229 |
- STL_Timer _chronos; |
6230 |
- unsigned long long _nb_sample; |
6231 |
- |
6232 |
- |
6233 |
-}; |
6234 |
- |
6235 |
- |
6236 |
- |
6237 |
-#endif |
6238 |
|
6239 |
diff --git a/btl/generic_bench/timers/STL_timer.hh b/btl/generic_bench/timers/STL_timer.hh |
6240 |
deleted file mode 100644 |
6241 |
index 19c54e9..0000000 |
6242 |
--- a/btl/generic_bench/timers/STL_timer.hh |
6243 |
+++ /dev/null |
6244 |
@@ -1,78 +0,0 @@ |
6245 |
-//===================================================== |
6246 |
-// File : STL_Timer.hh |
6247 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
6248 |
-// Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002 |
6249 |
-//===================================================== |
6250 |
-// |
6251 |
-// This program is free software; you can redistribute it and/or |
6252 |
-// modify it under the terms of the GNU General Public License |
6253 |
-// as published by the Free Software Foundation; either version 2 |
6254 |
-// of the License, or (at your option) any later version. |
6255 |
-// |
6256 |
-// This program is distributed in the hope that it will be useful, |
6257 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6258 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6259 |
-// GNU General Public License for more details. |
6260 |
-// You should have received a copy of the GNU General Public License |
6261 |
-// along with this program; if not, write to the Free Software |
6262 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6263 |
-// |
6264 |
-// STL Timer Class. Adapted (L.P.) from the timer class by Musser et Al |
6265 |
-// described int the Book : STL Tutorial and reference guide. |
6266 |
-// Define a timer class for analyzing algorithm performance. |
6267 |
-#include <iostream> |
6268 |
-#include <iomanip> |
6269 |
-#include <vector> |
6270 |
-#include <map> |
6271 |
-#include <algorithm> |
6272 |
-using namespace std; |
6273 |
- |
6274 |
-class STL_Timer { |
6275 |
-public: |
6276 |
- STL_Timer(){ baseline = false; }; // Default constructor |
6277 |
- // Start a series of r trials: |
6278 |
- void start(unsigned int r){ |
6279 |
- reps = r; |
6280 |
- count = 0; |
6281 |
- iterations.clear(); |
6282 |
- iterations.reserve(reps); |
6283 |
- initial = time(0); |
6284 |
- }; |
6285 |
- // Start a series of r trials to determine baseline time: |
6286 |
- void start_baseline(unsigned int r) |
6287 |
- { |
6288 |
- baseline = true; |
6289 |
- start(r); |
6290 |
- } |
6291 |
- // Returns true if the trials have been completed, else false |
6292 |
- bool check() |
6293 |
- { |
6294 |
- ++count; |
6295 |
- final = time(0); |
6296 |
- if (initial < final) { |
6297 |
- iterations.push_back(count); |
6298 |
- initial = final; |
6299 |
- count = 0; |
6300 |
- } |
6301 |
- return (iterations.size() < reps); |
6302 |
- }; |
6303 |
- // Returns the results for external use |
6304 |
- double get_time( void ) |
6305 |
- { |
6306 |
- sort(iterations.begin(), iterations.end()); |
6307 |
- return 1.0/iterations[reps/2]; |
6308 |
- }; |
6309 |
-private: |
6310 |
- unsigned int reps; // Number of trials |
6311 |
- // For storing loop iterations of a trial |
6312 |
- vector<long> iterations; |
6313 |
- // For saving initial and final times of a trial |
6314 |
- time_t initial, final; |
6315 |
- // For counting loop iterations of a trial |
6316 |
- unsigned long count; |
6317 |
- // true if this is a baseline computation, false otherwise |
6318 |
- bool baseline; |
6319 |
- // For recording the baseline time |
6320 |
- double baseline_time; |
6321 |
-}; |
6322 |
- |
6323 |
|
6324 |
diff --git a/btl/generic_bench/timers/distributed_perf_analyzer_node.hh b/btl/generic_bench/timers/distributed_perf_analyzer_node.hh |
6325 |
index 924eb87..d6ec5c2 100644 |
6326 |
--- a/btl/generic_bench/timers/distributed_perf_analyzer_node.hh |
6327 |
+++ b/btl/generic_bench/timers/distributed_perf_analyzer_node.hh |
6328 |
@@ -66,7 +66,6 @@ public: |
6329 |
if (do_check > 0) { |
6330 |
action.initialize(); |
6331 |
action.calculate(); |
6332 |
- action.check_result(); |
6333 |
} |
6334 |
|
6335 |
/* Return a void value */ |
6336 |
|
6337 |
diff --git a/btl/generic_bench/timers/distributed_perf_analyzer_root.hh b/btl/generic_bench/timers/distributed_perf_analyzer_root.hh |
6338 |
index bbab901..1fc7c3c 100644 |
6339 |
--- a/btl/generic_bench/timers/distributed_perf_analyzer_root.hh |
6340 |
+++ b/btl/generic_bench/timers/distributed_perf_analyzer_root.hh |
6341 |
@@ -62,7 +62,7 @@ public: |
6342 |
for (int i = 1; i < tries; ++i) { |
6343 |
Action _action(size); |
6344 |
if (!silent) |
6345 |
- std::cout << " " << _action.nb_op_base()*_nb_calc/(m_time_action*1e6) << " " << std::flush; |
6346 |
+ std::cout << " " << _action.fpo()*_nb_calc/(m_time_action*1e6) << " " << std::flush; |
6347 |
_action.initialize(); |
6348 |
m_time_action = std::min(m_time_action, time_calculate(_action)); |
6349 |
} |
6350 |
@@ -74,10 +74,9 @@ public: |
6351 |
if (do_check > 0) { |
6352 |
action.initialize(); |
6353 |
action.calculate(); |
6354 |
- action.check_result(); |
6355 |
} |
6356 |
|
6357 |
- return action.nb_op_base()/(time_action*1e6); |
6358 |
+ return action.fpo()/(time_action*1e6); |
6359 |
} |
6360 |
|
6361 |
BTL_DONT_INLINE double time_calculate(Action & action) |
6362 |
|
6363 |
diff --git a/btl/generic_bench/timers/mixed_perf_analyzer.hh b/btl/generic_bench/timers/mixed_perf_analyzer.hh |
6364 |
deleted file mode 100644 |
6365 |
index e190236..0000000 |
6366 |
--- a/btl/generic_bench/timers/mixed_perf_analyzer.hh |
6367 |
+++ /dev/null |
6368 |
@@ -1,73 +0,0 @@ |
6369 |
-//===================================================== |
6370 |
-// File : mixed_perf_analyzer.hh |
6371 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
6372 |
-// Copyright (C) EDF R&D, mar déc 3 18:59:36 CET 2002 |
6373 |
-//===================================================== |
6374 |
-// |
6375 |
-// This program is free software; you can redistribute it and/or |
6376 |
-// modify it under the terms of the GNU General Public License |
6377 |
-// as published by the Free Software Foundation; either version 2 |
6378 |
-// of the License, or (at your option) any later version. |
6379 |
-// |
6380 |
-// This program is distributed in the hope that it will be useful, |
6381 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6382 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6383 |
-// GNU General Public License for more details. |
6384 |
-// You should have received a copy of the GNU General Public License |
6385 |
-// along with this program; if not, write to the Free Software |
6386 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6387 |
-// |
6388 |
-#ifndef _MIXED_PERF_ANALYSER_HH |
6389 |
-#define _MIXED_PERF_ANALYSER_HH |
6390 |
- |
6391 |
-#include "x86_perf_analyzer.hh" |
6392 |
-#include "portable_perf_analyzer.hh" |
6393 |
- |
6394 |
-// choose portable perf analyzer for long calculations and x86 analyser for short ones |
6395 |
- |
6396 |
- |
6397 |
-template<class Action> |
6398 |
-class Mixed_Perf_Analyzer{ |
6399 |
- |
6400 |
-public: |
6401 |
- Mixed_Perf_Analyzer( void ):_x86pa(),_ppa(),_use_ppa(true) |
6402 |
- { |
6403 |
- MESSAGE("Mixed_Perf_Analyzer Ctor"); |
6404 |
- }; |
6405 |
- Mixed_Perf_Analyzer( const Mixed_Perf_Analyzer & ){ |
6406 |
- INFOS("Copy Ctor not implemented"); |
6407 |
- exit(0); |
6408 |
- }; |
6409 |
- ~Mixed_Perf_Analyzer( void ){ |
6410 |
- MESSAGE("Mixed_Perf_Analyzer Dtor"); |
6411 |
- }; |
6412 |
- |
6413 |
- |
6414 |
- inline double eval_mflops(int size) |
6415 |
- { |
6416 |
- |
6417 |
- double result=0.0; |
6418 |
- if (_use_ppa){ |
6419 |
- result=_ppa.eval_mflops(size); |
6420 |
- if (_ppa.get_nb_calc()>DEFAULT_NB_SAMPLE){_use_ppa=false;} |
6421 |
- } |
6422 |
- else{ |
6423 |
- result=_x86pa.eval_mflops(size); |
6424 |
- } |
6425 |
- |
6426 |
- return result; |
6427 |
- } |
6428 |
- |
6429 |
-private: |
6430 |
- |
6431 |
- Portable_Perf_Analyzer<Action> _ppa; |
6432 |
- X86_Perf_Analyzer<Action> _x86pa; |
6433 |
- bool _use_ppa; |
6434 |
- |
6435 |
-}; |
6436 |
- |
6437 |
-#endif |
6438 |
- |
6439 |
- |
6440 |
- |
6441 |
- |
6442 |
|
6443 |
diff --git a/btl/generic_bench/timers/portable_perf_analyzer.hh b/btl/generic_bench/timers/portable_perf_analyzer.hh |
6444 |
index b207bde..2c6b568 100644 |
6445 |
--- a/btl/generic_bench/timers/portable_perf_analyzer.hh |
6446 |
+++ b/btl/generic_bench/timers/portable_perf_analyzer.hh |
6447 |
@@ -55,9 +55,9 @@ public: |
6448 |
{ |
6449 |
Action _action(size); |
6450 |
if (!silent) { |
6451 |
- if (_action.nb_op_base()*_nb_calc < 0) |
6452 |
- std::cout << " { op*calc = " << _action.nb_op_base()*_nb_calc << " } " << std::flush; |
6453 |
- std::cout << " " << _action.nb_op_base()*_nb_calc/(m_time_action*1e6) << " "; |
6454 |
+ if (_action.fpo()*_nb_calc < 0) |
6455 |
+ std::cout << " { op*calc = " << _action.fpo()*_nb_calc << " } " << std::flush; |
6456 |
+ std::cout << " " << _action.fpo()*_nb_calc/(m_time_action*1e6) << " "; |
6457 |
} |
6458 |
_action.initialize(); |
6459 |
m_time_action = std::min(m_time_action, time_calculate(_action)); |
6460 |
@@ -70,9 +70,8 @@ public: |
6461 |
{ |
6462 |
action.initialize(); |
6463 |
action.calculate(); |
6464 |
- action.check_result(); |
6465 |
} |
6466 |
- return action.nb_op_base()/(time_action*1e6); |
6467 |
+ return action.fpo()/(time_action*1e6); |
6468 |
} |
6469 |
|
6470 |
BTL_DONT_INLINE double time_calculate(Action & action) |
6471 |
|
6472 |
diff --git a/btl/generic_bench/timers/portable_perf_analyzer_old.hh b/btl/generic_bench/timers/portable_perf_analyzer_old.hh |
6473 |
deleted file mode 100644 |
6474 |
index fce3781..0000000 |
6475 |
--- a/btl/generic_bench/timers/portable_perf_analyzer_old.hh |
6476 |
+++ /dev/null |
6477 |
@@ -1,134 +0,0 @@ |
6478 |
-//===================================================== |
6479 |
-// File : portable_perf_analyzer.hh |
6480 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
6481 |
-// Copyright (C) EDF R&D, mar d�c 3 18:59:35 CET 2002 |
6482 |
-//===================================================== |
6483 |
-// |
6484 |
-// This program is free software; you can redistribute it and/or |
6485 |
-// modify it under the terms of the GNU General Public License |
6486 |
-// as published by the Free Software Foundation; either version 2 |
6487 |
-// of the License, or (at your option) any later version. |
6488 |
-// |
6489 |
-// This program is distributed in the hope that it will be useful, |
6490 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6491 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6492 |
-// GNU General Public License for more details. |
6493 |
-// You should have received a copy of the GNU General Public License |
6494 |
-// along with this program; if not, write to the Free Software |
6495 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6496 |
-// |
6497 |
-#ifndef _PORTABLE_PERF_ANALYZER_HH |
6498 |
-#define _PORTABLE_PERF_ANALYZER_HH |
6499 |
- |
6500 |
-#include "utilities.h" |
6501 |
-#include "timers/portable_timer.hh" |
6502 |
- |
6503 |
-template <class Action> |
6504 |
-class Portable_Perf_Analyzer{ |
6505 |
-public: |
6506 |
- Portable_Perf_Analyzer( void ):_nb_calc(1),_nb_init(1),_chronos(){ |
6507 |
- MESSAGE("Portable_Perf_Analyzer Ctor"); |
6508 |
- }; |
6509 |
- Portable_Perf_Analyzer( const Portable_Perf_Analyzer & ){ |
6510 |
- INFOS("Copy Ctor not implemented"); |
6511 |
- exit(0); |
6512 |
- }; |
6513 |
- ~Portable_Perf_Analyzer( void ){ |
6514 |
- MESSAGE("Portable_Perf_Analyzer Dtor"); |
6515 |
- }; |
6516 |
- |
6517 |
- |
6518 |
- |
6519 |
- inline double eval_mflops(int size) |
6520 |
- { |
6521 |
- |
6522 |
- Action action(size); |
6523 |
- |
6524 |
-// double time_baseline = time_init(action); |
6525 |
-// while (time_baseline < MIN_TIME_INIT) |
6526 |
-// { |
6527 |
-// _nb_init *= 2; |
6528 |
-// time_baseline = time_init(action); |
6529 |
-// } |
6530 |
-// |
6531 |
-// // optimize |
6532 |
-// for (int i=1; i<NB_TRIES; ++i) |
6533 |
-// time_baseline = std::min(time_baseline, time_init(action)); |
6534 |
-// |
6535 |
-// time_baseline = time_baseline/(double(_nb_init)); |
6536 |
- |
6537 |
- double time_action = time_calculate(action); |
6538 |
- while (time_action < MIN_TIME) |
6539 |
- { |
6540 |
- _nb_calc *= 2; |
6541 |
- time_action = time_calculate(action); |
6542 |
- } |
6543 |
- |
6544 |
- // optimize |
6545 |
- for (int i=1; i<NB_TRIES; ++i) |
6546 |
- time_action = std::min(time_action, time_calculate(action)); |
6547 |
- |
6548 |
-// INFOS("size="<<size); |
6549 |
-// INFOS("_nb_init="<<_nb_init); |
6550 |
-// INFOS("_nb_calc="<<_nb_calc); |
6551 |
- |
6552 |
- time_action = time_action / (double(_nb_calc)); |
6553 |
- |
6554 |
- action.check_result(); |
6555 |
- |
6556 |
- |
6557 |
- double time_baseline = time_init(action); |
6558 |
- for (int i=1; i<NB_TRIES; ++i) |
6559 |
- time_baseline = std::min(time_baseline, time_init(action)); |
6560 |
- time_baseline = time_baseline/(double(_nb_init)); |
6561 |
- |
6562 |
- |
6563 |
- |
6564 |
-// INFOS("time_baseline="<<time_baseline); |
6565 |
-// INFOS("time_action="<<time_action); |
6566 |
- |
6567 |
- time_action = time_action - time_baseline; |
6568 |
- |
6569 |
-// INFOS("time_corrected="<<time_action); |
6570 |
- |
6571 |
- return action.nb_op_base()/(time_action*1000000.0); |
6572 |
- } |
6573 |
- |
6574 |
- inline double time_init(Action & action) |
6575 |
- { |
6576 |
- // time measurement |
6577 |
- _chronos.start(); |
6578 |
- for (int ii=0; ii<_nb_init; ii++) |
6579 |
- action.initialize(); |
6580 |
- _chronos.stop(); |
6581 |
- return _chronos.user_time(); |
6582 |
- } |
6583 |
- |
6584 |
- |
6585 |
- inline double time_calculate(Action & action) |
6586 |
- { |
6587 |
- // time measurement |
6588 |
- _chronos.start(); |
6589 |
- for (int ii=0;ii<_nb_calc;ii++) |
6590 |
- { |
6591 |
- action.initialize(); |
6592 |
- action.calculate(); |
6593 |
- } |
6594 |
- _chronos.stop(); |
6595 |
- return _chronos.user_time(); |
6596 |
- } |
6597 |
- |
6598 |
- unsigned long long get_nb_calc( void ) |
6599 |
- { |
6600 |
- return _nb_calc; |
6601 |
- } |
6602 |
- |
6603 |
- |
6604 |
-private: |
6605 |
- unsigned long long _nb_calc; |
6606 |
- unsigned long long _nb_init; |
6607 |
- Portable_Timer _chronos; |
6608 |
- |
6609 |
-}; |
6610 |
- |
6611 |
-#endif //_PORTABLE_PERF_ANALYZER_HH |
6612 |
|
6613 |
diff --git a/btl/generic_bench/timers/x86_perf_analyzer.hh b/btl/generic_bench/timers/x86_perf_analyzer.hh |
6614 |
deleted file mode 100644 |
6615 |
index 37ea21d..0000000 |
6616 |
--- a/btl/generic_bench/timers/x86_perf_analyzer.hh |
6617 |
+++ /dev/null |
6618 |
@@ -1,108 +0,0 @@ |
6619 |
-//===================================================== |
6620 |
-// File : x86_perf_analyzer.hh |
6621 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
6622 |
-// Copyright (C) EDF R&D, mar d�c 3 18:59:35 CET 2002 |
6623 |
-//===================================================== |
6624 |
-// |
6625 |
-// This program is free software; you can redistribute it and/or |
6626 |
-// modify it under the terms of the GNU General Public License |
6627 |
-// as published by the Free Software Foundation; either version 2 |
6628 |
-// of the License, or (at your option) any later version. |
6629 |
-// |
6630 |
-// This program is distributed in the hope that it will be useful, |
6631 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6632 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6633 |
-// GNU General Public License for more details. |
6634 |
-// You should have received a copy of the GNU General Public License |
6635 |
-// along with this program; if not, write to the Free Software |
6636 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6637 |
-// |
6638 |
-#ifndef _X86_PERF_ANALYSER_HH |
6639 |
-#define _X86_PERF_ANALYSER_HH |
6640 |
- |
6641 |
-#include "x86_timer.hh" |
6642 |
-#include "bench_parameter.hh" |
6643 |
- |
6644 |
-template<class ACTION> |
6645 |
-class X86_Perf_Analyzer{ |
6646 |
-public: |
6647 |
- X86_Perf_Analyzer( unsigned long long nb_sample=DEFAULT_NB_SAMPLE):_nb_sample(nb_sample),_chronos() |
6648 |
- { |
6649 |
- MESSAGE("X86_Perf_Analyzer Ctor"); |
6650 |
- _chronos.find_frequency(); |
6651 |
- }; |
6652 |
- X86_Perf_Analyzer( const X86_Perf_Analyzer & ){ |
6653 |
- INFOS("Copy Ctor not implemented"); |
6654 |
- exit(0); |
6655 |
- }; |
6656 |
- ~X86_Perf_Analyzer( void ){ |
6657 |
- MESSAGE("X86_Perf_Analyzer Dtor"); |
6658 |
- }; |
6659 |
- |
6660 |
- |
6661 |
- inline double eval_mflops(int size) |
6662 |
- { |
6663 |
- |
6664 |
- ACTION action(size); |
6665 |
- |
6666 |
- int nb_loop=5; |
6667 |
- double calculate_time=0.0; |
6668 |
- double baseline_time=0.0; |
6669 |
- |
6670 |
- for (int j=0 ; j < nb_loop ; j++){ |
6671 |
- |
6672 |
- _chronos.clear(); |
6673 |
- |
6674 |
- for(int i=0 ; i < _nb_sample ; i++) |
6675 |
- { |
6676 |
- _chronos.start(); |
6677 |
- action.initialize(); |
6678 |
- action.calculate(); |
6679 |
- _chronos.stop(); |
6680 |
- _chronos.add_get_click(); |
6681 |
- } |
6682 |
- |
6683 |
- calculate_time += double(_chronos.get_shortest_clicks())/_chronos.frequency(); |
6684 |
- |
6685 |
- if (j==0) action.check_result(); |
6686 |
- |
6687 |
- _chronos.clear(); |
6688 |
- |
6689 |
- for(int i=0 ; i < _nb_sample ; i++) |
6690 |
- { |
6691 |
- _chronos.start(); |
6692 |
- action.initialize(); |
6693 |
- _chronos.stop(); |
6694 |
- _chronos.add_get_click(); |
6695 |
- |
6696 |
- } |
6697 |
- |
6698 |
- baseline_time+=double(_chronos.get_shortest_clicks())/_chronos.frequency(); |
6699 |
- |
6700 |
- } |
6701 |
- |
6702 |
- double corrected_time = (calculate_time-baseline_time)/double(nb_loop); |
6703 |
- |
6704 |
- |
6705 |
-// INFOS("_nb_sample="<<_nb_sample); |
6706 |
-// INFOS("baseline_time="<<baseline_time); |
6707 |
-// INFOS("calculate_time="<<calculate_time); |
6708 |
-// INFOS("corrected_time="<<corrected_time); |
6709 |
- |
6710 |
-// cout << size <<" "<<baseline_time<<" "<<calculate_time<<" "<<corrected_time<<" "<<action.nb_op_base() << endl; |
6711 |
- |
6712 |
- return action.nb_op_base()/(corrected_time*1000000.0); |
6713 |
- //return action.nb_op_base()/(calculate_time*1000000.0); |
6714 |
- } |
6715 |
- |
6716 |
-private: |
6717 |
- |
6718 |
- X86_Timer _chronos; |
6719 |
- unsigned long long _nb_sample; |
6720 |
- |
6721 |
- |
6722 |
-}; |
6723 |
- |
6724 |
- |
6725 |
- |
6726 |
-#endif |
6727 |
|
6728 |
diff --git a/btl/generic_bench/timers/x86_timer.hh b/btl/generic_bench/timers/x86_timer.hh |
6729 |
deleted file mode 100644 |
6730 |
index cfb5ee8..0000000 |
6731 |
--- a/btl/generic_bench/timers/x86_timer.hh |
6732 |
+++ /dev/null |
6733 |
@@ -1,246 +0,0 @@ |
6734 |
-//===================================================== |
6735 |
-// File : x86_timer.hh |
6736 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
6737 |
-// Copyright (C) EDF R&D, mar d�c 3 18:59:35 CET 2002 |
6738 |
-//===================================================== |
6739 |
-// |
6740 |
-// This program is free software; you can redistribute it and/or |
6741 |
-// modify it under the terms of the GNU General Public License |
6742 |
-// as published by the Free Software Foundation; either version 2 |
6743 |
-// of the License, or (at your option) any later version. |
6744 |
-// |
6745 |
-// This program is distributed in the hope that it will be useful, |
6746 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6747 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6748 |
-// GNU General Public License for more details. |
6749 |
-// You should have received a copy of the GNU General Public License |
6750 |
-// along with this program; if not, write to the Free Software |
6751 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6752 |
-// |
6753 |
-#ifndef _X86_TIMER_HH |
6754 |
-#define _X86_TIMER_HH |
6755 |
- |
6756 |
-#include <sys/time.h> |
6757 |
-#include <sys/resource.h> |
6758 |
-#include <unistd.h> |
6759 |
-#include <sys/times.h> |
6760 |
-//#include "system_time.h" |
6761 |
-#define u32 unsigned int |
6762 |
-#include <asm/msr.h> |
6763 |
-#include "utilities.h" |
6764 |
-#include <map> |
6765 |
-#include <fstream> |
6766 |
-#include <string> |
6767 |
-#include <iostream> |
6768 |
- |
6769 |
-// frequence de la becanne en Hz |
6770 |
-//#define FREQUENCY 648000000 |
6771 |
-//#define FREQUENCY 1400000000 |
6772 |
-#define FREQUENCY 1695000000 |
6773 |
- |
6774 |
-using namespace std; |
6775 |
- |
6776 |
- |
6777 |
-class X86_Timer { |
6778 |
- |
6779 |
-public : |
6780 |
- |
6781 |
- X86_Timer( void ):_frequency(FREQUENCY),_nb_sample(0) |
6782 |
- { |
6783 |
- MESSAGE("X86_Timer Default Ctor"); |
6784 |
- } |
6785 |
- |
6786 |
- inline void start( void ){ |
6787 |
- |
6788 |
- rdtsc(_click_start.n32[0],_click_start.n32[1]); |
6789 |
- |
6790 |
- } |
6791 |
- |
6792 |
- |
6793 |
- inline void stop( void ){ |
6794 |
- |
6795 |
- rdtsc(_click_stop.n32[0],_click_stop.n32[1]); |
6796 |
- |
6797 |
- } |
6798 |
- |
6799 |
- |
6800 |
- inline double frequency( void ){ |
6801 |
- return _frequency; |
6802 |
- } |
6803 |
- |
6804 |
- double get_elapsed_time_in_second( void ){ |
6805 |
- |
6806 |
- return (_click_stop.n64-_click_start.n64)/double(FREQUENCY); |
6807 |
- |
6808 |
- |
6809 |
- } |
6810 |
- |
6811 |
- unsigned long long get_click( void ){ |
6812 |
- |
6813 |
- return (_click_stop.n64-_click_start.n64); |
6814 |
- |
6815 |
- } |
6816 |
- |
6817 |
- inline void find_frequency( void ){ |
6818 |
- |
6819 |
- time_t initial, final; |
6820 |
- int dummy=2; |
6821 |
- |
6822 |
- initial = time(0); |
6823 |
- start(); |
6824 |
- do { |
6825 |
- dummy+=2; |
6826 |
- } |
6827 |
- while(time(0)==initial); |
6828 |
- // On est au debut d'un cycle d'une seconde !!! |
6829 |
- initial = time(0); |
6830 |
- start(); |
6831 |
- do { |
6832 |
- dummy+=2; |
6833 |
- } |
6834 |
- while(time(0)==initial); |
6835 |
- final=time(0); |
6836 |
- stop(); |
6837 |
- // INFOS("fine grained time : "<< get_elapsed_time_in_second()); |
6838 |
- // INFOS("coarse grained time : "<< final-initial); |
6839 |
- _frequency=_frequency*get_elapsed_time_in_second()/double(final-initial); |
6840 |
- /// INFOS("CPU frequency : "<< _frequency); |
6841 |
- |
6842 |
- } |
6843 |
- |
6844 |
- void add_get_click( void ){ |
6845 |
- |
6846 |
- _nb_sample++; |
6847 |
- _counted_clicks[get_click()]++; |
6848 |
- fill_history_clicks(); |
6849 |
- |
6850 |
- } |
6851 |
- |
6852 |
- void dump_statistics(string filemane){ |
6853 |
- |
6854 |
- ofstream outfile (filemane.c_str(),ios::out) ; |
6855 |
- |
6856 |
- std::map<unsigned long long , unsigned long long>::iterator itr; |
6857 |
- for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) |
6858 |
- { |
6859 |
- outfile << (*itr).first << " " << (*itr).second << endl ; |
6860 |
- } |
6861 |
- |
6862 |
- outfile.close(); |
6863 |
- |
6864 |
- } |
6865 |
- |
6866 |
- void dump_history(string filemane){ |
6867 |
- |
6868 |
- ofstream outfile (filemane.c_str(),ios::out) ; |
6869 |
- |
6870 |
- |
6871 |
- |
6872 |
- for(int i=0 ; i<_history_mean_clicks.size() ; i++) |
6873 |
- { |
6874 |
- outfile << i << " " |
6875 |
- << _history_mean_clicks[i] << " " |
6876 |
- << _history_shortest_clicks[i] << " " |
6877 |
- << _history_most_occured_clicks[i] << endl ; |
6878 |
- } |
6879 |
- |
6880 |
- outfile.close(); |
6881 |
- |
6882 |
- } |
6883 |
- |
6884 |
- |
6885 |
- |
6886 |
- double get_mean_clicks( void ){ |
6887 |
- |
6888 |
- std::map<unsigned long long,unsigned long long>::iterator itr; |
6889 |
- |
6890 |
- unsigned long long mean_clicks=0; |
6891 |
- |
6892 |
- for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) |
6893 |
- { |
6894 |
- |
6895 |
- mean_clicks+=(*itr).second*(*itr).first; |
6896 |
- } |
6897 |
- |
6898 |
- return mean_clicks/double(_nb_sample); |
6899 |
- |
6900 |
- } |
6901 |
- |
6902 |
- double get_shortest_clicks( void ){ |
6903 |
- |
6904 |
- return double((*_counted_clicks.begin()).first); |
6905 |
- |
6906 |
- } |
6907 |
- |
6908 |
- void fill_history_clicks( void ){ |
6909 |
- |
6910 |
- _history_mean_clicks.push_back(get_mean_clicks()); |
6911 |
- _history_shortest_clicks.push_back(get_shortest_clicks()); |
6912 |
- _history_most_occured_clicks.push_back(get_most_occured_clicks()); |
6913 |
- |
6914 |
- } |
6915 |
- |
6916 |
- |
6917 |
- double get_most_occured_clicks( void ){ |
6918 |
- |
6919 |
- unsigned long long moc=0; |
6920 |
- unsigned long long max_occurence=0; |
6921 |
- |
6922 |
- std::map<unsigned long long,unsigned long long>::iterator itr; |
6923 |
- |
6924 |
- for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) |
6925 |
- { |
6926 |
- |
6927 |
- if (max_occurence<=(*itr).second){ |
6928 |
- max_occurence=(*itr).second; |
6929 |
- moc=(*itr).first; |
6930 |
- } |
6931 |
- } |
6932 |
- |
6933 |
- return double(moc); |
6934 |
- |
6935 |
- } |
6936 |
- |
6937 |
- void clear( void ) |
6938 |
- { |
6939 |
- _counted_clicks.clear(); |
6940 |
- |
6941 |
- _history_mean_clicks.clear(); |
6942 |
- _history_shortest_clicks.clear(); |
6943 |
- _history_most_occured_clicks.clear(); |
6944 |
- |
6945 |
- _nb_sample=0; |
6946 |
- } |
6947 |
- |
6948 |
- |
6949 |
- |
6950 |
-private : |
6951 |
- |
6952 |
- union |
6953 |
- { |
6954 |
- unsigned long int n32[2] ; |
6955 |
- unsigned long long n64 ; |
6956 |
- } _click_start; |
6957 |
- |
6958 |
- union |
6959 |
- { |
6960 |
- unsigned long int n32[2] ; |
6961 |
- unsigned long long n64 ; |
6962 |
- } _click_stop; |
6963 |
- |
6964 |
- double _frequency ; |
6965 |
- |
6966 |
- map<unsigned long long,unsigned long long> _counted_clicks; |
6967 |
- |
6968 |
- vector<double> _history_mean_clicks; |
6969 |
- vector<double> _history_shortest_clicks; |
6970 |
- vector<double> _history_most_occured_clicks; |
6971 |
- |
6972 |
- unsigned long long _nb_sample; |
6973 |
- |
6974 |
- |
6975 |
- |
6976 |
-}; |
6977 |
- |
6978 |
- |
6979 |
-#endif |
6980 |
|
6981 |
diff --git a/btl/generic_bench/utils/LinearCongruential.hh b/btl/generic_bench/utils/LinearCongruential.hh |
6982 |
deleted file mode 100644 |
6983 |
index 3aa3716..0000000 |
6984 |
--- a/btl/generic_bench/utils/LinearCongruential.hh |
6985 |
+++ /dev/null |
6986 |
@@ -1,83 +0,0 @@ |
6987 |
-//===================================================== |
6988 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
6989 |
-//===================================================== |
6990 |
-// |
6991 |
-// This program is free software; you can redistribute it and/or |
6992 |
-// modify it under the terms of the GNU General Public License |
6993 |
-// as published by the Free Software Foundation; either version 2 |
6994 |
-// of the License, or (at your option) any later version. |
6995 |
-// |
6996 |
-// This program is distributed in the hope that it will be useful, |
6997 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
6998 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
6999 |
-// GNU General Public License for more details. |
7000 |
-// You should have received a copy of the GNU General Public License |
7001 |
-// along with this program; if not, write to the Free Software |
7002 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
7003 |
-// |
7004 |
-#ifndef LINEARCONGRUENTIAL_HH_ |
7005 |
-#define LINEARCONGRUENTIAL_HH_ |
7006 |
- |
7007 |
-#include <vector> |
7008 |
- |
7009 |
-class LinearCongruential |
7010 |
-{ |
7011 |
- typedef std::vector<unsigned> buffer_t; |
7012 |
- typedef unsigned int_t; |
7013 |
- |
7014 |
-public: |
7015 |
- LinearCongruential(const int_t& seed) : |
7016 |
- a_(1664525u), c_(1013904223u), m_(getM()), i_(0) |
7017 |
- { |
7018 |
- buffer_.resize(4096/sizeof(unsigned)); |
7019 |
- fillBuffer(seed); |
7020 |
- } |
7021 |
- |
7022 |
- int_t a() const { return a_; } |
7023 |
- int_t c() const { return c_; } |
7024 |
- int_t m() const { return m_; } |
7025 |
- |
7026 |
- int_t get_int() { |
7027 |
- if (i_ >= buffer_.size()) { |
7028 |
- fillBuffer(); |
7029 |
- i_ = 0; |
7030 |
- } |
7031 |
- return buffer_.at(i_++); |
7032 |
- } |
7033 |
- |
7034 |
- double get_01() { |
7035 |
- return static_cast<double>(get_int())/static_cast<double>(m_); |
7036 |
- } |
7037 |
- |
7038 |
-private: |
7039 |
- buffer_t buffer_; |
7040 |
- const int_t a_, c_, m_; |
7041 |
- std::size_t i_; |
7042 |
- |
7043 |
- void fillBuffer(const int_t& seed) |
7044 |
- { |
7045 |
- buffer_.front() = (seed*a_+c_) & m_; |
7046 |
- for ( |
7047 |
- typename buffer_t::iterator i = buffer_.begin()+1, end = buffer_.end(); |
7048 |
- i != end; ++i) |
7049 |
- *i = (*(i-1)*a_ + c_) & m_; |
7050 |
- } |
7051 |
- |
7052 |
- void fillBuffer() |
7053 |
- { |
7054 |
- const int_t seed = buffer_.back(); |
7055 |
- fillBuffer(seed); |
7056 |
- } |
7057 |
- |
7058 |
- static int_t getM() |
7059 |
- { |
7060 |
- int_t _m = 1; |
7061 |
- for (int i = 1; i < 32; ++i) { |
7062 |
- _m <<= 1; |
7063 |
- _m += 1; |
7064 |
- } |
7065 |
- return _m; |
7066 |
- } |
7067 |
-}; |
7068 |
- |
7069 |
-#endif /* LINEARCONGRUENTIAL_HH_ */ |
7070 |
|
7071 |
diff --git a/btl/generic_bench/utils/LinearCongruential.hpp b/btl/generic_bench/utils/LinearCongruential.hpp |
7072 |
new file mode 100644 |
7073 |
index 0000000..a735f77 |
7074 |
--- /dev/null |
7075 |
+++ b/btl/generic_bench/utils/LinearCongruential.hpp |
7076 |
@@ -0,0 +1,77 @@ |
7077 |
+#ifndef LINEARCONGRUENTIAL_HPP |
7078 |
+#define LINEARCONGRUENTIAL_HPP |
7079 |
+ |
7080 |
+#include "stdint.h" |
7081 |
+#include <vector> |
7082 |
+#include <limits> |
7083 |
+ |
7084 |
+template< |
7085 |
+ typename value_t = uint32_t, |
7086 |
+ value_t a = 1664525u, |
7087 |
+ value_t c = 1013904223u |
7088 |
+> |
7089 |
+class LinearCongruential { |
7090 |
+ typedef typename std::vector<value_t> buf_t; |
7091 |
+ typedef typename buf_t::iterator iterator_t; |
7092 |
+ typedef typename buf_t::const_iterator constiterator_t; |
7093 |
+ |
7094 |
+public: |
7095 |
+ LinearCongruential(const value_t& seed, const int bufsize = 4*1024) |
7096 |
+ : maxvalue(std::numeric_limits<value_t>::max()) |
7097 |
+ { |
7098 |
+ buffer.resize(bufsize); |
7099 |
+ fillBuffer(seed); |
7100 |
+ } |
7101 |
+ |
7102 |
+ value_t operator()() |
7103 |
+ { |
7104 |
+ if (j == buffer.end()) |
7105 |
+ fillBuffer(buffer.back()); |
7106 |
+ return *(j++); |
7107 |
+ } |
7108 |
+ |
7109 |
+ template<typename result_t> |
7110 |
+ void fillVector ( |
7111 |
+ result_t *vector, |
7112 |
+ const int& size, |
7113 |
+ const result_t& min = 0., |
7114 |
+ const result_t& max = 1. |
7115 |
+ ) |
7116 |
+ { |
7117 |
+ const result_t maxvalue = this->maxvalue; |
7118 |
+ const result_t diff = max-min; |
7119 |
+ |
7120 |
+ for (const result_t *const endp = vector+size; vector!=endp; ++vector) |
7121 |
+ *vector = diff * (this->operator()() / maxvalue) + min; |
7122 |
+ } |
7123 |
+ |
7124 |
+ |
7125 |
+ template<typename result_t> |
7126 |
+ std::vector<result_t> fillVector ( |
7127 |
+ const int& size, |
7128 |
+ const result_t& min = 0., |
7129 |
+ const result_t& max = 1. |
7130 |
+ ) |
7131 |
+ { |
7132 |
+ std::vector<result_t> result(size); |
7133 |
+ fillVector(&result[0], size, min, max); |
7134 |
+ return result; |
7135 |
+ } |
7136 |
+ |
7137 |
+private: |
7138 |
+ buf_t buffer; |
7139 |
+ constiterator_t j; |
7140 |
+ |
7141 |
+ const value_t maxvalue; |
7142 |
+ |
7143 |
+ void fillBuffer(int seed) |
7144 |
+ { |
7145 |
+ for (iterator_t i = buffer.begin(), e = buffer.end(); i!=e; ++i) { |
7146 |
+ *i = ((seed *= a) += c); |
7147 |
+ } |
7148 |
+ |
7149 |
+ j = buffer.begin(); |
7150 |
+ } |
7151 |
+}; |
7152 |
+ |
7153 |
+#endif // LINEARCONGRUENTIAL_HPP |
7154 |
|
7155 |
diff --git a/btl/libs/BLAS/CMakeLists.txt b/btl/libs/BLAS/CMakeLists.txt |
7156 |
deleted file mode 100644 |
7157 |
index de42fe0..0000000 |
7158 |
--- a/btl/libs/BLAS/CMakeLists.txt |
7159 |
+++ /dev/null |
7160 |
@@ -1,60 +0,0 @@ |
7161 |
- |
7162 |
-find_package(ATLAS) |
7163 |
-if (ATLAS_FOUND) |
7164 |
- btl_add_bench(btl_atlas main.cpp) |
7165 |
- if(BUILD_btl_atlas) |
7166 |
- target_link_libraries(btl_atlas ${ATLAS_LIBRARIES}) |
7167 |
- set_target_properties(btl_atlas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ATLAS -DHAS_LAPACK=1") |
7168 |
- endif(BUILD_btl_atlas) |
7169 |
-endif (ATLAS_FOUND) |
7170 |
- |
7171 |
-find_package(MKL) |
7172 |
-if (MKL_FOUND) |
7173 |
- btl_add_bench(btl_mkl main.cpp) |
7174 |
- if(BUILD_btl_mkl) |
7175 |
- target_link_libraries(btl_mkl ${MKL_LIBRARIES}) |
7176 |
- set_target_properties(btl_mkl PROPERTIES COMPILE_FLAGS "-DCBLASNAME=INTEL_MKL -DHAS_LAPACK=1") |
7177 |
- endif(BUILD_btl_mkl) |
7178 |
-endif (MKL_FOUND) |
7179 |
- |
7180 |
- |
7181 |
-find_package(GOTO2) |
7182 |
-if (GOTO2_FOUND) |
7183 |
- btl_add_bench(btl_goto2 main.cpp) |
7184 |
- if(BUILD_btl_goto2) |
7185 |
- target_link_libraries(btl_goto2 ${GOTO_LIBRARIES} ) |
7186 |
- set_target_properties(btl_goto2 PROPERTIES COMPILE_FLAGS "-DCBLASNAME=GOTO2") |
7187 |
- endif(BUILD_btl_goto2) |
7188 |
-endif (GOTO2_FOUND) |
7189 |
- |
7190 |
-find_package(GOTO) |
7191 |
-if (GOTO_FOUND) |
7192 |
- if(GOTO2_FOUND) |
7193 |
- btl_add_bench(btl_goto main.cpp OFF) |
7194 |
- else() |
7195 |
- btl_add_bench(btl_goto main.cpp) |
7196 |
- endif() |
7197 |
- if(BUILD_btl_goto) |
7198 |
- target_link_libraries(btl_goto ${GOTO_LIBRARIES} ) |
7199 |
- set_target_properties(btl_goto PROPERTIES COMPILE_FLAGS "-DCBLASNAME=GOTO") |
7200 |
- endif(BUILD_btl_goto) |
7201 |
-endif (GOTO_FOUND) |
7202 |
- |
7203 |
-find_package(ACML) |
7204 |
-if (ACML_FOUND) |
7205 |
- btl_add_bench(btl_acml main.cpp) |
7206 |
- if(BUILD_btl_acml) |
7207 |
- target_link_libraries(btl_acml ${ACML_LIBRARIES} ) |
7208 |
- set_target_properties(btl_acml PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ACML -DHAS_LAPACK=1") |
7209 |
- endif(BUILD_btl_acml) |
7210 |
-endif (ACML_FOUND) |
7211 |
- |
7212 |
-if(Eigen_SOURCE_DIR AND CMAKE_Fortran_COMPILER_WORKS) |
7213 |
- # we are inside Eigen and blas/lapack interface is compilable |
7214 |
- include_directories(${Eigen_SOURCE_DIR}) |
7215 |
- btl_add_bench(btl_eigenblas main.cpp) |
7216 |
- if(BUILD_btl_eigenblas) |
7217 |
- target_link_libraries(btl_eigenblas eigen_blas eigen_lapack ) |
7218 |
- set_target_properties(btl_eigenblas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=EigenBLAS") |
7219 |
- endif() |
7220 |
-endif() |
7221 |
|
7222 |
diff --git a/btl/libs/BLAS/blas.h b/btl/libs/BLAS/blas.h |
7223 |
deleted file mode 100644 |
7224 |
index 25607a5..0000000 |
7225 |
--- a/btl/libs/BLAS/blas.h |
7226 |
+++ /dev/null |
7227 |
@@ -1,681 +0,0 @@ |
7228 |
-#ifndef BLAS_H |
7229 |
-#define BLAS_H |
7230 |
- |
7231 |
-#define BLASFUNC(FUNC) FUNC##_ |
7232 |
- |
7233 |
-#ifdef __WIN64__ |
7234 |
-typedef long long BLASLONG; |
7235 |
-typedef unsigned long long BLASULONG; |
7236 |
-#else |
7237 |
-typedef long BLASLONG; |
7238 |
-typedef unsigned long BLASULONG; |
7239 |
-#endif |
7240 |
- |
7241 |
-#include <complex> |
7242 |
- |
7243 |
-extern "C" { |
7244 |
- |
7245 |
-int BLASFUNC(xerbla)(const char *, int *info, int); |
7246 |
- |
7247 |
-float BLASFUNC(sdot) (int *, float *, int *, float *, int *); |
7248 |
-float BLASFUNC(sdsdot)(int *, float *, float *, int *, float *, int *); |
7249 |
- |
7250 |
-double BLASFUNC(dsdot) (int *, float *, int *, float *, int *); |
7251 |
-double BLASFUNC(ddot) (int *, double *, int *, double *, int *); |
7252 |
-double BLASFUNC(qdot) (int *, double *, int *, double *, int *); |
7253 |
- |
7254 |
-#if defined(F_INTERFACE_GFORT) && !defined(__64BIT__) |
7255 |
-int BLASFUNC(cdotu) (int *, float * , int *, float *, int *); |
7256 |
-int BLASFUNC(cdotc) (int *, float *, int *, float *, int *); |
7257 |
-void BLASFUNC(zdotu) (double *, int *, double *, int *, double *, int *); |
7258 |
-void BLASFUNC(zdotc) (double *, int *, double *, int *, double *, int *); |
7259 |
-void BLASFUNC(xdotu) (double *, int *, double *, int *, double *, int *); |
7260 |
-void BLASFUNC(xdotc) (double *, int *, double *, int *, double *, int *); |
7261 |
-#elif defined(F_INTERFACE_F2C) || \ |
7262 |
- defined(F_INTERFACE_PGI) || \ |
7263 |
- defined(F_INTERFACE_GFORT) || \ |
7264 |
- (defined(F_INTERFACE_PATHSCALE) && defined(__64BIT__)) |
7265 |
-void BLASFUNC(cdotu) (float *, int *, float * , int *, float *, int *); |
7266 |
-void BLASFUNC(cdotc) (float *, int *, float *, int *, float *, int *); |
7267 |
-void BLASFUNC(zdotu) (double *, int *, double *, int *, double *, int *); |
7268 |
-void BLASFUNC(zdotc) (double *, int *, double *, int *, double *, int *); |
7269 |
-void BLASFUNC(xdotu) (double *, int *, double *, int *, double *, int *); |
7270 |
-void BLASFUNC(xdotc) (double *, int *, double *, int *, double *, int *); |
7271 |
-#else |
7272 |
-std::complex<float> BLASFUNC(cdotu) (int *, float *, int *, float *, int *); |
7273 |
-std::complex<float> BLASFUNC(cdotc) (int *, float *, int *, float *, int *); |
7274 |
-std::complex<double> BLASFUNC(zdotu) (int *, double *, int *, double *, int *); |
7275 |
-std::complex<double> BLASFUNC(zdotc) (int *, double *, int *, double *, int *); |
7276 |
-double BLASFUNC(xdotu) (int *, double *, int *, double *, int *); |
7277 |
-double BLASFUNC(xdotc) (int *, double *, int *, double *, int *); |
7278 |
-#endif |
7279 |
- |
7280 |
-int BLASFUNC(cdotuw) (int *, float *, int *, float *, int *, float*); |
7281 |
-int BLASFUNC(cdotcw) (int *, float *, int *, float *, int *, float*); |
7282 |
-int BLASFUNC(zdotuw) (int *, double *, int *, double *, int *, double*); |
7283 |
-int BLASFUNC(zdotcw) (int *, double *, int *, double *, int *, double*); |
7284 |
- |
7285 |
-int BLASFUNC(saxpy) (int *, float *, float *, int *, float *, int *); |
7286 |
-int BLASFUNC(daxpy) (int *, double *, double *, int *, double *, int *); |
7287 |
-int BLASFUNC(qaxpy) (int *, double *, double *, int *, double *, int *); |
7288 |
-int BLASFUNC(caxpy) (int *, float *, float *, int *, float *, int *); |
7289 |
-int BLASFUNC(zaxpy) (int *, double *, double *, int *, double *, int *); |
7290 |
-int BLASFUNC(xaxpy) (int *, double *, double *, int *, double *, int *); |
7291 |
-int BLASFUNC(caxpyc)(int *, float *, float *, int *, float *, int *); |
7292 |
-int BLASFUNC(zaxpyc)(int *, double *, double *, int *, double *, int *); |
7293 |
-int BLASFUNC(xaxpyc)(int *, double *, double *, int *, double *, int *); |
7294 |
- |
7295 |
-int BLASFUNC(scopy) (int *, float *, int *, float *, int *); |
7296 |
-int BLASFUNC(dcopy) (int *, double *, int *, double *, int *); |
7297 |
-int BLASFUNC(qcopy) (int *, double *, int *, double *, int *); |
7298 |
-int BLASFUNC(ccopy) (int *, float *, int *, float *, int *); |
7299 |
-int BLASFUNC(zcopy) (int *, double *, int *, double *, int *); |
7300 |
-int BLASFUNC(xcopy) (int *, double *, int *, double *, int *); |
7301 |
- |
7302 |
-int BLASFUNC(sswap) (int *, float *, int *, float *, int *); |
7303 |
-int BLASFUNC(dswap) (int *, double *, int *, double *, int *); |
7304 |
-int BLASFUNC(qswap) (int *, double *, int *, double *, int *); |
7305 |
-int BLASFUNC(cswap) (int *, float *, int *, float *, int *); |
7306 |
-int BLASFUNC(zswap) (int *, double *, int *, double *, int *); |
7307 |
-int BLASFUNC(xswap) (int *, double *, int *, double *, int *); |
7308 |
- |
7309 |
-float BLASFUNC(sasum) (int *, float *, int *); |
7310 |
-float BLASFUNC(scasum)(int *, float *, int *); |
7311 |
-double BLASFUNC(dasum) (int *, double *, int *); |
7312 |
-double BLASFUNC(qasum) (int *, double *, int *); |
7313 |
-double BLASFUNC(dzasum)(int *, double *, int *); |
7314 |
-double BLASFUNC(qxasum)(int *, double *, int *); |
7315 |
- |
7316 |
-int BLASFUNC(isamax)(int *, float *, int *); |
7317 |
-int BLASFUNC(idamax)(int *, double *, int *); |
7318 |
-int BLASFUNC(iqamax)(int *, double *, int *); |
7319 |
-int BLASFUNC(icamax)(int *, float *, int *); |
7320 |
-int BLASFUNC(izamax)(int *, double *, int *); |
7321 |
-int BLASFUNC(ixamax)(int *, double *, int *); |
7322 |
- |
7323 |
-int BLASFUNC(ismax) (int *, float *, int *); |
7324 |
-int BLASFUNC(idmax) (int *, double *, int *); |
7325 |
-int BLASFUNC(iqmax) (int *, double *, int *); |
7326 |
-int BLASFUNC(icmax) (int *, float *, int *); |
7327 |
-int BLASFUNC(izmax) (int *, double *, int *); |
7328 |
-int BLASFUNC(ixmax) (int *, double *, int *); |
7329 |
- |
7330 |
-int BLASFUNC(isamin)(int *, float *, int *); |
7331 |
-int BLASFUNC(idamin)(int *, double *, int *); |
7332 |
-int BLASFUNC(iqamin)(int *, double *, int *); |
7333 |
-int BLASFUNC(icamin)(int *, float *, int *); |
7334 |
-int BLASFUNC(izamin)(int *, double *, int *); |
7335 |
-int BLASFUNC(ixamin)(int *, double *, int *); |
7336 |
- |
7337 |
-int BLASFUNC(ismin)(int *, float *, int *); |
7338 |
-int BLASFUNC(idmin)(int *, double *, int *); |
7339 |
-int BLASFUNC(iqmin)(int *, double *, int *); |
7340 |
-int BLASFUNC(icmin)(int *, float *, int *); |
7341 |
-int BLASFUNC(izmin)(int *, double *, int *); |
7342 |
-int BLASFUNC(ixmin)(int *, double *, int *); |
7343 |
- |
7344 |
-float BLASFUNC(samax) (int *, float *, int *); |
7345 |
-double BLASFUNC(damax) (int *, double *, int *); |
7346 |
-double BLASFUNC(qamax) (int *, double *, int *); |
7347 |
-float BLASFUNC(scamax)(int *, float *, int *); |
7348 |
-double BLASFUNC(dzamax)(int *, double *, int *); |
7349 |
-double BLASFUNC(qxamax)(int *, double *, int *); |
7350 |
- |
7351 |
-float BLASFUNC(samin) (int *, float *, int *); |
7352 |
-double BLASFUNC(damin) (int *, double *, int *); |
7353 |
-double BLASFUNC(qamin) (int *, double *, int *); |
7354 |
-float BLASFUNC(scamin)(int *, float *, int *); |
7355 |
-double BLASFUNC(dzamin)(int *, double *, int *); |
7356 |
-double BLASFUNC(qxamin)(int *, double *, int *); |
7357 |
- |
7358 |
-float BLASFUNC(smax) (int *, float *, int *); |
7359 |
-double BLASFUNC(dmax) (int *, double *, int *); |
7360 |
-double BLASFUNC(qmax) (int *, double *, int *); |
7361 |
-float BLASFUNC(scmax) (int *, float *, int *); |
7362 |
-double BLASFUNC(dzmax) (int *, double *, int *); |
7363 |
-double BLASFUNC(qxmax) (int *, double *, int *); |
7364 |
- |
7365 |
-float BLASFUNC(smin) (int *, float *, int *); |
7366 |
-double BLASFUNC(dmin) (int *, double *, int *); |
7367 |
-double BLASFUNC(qmin) (int *, double *, int *); |
7368 |
-float BLASFUNC(scmin) (int *, float *, int *); |
7369 |
-double BLASFUNC(dzmin) (int *, double *, int *); |
7370 |
-double BLASFUNC(qxmin) (int *, double *, int *); |
7371 |
- |
7372 |
-int BLASFUNC(sscal) (int *, float *, float *, int *); |
7373 |
-int BLASFUNC(dscal) (int *, double *, double *, int *); |
7374 |
-int BLASFUNC(qscal) (int *, double *, double *, int *); |
7375 |
-int BLASFUNC(cscal) (int *, float *, float *, int *); |
7376 |
-int BLASFUNC(zscal) (int *, double *, double *, int *); |
7377 |
-int BLASFUNC(xscal) (int *, double *, double *, int *); |
7378 |
-int BLASFUNC(csscal)(int *, float *, float *, int *); |
7379 |
-int BLASFUNC(zdscal)(int *, double *, double *, int *); |
7380 |
-int BLASFUNC(xqscal)(int *, double *, double *, int *); |
7381 |
- |
7382 |
-float BLASFUNC(snrm2) (int *, float *, int *); |
7383 |
-float BLASFUNC(scnrm2)(int *, float *, int *); |
7384 |
- |
7385 |
-double BLASFUNC(dnrm2) (int *, double *, int *); |
7386 |
-double BLASFUNC(qnrm2) (int *, double *, int *); |
7387 |
-double BLASFUNC(dznrm2)(int *, double *, int *); |
7388 |
-double BLASFUNC(qxnrm2)(int *, double *, int *); |
7389 |
- |
7390 |
-int BLASFUNC(srot) (int *, float *, int *, float *, int *, float *, float *); |
7391 |
-int BLASFUNC(drot) (int *, double *, int *, double *, int *, double *, double *); |
7392 |
-int BLASFUNC(qrot) (int *, double *, int *, double *, int *, double *, double *); |
7393 |
-int BLASFUNC(csrot) (int *, float *, int *, float *, int *, float *, float *); |
7394 |
-int BLASFUNC(zdrot) (int *, double *, int *, double *, int *, double *, double *); |
7395 |
-int BLASFUNC(xqrot) (int *, double *, int *, double *, int *, double *, double *); |
7396 |
- |
7397 |
-int BLASFUNC(srotg) (float *, float *, float *, float *); |
7398 |
-int BLASFUNC(drotg) (double *, double *, double *, double *); |
7399 |
-int BLASFUNC(qrotg) (double *, double *, double *, double *); |
7400 |
-int BLASFUNC(crotg) (float *, float *, float *, float *); |
7401 |
-int BLASFUNC(zrotg) (double *, double *, double *, double *); |
7402 |
-int BLASFUNC(xrotg) (double *, double *, double *, double *); |
7403 |
- |
7404 |
-int BLASFUNC(srotmg)(float *, float *, float *, float *, float *); |
7405 |
-int BLASFUNC(drotmg)(double *, double *, double *, double *, double *); |
7406 |
- |
7407 |
-int BLASFUNC(srotm) (int *, float *, int *, float *, int *, float *); |
7408 |
-int BLASFUNC(drotm) (int *, double *, int *, double *, int *, double *); |
7409 |
-int BLASFUNC(qrotm) (int *, double *, int *, double *, int *, double *); |
7410 |
- |
7411 |
-/* Level 2 routines */ |
7412 |
- |
7413 |
-int BLASFUNC(sger)(int *, int *, float *, float *, int *, |
7414 |
- float *, int *, float *, int *); |
7415 |
-int BLASFUNC(dger)(int *, int *, double *, double *, int *, |
7416 |
- double *, int *, double *, int *); |
7417 |
-int BLASFUNC(qger)(int *, int *, double *, double *, int *, |
7418 |
- double *, int *, double *, int *); |
7419 |
-int BLASFUNC(cgeru)(int *, int *, float *, float *, int *, |
7420 |
- float *, int *, float *, int *); |
7421 |
-int BLASFUNC(cgerc)(int *, int *, float *, float *, int *, |
7422 |
- float *, int *, float *, int *); |
7423 |
-int BLASFUNC(zgeru)(int *, int *, double *, double *, int *, |
7424 |
- double *, int *, double *, int *); |
7425 |
-int BLASFUNC(zgerc)(int *, int *, double *, double *, int *, |
7426 |
- double *, int *, double *, int *); |
7427 |
-int BLASFUNC(xgeru)(int *, int *, double *, double *, int *, |
7428 |
- double *, int *, double *, int *); |
7429 |
-int BLASFUNC(xgerc)(int *, int *, double *, double *, int *, |
7430 |
- double *, int *, double *, int *); |
7431 |
- |
7432 |
-int BLASFUNC(sgemv)(char *, int *, int *, float *, float *, int *, |
7433 |
- float *, int *, float *, float *, int *); |
7434 |
-int BLASFUNC(dgemv)(char *, int *, int *, double *, double *, int *, |
7435 |
- double *, int *, double *, double *, int *); |
7436 |
-int BLASFUNC(qgemv)(char *, int *, int *, double *, double *, int *, |
7437 |
- double *, int *, double *, double *, int *); |
7438 |
-int BLASFUNC(cgemv)(char *, int *, int *, float *, float *, int *, |
7439 |
- float *, int *, float *, float *, int *); |
7440 |
-int BLASFUNC(zgemv)(char *, int *, int *, double *, double *, int *, |
7441 |
- double *, int *, double *, double *, int *); |
7442 |
-int BLASFUNC(xgemv)(char *, int *, int *, double *, double *, int *, |
7443 |
- double *, int *, double *, double *, int *); |
7444 |
- |
7445 |
-int BLASFUNC(strsv) (char *, char *, char *, int *, float *, int *, |
7446 |
- float *, int *); |
7447 |
-int BLASFUNC(dtrsv) (char *, char *, char *, int *, double *, int *, |
7448 |
- double *, int *); |
7449 |
-int BLASFUNC(qtrsv) (char *, char *, char *, int *, double *, int *, |
7450 |
- double *, int *); |
7451 |
-int BLASFUNC(ctrsv) (char *, char *, char *, int *, float *, int *, |
7452 |
- float *, int *); |
7453 |
-int BLASFUNC(ztrsv) (char *, char *, char *, int *, double *, int *, |
7454 |
- double *, int *); |
7455 |
-int BLASFUNC(xtrsv) (char *, char *, char *, int *, double *, int *, |
7456 |
- double *, int *); |
7457 |
- |
7458 |
-int BLASFUNC(stpsv) (char *, char *, char *, int *, float *, float *, int *); |
7459 |
-int BLASFUNC(dtpsv) (char *, char *, char *, int *, double *, double *, int *); |
7460 |
-int BLASFUNC(qtpsv) (char *, char *, char *, int *, double *, double *, int *); |
7461 |
-int BLASFUNC(ctpsv) (char *, char *, char *, int *, float *, float *, int *); |
7462 |
-int BLASFUNC(ztpsv) (char *, char *, char *, int *, double *, double *, int *); |
7463 |
-int BLASFUNC(xtpsv) (char *, char *, char *, int *, double *, double *, int *); |
7464 |
- |
7465 |
-int BLASFUNC(strmv) (char *, char *, char *, int *, float *, int *, |
7466 |
- float *, int *); |
7467 |
-int BLASFUNC(dtrmv) (char *, char *, char *, int *, double *, int *, |
7468 |
- double *, int *); |
7469 |
-int BLASFUNC(qtrmv) (char *, char *, char *, int *, double *, int *, |
7470 |
- double *, int *); |
7471 |
-int BLASFUNC(ctrmv) (char *, char *, char *, int *, float *, int *, |
7472 |
- float *, int *); |
7473 |
-int BLASFUNC(ztrmv) (char *, char *, char *, int *, double *, int *, |
7474 |
- double *, int *); |
7475 |
-int BLASFUNC(xtrmv) (char *, char *, char *, int *, double *, int *, |
7476 |
- double *, int *); |
7477 |
- |
7478 |
-int BLASFUNC(stpmv) (char *, char *, char *, int *, float *, float *, int *); |
7479 |
-int BLASFUNC(dtpmv) (char *, char *, char *, int *, double *, double *, int *); |
7480 |
-int BLASFUNC(qtpmv) (char *, char *, char *, int *, double *, double *, int *); |
7481 |
-int BLASFUNC(ctpmv) (char *, char *, char *, int *, float *, float *, int *); |
7482 |
-int BLASFUNC(ztpmv) (char *, char *, char *, int *, double *, double *, int *); |
7483 |
-int BLASFUNC(xtpmv) (char *, char *, char *, int *, double *, double *, int *); |
7484 |
- |
7485 |
-int BLASFUNC(stbmv) (char *, char *, char *, int *, int *, float *, int *, float *, int *); |
7486 |
-int BLASFUNC(dtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7487 |
-int BLASFUNC(qtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7488 |
-int BLASFUNC(ctbmv) (char *, char *, char *, int *, int *, float *, int *, float *, int *); |
7489 |
-int BLASFUNC(ztbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7490 |
-int BLASFUNC(xtbmv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7491 |
- |
7492 |
-int BLASFUNC(stbsv) (char *, char *, char *, int *, int *, float *, int *, float *, int *); |
7493 |
-int BLASFUNC(dtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7494 |
-int BLASFUNC(qtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7495 |
-int BLASFUNC(ctbsv) (char *, char *, char *, int *, int *, float *, int *, float *, int *); |
7496 |
-int BLASFUNC(ztbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7497 |
-int BLASFUNC(xtbsv) (char *, char *, char *, int *, int *, double *, int *, double *, int *); |
7498 |
- |
7499 |
-int BLASFUNC(ssymv) (char *, int *, float *, float *, int *, |
7500 |
- float *, int *, float *, float *, int *); |
7501 |
-int BLASFUNC(dsymv) (char *, int *, double *, double *, int *, |
7502 |
- double *, int *, double *, double *, int *); |
7503 |
-int BLASFUNC(qsymv) (char *, int *, double *, double *, int *, |
7504 |
- double *, int *, double *, double *, int *); |
7505 |
-int BLASFUNC(csymv) (char *, int *, float *, float *, int *, |
7506 |
- float *, int *, float *, float *, int *); |
7507 |
-int BLASFUNC(zsymv) (char *, int *, double *, double *, int *, |
7508 |
- double *, int *, double *, double *, int *); |
7509 |
-int BLASFUNC(xsymv) (char *, int *, double *, double *, int *, |
7510 |
- double *, int *, double *, double *, int *); |
7511 |
- |
7512 |
-int BLASFUNC(sspmv) (char *, int *, float *, float *, |
7513 |
- float *, int *, float *, float *, int *); |
7514 |
-int BLASFUNC(dspmv) (char *, int *, double *, double *, |
7515 |
- double *, int *, double *, double *, int *); |
7516 |
-int BLASFUNC(qspmv) (char *, int *, double *, double *, |
7517 |
- double *, int *, double *, double *, int *); |
7518 |
-int BLASFUNC(cspmv) (char *, int *, float *, float *, |
7519 |
- float *, int *, float *, float *, int *); |
7520 |
-int BLASFUNC(zspmv) (char *, int *, double *, double *, |
7521 |
- double *, int *, double *, double *, int *); |
7522 |
-int BLASFUNC(xspmv) (char *, int *, double *, double *, |
7523 |
- double *, int *, double *, double *, int *); |
7524 |
- |
7525 |
-int BLASFUNC(ssyr) (char *, int *, float *, float *, int *, |
7526 |
- float *, int *); |
7527 |
-int BLASFUNC(dsyr) (char *, int *, double *, double *, int *, |
7528 |
- double *, int *); |
7529 |
-int BLASFUNC(qsyr) (char *, int *, double *, double *, int *, |
7530 |
- double *, int *); |
7531 |
-int BLASFUNC(csyr) (char *, int *, float *, float *, int *, |
7532 |
- float *, int *); |
7533 |
-int BLASFUNC(zsyr) (char *, int *, double *, double *, int *, |
7534 |
- double *, int *); |
7535 |
-int BLASFUNC(xsyr) (char *, int *, double *, double *, int *, |
7536 |
- double *, int *); |
7537 |
- |
7538 |
-int BLASFUNC(ssyr2) (char *, int *, float *, |
7539 |
- float *, int *, float *, int *, float *, int *); |
7540 |
-int BLASFUNC(dsyr2) (char *, int *, double *, |
7541 |
- double *, int *, double *, int *, double *, int *); |
7542 |
-int BLASFUNC(qsyr2) (char *, int *, double *, |
7543 |
- double *, int *, double *, int *, double *, int *); |
7544 |
-int BLASFUNC(csyr2) (char *, int *, float *, |
7545 |
- float *, int *, float *, int *, float *, int *); |
7546 |
-int BLASFUNC(zsyr2) (char *, int *, double *, |
7547 |
- double *, int *, double *, int *, double *, int *); |
7548 |
-int BLASFUNC(xsyr2) (char *, int *, double *, |
7549 |
- double *, int *, double *, int *, double *, int *); |
7550 |
- |
7551 |
-int BLASFUNC(sspr) (char *, int *, float *, float *, int *, |
7552 |
- float *); |
7553 |
-int BLASFUNC(dspr) (char *, int *, double *, double *, int *, |
7554 |
- double *); |
7555 |
-int BLASFUNC(qspr) (char *, int *, double *, double *, int *, |
7556 |
- double *); |
7557 |
-int BLASFUNC(cspr) (char *, int *, float *, float *, int *, |
7558 |
- float *); |
7559 |
-int BLASFUNC(zspr) (char *, int *, double *, double *, int *, |
7560 |
- double *); |
7561 |
-int BLASFUNC(xspr) (char *, int *, double *, double *, int *, |
7562 |
- double *); |
7563 |
- |
7564 |
-int BLASFUNC(sspr2) (char *, int *, float *, |
7565 |
- float *, int *, float *, int *, float *); |
7566 |
-int BLASFUNC(dspr2) (char *, int *, double *, |
7567 |
- double *, int *, double *, int *, double *); |
7568 |
-int BLASFUNC(qspr2) (char *, int *, double *, |
7569 |
- double *, int *, double *, int *, double *); |
7570 |
-int BLASFUNC(cspr2) (char *, int *, float *, |
7571 |
- float *, int *, float *, int *, float *); |
7572 |
-int BLASFUNC(zspr2) (char *, int *, double *, |
7573 |
- double *, int *, double *, int *, double *); |
7574 |
-int BLASFUNC(xspr2) (char *, int *, double *, |
7575 |
- double *, int *, double *, int *, double *); |
7576 |
- |
7577 |
-int BLASFUNC(cher) (char *, int *, float *, float *, int *, |
7578 |
- float *, int *); |
7579 |
-int BLASFUNC(zher) (char *, int *, double *, double *, int *, |
7580 |
- double *, int *); |
7581 |
-int BLASFUNC(xher) (char *, int *, double *, double *, int *, |
7582 |
- double *, int *); |
7583 |
- |
7584 |
-int BLASFUNC(chpr) (char *, int *, float *, float *, int *, float *); |
7585 |
-int BLASFUNC(zhpr) (char *, int *, double *, double *, int *, double *); |
7586 |
-int BLASFUNC(xhpr) (char *, int *, double *, double *, int *, double *); |
7587 |
- |
7588 |
-int BLASFUNC(cher2) (char *, int *, float *, |
7589 |
- float *, int *, float *, int *, float *, int *); |
7590 |
-int BLASFUNC(zher2) (char *, int *, double *, |
7591 |
- double *, int *, double *, int *, double *, int *); |
7592 |
-int BLASFUNC(xher2) (char *, int *, double *, |
7593 |
- double *, int *, double *, int *, double *, int *); |
7594 |
- |
7595 |
-int BLASFUNC(chpr2) (char *, int *, float *, |
7596 |
- float *, int *, float *, int *, float *); |
7597 |
-int BLASFUNC(zhpr2) (char *, int *, double *, |
7598 |
- double *, int *, double *, int *, double *); |
7599 |
-int BLASFUNC(xhpr2) (char *, int *, double *, |
7600 |
- double *, int *, double *, int *, double *); |
7601 |
- |
7602 |
-int BLASFUNC(chemv) (char *, int *, float *, float *, int *, |
7603 |
- float *, int *, float *, float *, int *); |
7604 |
-int BLASFUNC(zhemv) (char *, int *, double *, double *, int *, |
7605 |
- double *, int *, double *, double *, int *); |
7606 |
-int BLASFUNC(xhemv) (char *, int *, double *, double *, int *, |
7607 |
- double *, int *, double *, double *, int *); |
7608 |
- |
7609 |
-int BLASFUNC(chpmv) (char *, int *, float *, float *, |
7610 |
- float *, int *, float *, float *, int *); |
7611 |
-int BLASFUNC(zhpmv) (char *, int *, double *, double *, |
7612 |
- double *, int *, double *, double *, int *); |
7613 |
-int BLASFUNC(xhpmv) (char *, int *, double *, double *, |
7614 |
- double *, int *, double *, double *, int *); |
7615 |
- |
7616 |
-int BLASFUNC(snorm)(char *, int *, int *, float *, int *); |
7617 |
-int BLASFUNC(dnorm)(char *, int *, int *, double *, int *); |
7618 |
-int BLASFUNC(cnorm)(char *, int *, int *, float *, int *); |
7619 |
-int BLASFUNC(znorm)(char *, int *, int *, double *, int *); |
7620 |
- |
7621 |
-int BLASFUNC(sgbmv)(char *, int *, int *, int *, int *, float *, float *, int *, |
7622 |
- float *, int *, float *, float *, int *); |
7623 |
-int BLASFUNC(dgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, |
7624 |
- double *, int *, double *, double *, int *); |
7625 |
-int BLASFUNC(qgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, |
7626 |
- double *, int *, double *, double *, int *); |
7627 |
-int BLASFUNC(cgbmv)(char *, int *, int *, int *, int *, float *, float *, int *, |
7628 |
- float *, int *, float *, float *, int *); |
7629 |
-int BLASFUNC(zgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, |
7630 |
- double *, int *, double *, double *, int *); |
7631 |
-int BLASFUNC(xgbmv)(char *, int *, int *, int *, int *, double *, double *, int *, |
7632 |
- double *, int *, double *, double *, int *); |
7633 |
- |
7634 |
-int BLASFUNC(ssbmv)(char *, int *, int *, float *, float *, int *, |
7635 |
- float *, int *, float *, float *, int *); |
7636 |
-int BLASFUNC(dsbmv)(char *, int *, int *, double *, double *, int *, |
7637 |
- double *, int *, double *, double *, int *); |
7638 |
-int BLASFUNC(qsbmv)(char *, int *, int *, double *, double *, int *, |
7639 |
- double *, int *, double *, double *, int *); |
7640 |
-int BLASFUNC(csbmv)(char *, int *, int *, float *, float *, int *, |
7641 |
- float *, int *, float *, float *, int *); |
7642 |
-int BLASFUNC(zsbmv)(char *, int *, int *, double *, double *, int *, |
7643 |
- double *, int *, double *, double *, int *); |
7644 |
-int BLASFUNC(xsbmv)(char *, int *, int *, double *, double *, int *, |
7645 |
- double *, int *, double *, double *, int *); |
7646 |
- |
7647 |
-int BLASFUNC(chbmv)(char *, int *, int *, float *, float *, int *, |
7648 |
- float *, int *, float *, float *, int *); |
7649 |
-int BLASFUNC(zhbmv)(char *, int *, int *, double *, double *, int *, |
7650 |
- double *, int *, double *, double *, int *); |
7651 |
-int BLASFUNC(xhbmv)(char *, int *, int *, double *, double *, int *, |
7652 |
- double *, int *, double *, double *, int *); |
7653 |
- |
7654 |
-/* Level 3 routines */ |
7655 |
- |
7656 |
-int BLASFUNC(sgemm)(char *, char *, int *, int *, int *, float *, |
7657 |
- float *, int *, float *, int *, float *, float *, int *); |
7658 |
-int BLASFUNC(dgemm)(char *, char *, int *, int *, int *, double *, |
7659 |
- double *, int *, double *, int *, double *, double *, int *); |
7660 |
-int BLASFUNC(qgemm)(char *, char *, int *, int *, int *, double *, |
7661 |
- double *, int *, double *, int *, double *, double *, int *); |
7662 |
-int BLASFUNC(cgemm)(char *, char *, int *, int *, int *, float *, |
7663 |
- float *, int *, float *, int *, float *, float *, int *); |
7664 |
-int BLASFUNC(zgemm)(char *, char *, int *, int *, int *, double *, |
7665 |
- double *, int *, double *, int *, double *, double *, int *); |
7666 |
-int BLASFUNC(xgemm)(char *, char *, int *, int *, int *, double *, |
7667 |
- double *, int *, double *, int *, double *, double *, int *); |
7668 |
- |
7669 |
-int BLASFUNC(cgemm3m)(char *, char *, int *, int *, int *, float *, |
7670 |
- float *, int *, float *, int *, float *, float *, int *); |
7671 |
-int BLASFUNC(zgemm3m)(char *, char *, int *, int *, int *, double *, |
7672 |
- double *, int *, double *, int *, double *, double *, int *); |
7673 |
-int BLASFUNC(xgemm3m)(char *, char *, int *, int *, int *, double *, |
7674 |
- double *, int *, double *, int *, double *, double *, int *); |
7675 |
- |
7676 |
-int BLASFUNC(sge2mm)(char *, char *, char *, int *, int *, |
7677 |
- float *, float *, int *, float *, int *, |
7678 |
- float *, float *, int *); |
7679 |
-int BLASFUNC(dge2mm)(char *, char *, char *, int *, int *, |
7680 |
- double *, double *, int *, double *, int *, |
7681 |
- double *, double *, int *); |
7682 |
-int BLASFUNC(cge2mm)(char *, char *, char *, int *, int *, |
7683 |
- float *, float *, int *, float *, int *, |
7684 |
- float *, float *, int *); |
7685 |
-int BLASFUNC(zge2mm)(char *, char *, char *, int *, int *, |
7686 |
- double *, double *, int *, double *, int *, |
7687 |
- double *, double *, int *); |
7688 |
- |
7689 |
-int BLASFUNC(strsm)(char *, char *, char *, char *, int *, int *, |
7690 |
- float *, float *, int *, float *, int *); |
7691 |
-int BLASFUNC(dtrsm)(char *, char *, char *, char *, int *, int *, |
7692 |
- double *, double *, int *, double *, int *); |
7693 |
-int BLASFUNC(qtrsm)(char *, char *, char *, char *, int *, int *, |
7694 |
- double *, double *, int *, double *, int *); |
7695 |
-int BLASFUNC(ctrsm)(char *, char *, char *, char *, int *, int *, |
7696 |
- float *, float *, int *, float *, int *); |
7697 |
-int BLASFUNC(ztrsm)(char *, char *, char *, char *, int *, int *, |
7698 |
- double *, double *, int *, double *, int *); |
7699 |
-int BLASFUNC(xtrsm)(char *, char *, char *, char *, int *, int *, |
7700 |
- double *, double *, int *, double *, int *); |
7701 |
- |
7702 |
-int BLASFUNC(strmm)(char *, char *, char *, char *, int *, int *, |
7703 |
- float *, float *, int *, float *, int *); |
7704 |
-int BLASFUNC(dtrmm)(char *, char *, char *, char *, int *, int *, |
7705 |
- double *, double *, int *, double *, int *); |
7706 |
-int BLASFUNC(qtrmm)(char *, char *, char *, char *, int *, int *, |
7707 |
- double *, double *, int *, double *, int *); |
7708 |
-int BLASFUNC(ctrmm)(char *, char *, char *, char *, int *, int *, |
7709 |
- float *, float *, int *, float *, int *); |
7710 |
-int BLASFUNC(ztrmm)(char *, char *, char *, char *, int *, int *, |
7711 |
- double *, double *, int *, double *, int *); |
7712 |
-int BLASFUNC(xtrmm)(char *, char *, char *, char *, int *, int *, |
7713 |
- double *, double *, int *, double *, int *); |
7714 |
- |
7715 |
-int BLASFUNC(ssymm)(char *, char *, int *, int *, float *, float *, int *, |
7716 |
- float *, int *, float *, float *, int *); |
7717 |
-int BLASFUNC(dsymm)(char *, char *, int *, int *, double *, double *, int *, |
7718 |
- double *, int *, double *, double *, int *); |
7719 |
-int BLASFUNC(qsymm)(char *, char *, int *, int *, double *, double *, int *, |
7720 |
- double *, int *, double *, double *, int *); |
7721 |
-int BLASFUNC(csymm)(char *, char *, int *, int *, float *, float *, int *, |
7722 |
- float *, int *, float *, float *, int *); |
7723 |
-int BLASFUNC(zsymm)(char *, char *, int *, int *, double *, double *, int *, |
7724 |
- double *, int *, double *, double *, int *); |
7725 |
-int BLASFUNC(xsymm)(char *, char *, int *, int *, double *, double *, int *, |
7726 |
- double *, int *, double *, double *, int *); |
7727 |
- |
7728 |
-int BLASFUNC(csymm3m)(char *, char *, int *, int *, float *, float *, int *, |
7729 |
- float *, int *, float *, float *, int *); |
7730 |
-int BLASFUNC(zsymm3m)(char *, char *, int *, int *, double *, double *, int *, |
7731 |
- double *, int *, double *, double *, int *); |
7732 |
-int BLASFUNC(xsymm3m)(char *, char *, int *, int *, double *, double *, int *, |
7733 |
- double *, int *, double *, double *, int *); |
7734 |
- |
7735 |
-int BLASFUNC(ssyrk)(char *, char *, int *, int *, float *, float *, int *, |
7736 |
- float *, float *, int *); |
7737 |
-int BLASFUNC(dsyrk)(char *, char *, int *, int *, double *, double *, int *, |
7738 |
- double *, double *, int *); |
7739 |
-int BLASFUNC(qsyrk)(char *, char *, int *, int *, double *, double *, int *, |
7740 |
- double *, double *, int *); |
7741 |
-int BLASFUNC(csyrk)(char *, char *, int *, int *, float *, float *, int *, |
7742 |
- float *, float *, int *); |
7743 |
-int BLASFUNC(zsyrk)(char *, char *, int *, int *, double *, double *, int *, |
7744 |
- double *, double *, int *); |
7745 |
-int BLASFUNC(xsyrk)(char *, char *, int *, int *, double *, double *, int *, |
7746 |
- double *, double *, int *); |
7747 |
- |
7748 |
-int BLASFUNC(ssyr2k)(char *, char *, int *, int *, float *, float *, int *, |
7749 |
- float *, int *, float *, float *, int *); |
7750 |
-int BLASFUNC(dsyr2k)(char *, char *, int *, int *, double *, double *, int *, |
7751 |
- double*, int *, double *, double *, int *); |
7752 |
-int BLASFUNC(qsyr2k)(char *, char *, int *, int *, double *, double *, int *, |
7753 |
- double*, int *, double *, double *, int *); |
7754 |
-int BLASFUNC(csyr2k)(char *, char *, int *, int *, float *, float *, int *, |
7755 |
- float *, int *, float *, float *, int *); |
7756 |
-int BLASFUNC(zsyr2k)(char *, char *, int *, int *, double *, double *, int *, |
7757 |
- double*, int *, double *, double *, int *); |
7758 |
-int BLASFUNC(xsyr2k)(char *, char *, int *, int *, double *, double *, int *, |
7759 |
- double*, int *, double *, double *, int *); |
7760 |
- |
7761 |
-int BLASFUNC(chemm)(char *, char *, int *, int *, float *, float *, int *, |
7762 |
- float *, int *, float *, float *, int *); |
7763 |
-int BLASFUNC(zhemm)(char *, char *, int *, int *, double *, double *, int *, |
7764 |
- double *, int *, double *, double *, int *); |
7765 |
-int BLASFUNC(xhemm)(char *, char *, int *, int *, double *, double *, int *, |
7766 |
- double *, int *, double *, double *, int *); |
7767 |
- |
7768 |
-int BLASFUNC(chemm3m)(char *, char *, int *, int *, float *, float *, int *, |
7769 |
- float *, int *, float *, float *, int *); |
7770 |
-int BLASFUNC(zhemm3m)(char *, char *, int *, int *, double *, double *, int *, |
7771 |
- double *, int *, double *, double *, int *); |
7772 |
-int BLASFUNC(xhemm3m)(char *, char *, int *, int *, double *, double *, int *, |
7773 |
- double *, int *, double *, double *, int *); |
7774 |
- |
7775 |
-int BLASFUNC(cherk)(char *, char *, int *, int *, float *, float *, int *, |
7776 |
- float *, float *, int *); |
7777 |
-int BLASFUNC(zherk)(char *, char *, int *, int *, double *, double *, int *, |
7778 |
- double *, double *, int *); |
7779 |
-int BLASFUNC(xherk)(char *, char *, int *, int *, double *, double *, int *, |
7780 |
- double *, double *, int *); |
7781 |
- |
7782 |
-int BLASFUNC(cher2k)(char *, char *, int *, int *, float *, float *, int *, |
7783 |
- float *, int *, float *, float *, int *); |
7784 |
-int BLASFUNC(zher2k)(char *, char *, int *, int *, double *, double *, int *, |
7785 |
- double*, int *, double *, double *, int *); |
7786 |
-int BLASFUNC(xher2k)(char *, char *, int *, int *, double *, double *, int *, |
7787 |
- double*, int *, double *, double *, int *); |
7788 |
-int BLASFUNC(cher2m)(char *, char *, char *, int *, int *, float *, float *, int *, |
7789 |
- float *, int *, float *, float *, int *); |
7790 |
-int BLASFUNC(zher2m)(char *, char *, char *, int *, int *, double *, double *, int *, |
7791 |
- double*, int *, double *, double *, int *); |
7792 |
-int BLASFUNC(xher2m)(char *, char *, char *, int *, int *, double *, double *, int *, |
7793 |
- double*, int *, double *, double *, int *); |
7794 |
- |
7795 |
-int BLASFUNC(sgemt)(char *, int *, int *, float *, float *, int *, |
7796 |
- float *, int *); |
7797 |
-int BLASFUNC(dgemt)(char *, int *, int *, double *, double *, int *, |
7798 |
- double *, int *); |
7799 |
-int BLASFUNC(cgemt)(char *, int *, int *, float *, float *, int *, |
7800 |
- float *, int *); |
7801 |
-int BLASFUNC(zgemt)(char *, int *, int *, double *, double *, int *, |
7802 |
- double *, int *); |
7803 |
- |
7804 |
-int BLASFUNC(sgema)(char *, char *, int *, int *, float *, |
7805 |
- float *, int *, float *, float *, int *, float *, int *); |
7806 |
-int BLASFUNC(dgema)(char *, char *, int *, int *, double *, |
7807 |
- double *, int *, double*, double *, int *, double*, int *); |
7808 |
-int BLASFUNC(cgema)(char *, char *, int *, int *, float *, |
7809 |
- float *, int *, float *, float *, int *, float *, int *); |
7810 |
-int BLASFUNC(zgema)(char *, char *, int *, int *, double *, |
7811 |
- double *, int *, double*, double *, int *, double*, int *); |
7812 |
- |
7813 |
-int BLASFUNC(sgems)(char *, char *, int *, int *, float *, |
7814 |
- float *, int *, float *, float *, int *, float *, int *); |
7815 |
-int BLASFUNC(dgems)(char *, char *, int *, int *, double *, |
7816 |
- double *, int *, double*, double *, int *, double*, int *); |
7817 |
-int BLASFUNC(cgems)(char *, char *, int *, int *, float *, |
7818 |
- float *, int *, float *, float *, int *, float *, int *); |
7819 |
-int BLASFUNC(zgems)(char *, char *, int *, int *, double *, |
7820 |
- double *, int *, double*, double *, int *, double*, int *); |
7821 |
- |
7822 |
-int BLASFUNC(sgetf2)(int *, int *, float *, int *, int *, int *); |
7823 |
-int BLASFUNC(dgetf2)(int *, int *, double *, int *, int *, int *); |
7824 |
-int BLASFUNC(qgetf2)(int *, int *, double *, int *, int *, int *); |
7825 |
-int BLASFUNC(cgetf2)(int *, int *, float *, int *, int *, int *); |
7826 |
-int BLASFUNC(zgetf2)(int *, int *, double *, int *, int *, int *); |
7827 |
-int BLASFUNC(xgetf2)(int *, int *, double *, int *, int *, int *); |
7828 |
- |
7829 |
-//int BLASFUNC(sgetrf)(int *, int *, float *, int *, int *, int *); |
7830 |
-//int BLASFUNC(dgetrf)(int *, int *, double *, int *, int *, int *); |
7831 |
-int BLASFUNC(qgetrf)(int *, int *, double *, int *, int *, int *); |
7832 |
-int BLASFUNC(cgetrf)(int *, int *, float *, int *, int *, int *); |
7833 |
-int BLASFUNC(zgetrf)(int *, int *, double *, int *, int *, int *); |
7834 |
-int BLASFUNC(xgetrf)(int *, int *, double *, int *, int *, int *); |
7835 |
- |
7836 |
-int BLASFUNC(slaswp)(int *, float *, int *, int *, int *, int *, int *); |
7837 |
-int BLASFUNC(dlaswp)(int *, double *, int *, int *, int *, int *, int *); |
7838 |
-int BLASFUNC(qlaswp)(int *, double *, int *, int *, int *, int *, int *); |
7839 |
-int BLASFUNC(claswp)(int *, float *, int *, int *, int *, int *, int *); |
7840 |
-int BLASFUNC(zlaswp)(int *, double *, int *, int *, int *, int *, int *); |
7841 |
-int BLASFUNC(xlaswp)(int *, double *, int *, int *, int *, int *, int *); |
7842 |
- |
7843 |
-int BLASFUNC(sgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *); |
7844 |
-int BLASFUNC(dgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *); |
7845 |
-int BLASFUNC(qgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *); |
7846 |
-int BLASFUNC(cgetrs)(char *, int *, int *, float *, int *, int *, float *, int *, int *); |
7847 |
-int BLASFUNC(zgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *); |
7848 |
-int BLASFUNC(xgetrs)(char *, int *, int *, double *, int *, int *, double *, int *, int *); |
7849 |
- |
7850 |
-int BLASFUNC(sgesv)(int *, int *, float *, int *, int *, float *, int *, int *); |
7851 |
-int BLASFUNC(dgesv)(int *, int *, double *, int *, int *, double*, int *, int *); |
7852 |
-int BLASFUNC(qgesv)(int *, int *, double *, int *, int *, double*, int *, int *); |
7853 |
-int BLASFUNC(cgesv)(int *, int *, float *, int *, int *, float *, int *, int *); |
7854 |
-int BLASFUNC(zgesv)(int *, int *, double *, int *, int *, double*, int *, int *); |
7855 |
-int BLASFUNC(xgesv)(int *, int *, double *, int *, int *, double*, int *, int *); |
7856 |
- |
7857 |
-int BLASFUNC(spotf2)(char *, int *, float *, int *, int *); |
7858 |
-int BLASFUNC(dpotf2)(char *, int *, double *, int *, int *); |
7859 |
-int BLASFUNC(qpotf2)(char *, int *, double *, int *, int *); |
7860 |
-int BLASFUNC(cpotf2)(char *, int *, float *, int *, int *); |
7861 |
-int BLASFUNC(zpotf2)(char *, int *, double *, int *, int *); |
7862 |
-int BLASFUNC(xpotf2)(char *, int *, double *, int *, int *); |
7863 |
- |
7864 |
-//int BLASFUNC(spotrf)(char *, int *, float *, int *, int *); |
7865 |
-//int BLASFUNC(dpotrf)(char *, int *, double *, int *, int *); |
7866 |
-int BLASFUNC(qpotrf)(char *, int *, double *, int *, int *); |
7867 |
-int BLASFUNC(cpotrf)(char *, int *, float *, int *, int *); |
7868 |
-int BLASFUNC(zpotrf)(char *, int *, double *, int *, int *); |
7869 |
-int BLASFUNC(xpotrf)(char *, int *, double *, int *, int *); |
7870 |
- |
7871 |
-int BLASFUNC(slauu2)(char *, int *, float *, int *, int *); |
7872 |
-int BLASFUNC(dlauu2)(char *, int *, double *, int *, int *); |
7873 |
-int BLASFUNC(qlauu2)(char *, int *, double *, int *, int *); |
7874 |
-int BLASFUNC(clauu2)(char *, int *, float *, int *, int *); |
7875 |
-int BLASFUNC(zlauu2)(char *, int *, double *, int *, int *); |
7876 |
-int BLASFUNC(xlauu2)(char *, int *, double *, int *, int *); |
7877 |
- |
7878 |
-int BLASFUNC(slauum)(char *, int *, float *, int *, int *); |
7879 |
-int BLASFUNC(dlauum)(char *, int *, double *, int *, int *); |
7880 |
-int BLASFUNC(qlauum)(char *, int *, double *, int *, int *); |
7881 |
-int BLASFUNC(clauum)(char *, int *, float *, int *, int *); |
7882 |
-int BLASFUNC(zlauum)(char *, int *, double *, int *, int *); |
7883 |
-int BLASFUNC(xlauum)(char *, int *, double *, int *, int *); |
7884 |
- |
7885 |
-int BLASFUNC(strti2)(char *, char *, int *, float *, int *, int *); |
7886 |
-int BLASFUNC(dtrti2)(char *, char *, int *, double *, int *, int *); |
7887 |
-int BLASFUNC(qtrti2)(char *, char *, int *, double *, int *, int *); |
7888 |
-int BLASFUNC(ctrti2)(char *, char *, int *, float *, int *, int *); |
7889 |
-int BLASFUNC(ztrti2)(char *, char *, int *, double *, int *, int *); |
7890 |
-int BLASFUNC(xtrti2)(char *, char *, int *, double *, int *, int *); |
7891 |
- |
7892 |
-int BLASFUNC(strtri)(char *, char *, int *, float *, int *, int *); |
7893 |
-int BLASFUNC(dtrtri)(char *, char *, int *, double *, int *, int *); |
7894 |
-int BLASFUNC(qtrtri)(char *, char *, int *, double *, int *, int *); |
7895 |
-int BLASFUNC(ctrtri)(char *, char *, int *, float *, int *, int *); |
7896 |
-int BLASFUNC(ztrtri)(char *, char *, int *, double *, int *, int *); |
7897 |
-int BLASFUNC(xtrtri)(char *, char *, int *, double *, int *, int *); |
7898 |
- |
7899 |
-int BLASFUNC(spotri)(char *, int *, float *, int *, int *); |
7900 |
-int BLASFUNC(dpotri)(char *, int *, double *, int *, int *); |
7901 |
-int BLASFUNC(qpotri)(char *, int *, double *, int *, int *); |
7902 |
-int BLASFUNC(cpotri)(char *, int *, float *, int *, int *); |
7903 |
-int BLASFUNC(zpotri)(char *, int *, double *, int *, int *); |
7904 |
-int BLASFUNC(xpotri)(char *, int *, double *, int *, int *); |
7905 |
- |
7906 |
-} |
7907 |
- |
7908 |
-#endif |
7909 |
|
7910 |
diff --git a/btl/libs/BLAS/blas_interface.hh b/btl/libs/BLAS/blas_interface.hh |
7911 |
deleted file mode 100644 |
7912 |
index 19fc3c1..0000000 |
7913 |
--- a/btl/libs/BLAS/blas_interface.hh |
7914 |
+++ /dev/null |
7915 |
@@ -1,77 +0,0 @@ |
7916 |
-//===================================================== |
7917 |
-// File : blas_interface.hh |
7918 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
7919 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:28 CEST 2002 |
7920 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
7921 |
-//===================================================== |
7922 |
-// |
7923 |
-// This program is free software; you can redistribute it and/or |
7924 |
-// modify it under the terms of the GNU General Public License |
7925 |
-// as published by the Free Software Foundation; either version 2 |
7926 |
-// of the License, or (at your option) any later version. |
7927 |
-// |
7928 |
-// This program is distributed in the hope that it will be useful, |
7929 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
7930 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7931 |
-// GNU General Public License for more details. |
7932 |
-// You should have received a copy of the GNU General Public License |
7933 |
-// along with this program; if not, write to the Free Software |
7934 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
7935 |
-// |
7936 |
-#ifndef blas_PRODUIT_MATRICE_VECTEUR_HH |
7937 |
-#define blas_PRODUIT_MATRICE_VECTEUR_HH |
7938 |
- |
7939 |
-#include <c_interface_base.h> |
7940 |
-#include <complex> |
7941 |
-extern "C" |
7942 |
-{ |
7943 |
-#include "blas.h" |
7944 |
-#ifdef CBLAS_INTERFACE |
7945 |
-# include "cblas.h" |
7946 |
-#endif |
7947 |
-} |
7948 |
- |
7949 |
-#define MAKE_STRING2(S) #S |
7950 |
-#define MAKE_STRING(S) MAKE_STRING2(S) |
7951 |
- |
7952 |
-#define CAT2(A,B) A##B |
7953 |
-#define CAT(A,B) CAT2(A,B) |
7954 |
- |
7955 |
- |
7956 |
-template<class real> class blas_interface; |
7957 |
- |
7958 |
- |
7959 |
-static char notrans = 'N'; |
7960 |
-static char trans = 'T'; |
7961 |
-static char nonunit = 'N'; |
7962 |
-static char lower = 'L'; |
7963 |
-static char right = 'R'; |
7964 |
-static char left = 'L'; |
7965 |
-static int intone = 1; |
7966 |
- |
7967 |
- |
7968 |
-#define SCALAR float |
7969 |
-#define SCALAR_PREFIX s |
7970 |
-#ifdef CBLAS_INTERFACE |
7971 |
-# include "cblas_interface_impl.hh" |
7972 |
-#else |
7973 |
-# include "blas_interface_impl.hh" |
7974 |
-#endif |
7975 |
-#undef SCALAR |
7976 |
-#undef SCALAR_PREFIX |
7977 |
- |
7978 |
- |
7979 |
-#define SCALAR double |
7980 |
-#define SCALAR_PREFIX d |
7981 |
-#ifdef CBLAS_INTERFACE |
7982 |
-# include "cblas_interface_impl.hh" |
7983 |
-#else |
7984 |
-# include "blas_interface_impl.hh" |
7985 |
-#endif |
7986 |
-#undef SCALAR |
7987 |
-#undef SCALAR_PREFIX |
7988 |
- |
7989 |
-#endif |
7990 |
- |
7991 |
- |
7992 |
- |
7993 |
|
7994 |
diff --git a/btl/libs/BLAS/blas_interface_impl.hh b/btl/libs/BLAS/blas_interface_impl.hh |
7995 |
deleted file mode 100644 |
7996 |
index 63883a9..0000000 |
7997 |
--- a/btl/libs/BLAS/blas_interface_impl.hh |
7998 |
+++ /dev/null |
7999 |
@@ -1,96 +0,0 @@ |
8000 |
-//===================================================== |
8001 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
8002 |
-//===================================================== |
8003 |
-// |
8004 |
-// This program is free software; you can redistribute it and/or |
8005 |
-// modify it under the terms of the GNU General Public License |
8006 |
-// as published by the Free Software Foundation; either version 2 |
8007 |
-// of the License, or (at your option) any later version. |
8008 |
-// |
8009 |
-// This program is distributed in the hope that it will be useful, |
8010 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
8011 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8012 |
-// GNU General Public License for more details. |
8013 |
-// You should have received a copy of the GNU General Public License |
8014 |
-// along with this program; if not, write to the Free Software |
8015 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
8016 |
-// |
8017 |
- |
8018 |
-#define BLAS_FUNC(NAME) CAT(CAT(SCALAR_PREFIX,NAME),_) |
8019 |
- |
8020 |
-template<> class blas_interface<SCALAR> : public c_interface_base<SCALAR> |
8021 |
-{ |
8022 |
- |
8023 |
-public : |
8024 |
- |
8025 |
- static SCALAR fone; |
8026 |
- static SCALAR fzero; |
8027 |
- |
8028 |
- static inline std::string name() |
8029 |
- { |
8030 |
- return MAKE_STRING(CBLASNAME); |
8031 |
- } |
8032 |
- |
8033 |
- static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8034 |
- BLAS_FUNC(gemv)(¬rans,&N,&N,&fone,A,&N,B,&intone,&fzero,X,&intone); |
8035 |
- } |
8036 |
- |
8037 |
- static inline void symv(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8038 |
- BLAS_FUNC(symv)(&lower, &N,&fone,A,&N,B,&intone,&fzero,X,&intone); |
8039 |
- } |
8040 |
- |
8041 |
- static inline void syr2(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8042 |
- BLAS_FUNC(syr2)(&lower,&N,&fone,B,&intone,X,&intone,A,&N); |
8043 |
- } |
8044 |
- |
8045 |
- static inline void ger(gene_matrix & A, gene_vector & X, gene_vector & Y, int N){ |
8046 |
- BLAS_FUNC(ger)(&N,&N,&fone,X,&intone,Y,&intone,A,&N); |
8047 |
- } |
8048 |
- |
8049 |
- static inline void rot(gene_vector & A, gene_vector & B, SCALAR c, SCALAR s, int N){ |
8050 |
- BLAS_FUNC(rot)(&N,A,&intone,B,&intone,&c,&s); |
8051 |
- } |
8052 |
- |
8053 |
- static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8054 |
- BLAS_FUNC(gemv)(&trans,&N,&N,&fone,A,&N,B,&intone,&fzero,X,&intone); |
8055 |
- } |
8056 |
- |
8057 |
- static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){ |
8058 |
- BLAS_FUNC(gemm)(¬rans,¬rans,&N,&N,&N,&fone,A,&N,B,&N,&fzero,X,&N); |
8059 |
- } |
8060 |
- |
8061 |
- static inline void transposed_matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){ |
8062 |
- BLAS_FUNC(gemm)(¬rans,¬rans,&N,&N,&N,&fone,A,&N,B,&N,&fzero,X,&N); |
8063 |
- } |
8064 |
- |
8065 |
- static inline void aat_product(gene_matrix & A, gene_matrix & X, int N){ |
8066 |
- BLAS_FUNC(syrk)(&lower,¬rans,&N,&N,&fone,A,&N,&fzero,X,&N); |
8067 |
- } |
8068 |
- |
8069 |
- static inline void axpy(SCALAR coef, const gene_vector & X, gene_vector & Y, int N){ |
8070 |
- BLAS_FUNC(axpy)(&N,&coef,X,&intone,Y,&intone); |
8071 |
- } |
8072 |
- |
8073 |
- static inline void axpby(SCALAR a, const gene_vector & X, SCALAR b, gene_vector & Y, int N){ |
8074 |
- BLAS_FUNC(scal)(&N,&b,Y,&intone); |
8075 |
- BLAS_FUNC(axpy)(&N,&a,X,&intone,Y,&intone); |
8076 |
- } |
8077 |
- |
8078 |
- static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){ |
8079 |
- BLAS_FUNC(copy)(&N, B, &intone, X, &intone); |
8080 |
- BLAS_FUNC(trsv)(&lower, ¬rans, &nonunit, &N, L, &N, X, &intone); |
8081 |
- } |
8082 |
- |
8083 |
- static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix & X, int N){ |
8084 |
- BLAS_FUNC(copy)(&N, B, &intone, X, &intone); |
8085 |
- BLAS_FUNC(trsm)(&right, &lower, ¬rans, &nonunit, &N, &N, &fone, L, &N, X, &N); |
8086 |
- } |
8087 |
- |
8088 |
- static inline void trmm(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){ |
8089 |
- BLAS_FUNC(trmm)(&left, &lower, ¬rans,&nonunit, &N,&N,&fone,A,&N,B,&N); |
8090 |
- } |
8091 |
- |
8092 |
-}; |
8093 |
- |
8094 |
-SCALAR blas_interface<SCALAR>::fone = SCALAR(1); |
8095 |
-SCALAR blas_interface<SCALAR>::fzero = SCALAR(0); |
8096 |
|
8097 |
diff --git a/btl/libs/BLAS/c_interface_base.h b/btl/libs/BLAS/c_interface_base.h |
8098 |
deleted file mode 100644 |
8099 |
index 3b6afbb..0000000 |
8100 |
--- a/btl/libs/BLAS/c_interface_base.h |
8101 |
+++ /dev/null |
8102 |
@@ -1,89 +0,0 @@ |
8103 |
-//===================================================== |
8104 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
8105 |
-//===================================================== |
8106 |
-// |
8107 |
-// This program is free software; you can redistribute it and/or |
8108 |
-// modify it under the terms of the GNU General Public License |
8109 |
-// as published by the Free Software Foundation; either version 2 |
8110 |
-// of the License, or (at your option) any later version. |
8111 |
-// |
8112 |
-// This program is distributed in the hope that it will be useful, |
8113 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
8114 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8115 |
-// GNU General Public License for more details. |
8116 |
-// You should have received a copy of the GNU General Public License |
8117 |
-// along with this program; if not, write to the Free Software |
8118 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
8119 |
-// |
8120 |
-#ifndef BTL_C_INTERFACE_BASE_H |
8121 |
-#define BTL_C_INTERFACE_BASE_H |
8122 |
- |
8123 |
-#include "utilities.h" |
8124 |
-#include <vector> |
8125 |
- |
8126 |
-template<class real> class c_interface_base |
8127 |
-{ |
8128 |
- |
8129 |
-public: |
8130 |
- |
8131 |
- typedef real real_type; |
8132 |
- typedef std::vector<real> stl_vector; |
8133 |
- typedef std::vector<stl_vector > stl_matrix; |
8134 |
- |
8135 |
- typedef real* gene_matrix; |
8136 |
- typedef real* gene_vector; |
8137 |
- |
8138 |
- static void free_matrix(gene_matrix & A, int N){ |
8139 |
- delete A; |
8140 |
- } |
8141 |
- |
8142 |
- static void free_vector(gene_vector & B){ |
8143 |
- delete B; |
8144 |
- } |
8145 |
- |
8146 |
- static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ |
8147 |
- int N = A_stl.size(); |
8148 |
- A = new real[N*N]; |
8149 |
- for (int j=0;j<N;j++) |
8150 |
- for (int i=0;i<N;i++) |
8151 |
- A[i+N*j] = A_stl[j][i]; |
8152 |
- } |
8153 |
- |
8154 |
- static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){ |
8155 |
- int N = B_stl.size(); |
8156 |
- B = new real[N]; |
8157 |
- for (int i=0;i<N;i++) |
8158 |
- B[i] = B_stl[i]; |
8159 |
- } |
8160 |
- |
8161 |
- static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){ |
8162 |
- int N = B_stl.size(); |
8163 |
- for (int i=0;i<N;i++) |
8164 |
- B_stl[i] = B[i]; |
8165 |
- } |
8166 |
- |
8167 |
- static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){ |
8168 |
- int N = A_stl.size(); |
8169 |
- for (int j=0;j<N;j++){ |
8170 |
- A_stl[j].resize(N); |
8171 |
- for (int i=0;i<N;i++) |
8172 |
- A_stl[j][i] = A[i+N*j]; |
8173 |
- } |
8174 |
- } |
8175 |
- |
8176 |
- static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){ |
8177 |
- for (int i=0;i<N;i++) |
8178 |
- cible[i]=source[i]; |
8179 |
- } |
8180 |
- |
8181 |
- static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){ |
8182 |
- for (int j=0;j<N;j++){ |
8183 |
- for (int i=0;i<N;i++){ |
8184 |
- cible[i+N*j] = source[i+N*j]; |
8185 |
- } |
8186 |
- } |
8187 |
- } |
8188 |
- |
8189 |
-}; |
8190 |
- |
8191 |
-#endif |
8192 |
|
8193 |
diff --git a/btl/libs/BLAS/cblas_interface_impl.hh b/btl/libs/BLAS/cblas_interface_impl.hh |
8194 |
deleted file mode 100644 |
8195 |
index 2da195e..0000000 |
8196 |
--- a/btl/libs/BLAS/cblas_interface_impl.hh |
8197 |
+++ /dev/null |
8198 |
@@ -1,96 +0,0 @@ |
8199 |
-//===================================================== |
8200 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
8201 |
-//===================================================== |
8202 |
-// |
8203 |
-// This program is free software; you can redistribute it and/or |
8204 |
-// modify it under the terms of the GNU General Public License |
8205 |
-// as published by the Free Software Foundation; either version 2 |
8206 |
-// of the License, or (at your option) any later version. |
8207 |
-// |
8208 |
-// This program is distributed in the hope that it will be useful, |
8209 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
8210 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8211 |
-// GNU General Public License for more details. |
8212 |
-// You should have received a copy of the GNU General Public License |
8213 |
-// along with this program; if not, write to the Free Software |
8214 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
8215 |
-// |
8216 |
- |
8217 |
-#define BLAS_FUNC(NAME) CAT(cblas_,CAT(SCALAR_PREFIX,NAME)) |
8218 |
- |
8219 |
-template<> class blas_interface<SCALAR> : public c_interface_base<SCALAR> |
8220 |
-{ |
8221 |
- |
8222 |
-public : |
8223 |
- |
8224 |
- static SCALAR fone; |
8225 |
- static SCALAR fzero; |
8226 |
- |
8227 |
- static inline std::string name() |
8228 |
- { |
8229 |
- return MAKE_STRING(CBLASNAME); |
8230 |
- } |
8231 |
- |
8232 |
- static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8233 |
- BLAS_FUNC(gemv)(CblasColMajor,CblasNoTrans,N,N,fone,A,N,B,intone,fzero,X,intone); |
8234 |
- } |
8235 |
- |
8236 |
- static inline void symv(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8237 |
- BLAS_FUNC(symv)(CblasColMajor,CblasLower,N,fone,A,N,B,intone,fzero,X,intone); |
8238 |
- } |
8239 |
- |
8240 |
- static inline void syr2(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8241 |
- BLAS_FUNC(syr2)(CblasColMajor,CblasLower,N,fone,B,intone,X,intone,A,N); |
8242 |
- } |
8243 |
- |
8244 |
- static inline void ger(gene_matrix & A, gene_vector & X, gene_vector & Y, int N){ |
8245 |
- BLAS_FUNC(ger)(CblasColMajor,N,N,fone,X,intone,Y,intone,A,N); |
8246 |
- } |
8247 |
- |
8248 |
- static inline void rot(gene_vector & A, gene_vector & B, SCALAR c, SCALAR s, int N){ |
8249 |
- BLAS_FUNC(rot)(N,A,intone,B,intone,c,s); |
8250 |
- } |
8251 |
- |
8252 |
- static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ |
8253 |
- BLAS_FUNC(gemv)(CblasColMajor,CblasTrans,N,N,fone,A,N,B,intone,fzero,X,intone); |
8254 |
- } |
8255 |
- |
8256 |
- static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){ |
8257 |
- BLAS_FUNC(gemm)(CblasColMajor,CblasNoTrans,CblasNoTrans,N,N,N,fone,A,N,B,N,fzero,X,N); |
8258 |
- } |
8259 |
- |
8260 |
- static inline void transposed_matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){ |
8261 |
- BLAS_FUNC(gemm)(CblasColMajor,CblasTrans,CblasNoTrans,N,N,N,fone,A,N,B,N,fzero,X,N); |
8262 |
- } |
8263 |
- |
8264 |
- static inline void aat_product(gene_matrix & A, gene_matrix & X, int N){ |
8265 |
- BLAS_FUNC(syrk)(CblasColMajor,CblasLower,CblasNoTrans,N,N,fone,A,N,fzero,X,N); |
8266 |
- } |
8267 |
- |
8268 |
- static inline void axpy(SCALAR coef, const gene_vector & X, gene_vector & Y, int N){ |
8269 |
- BLAS_FUNC(axpy)(N,coef,X,intone,Y,intone); |
8270 |
- } |
8271 |
- |
8272 |
- static inline void axpby(SCALAR a, const gene_vector & X, SCALAR b, gene_vector & Y, int N){ |
8273 |
- BLAS_FUNC(scal)(N,b,Y,intone); |
8274 |
- BLAS_FUNC(axpy)(N,a,X,intone,Y,intone); |
8275 |
- } |
8276 |
- |
8277 |
- static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector & X, int N){ |
8278 |
- BLAS_FUNC(copy)(N, B, intone, X, intone); |
8279 |
- BLAS_FUNC(trsv)(CblasColMajor,CblasLower, CblasNoTrans, CblasNonUnit, N, L, N, X, intone); |
8280 |
- } |
8281 |
- |
8282 |
- static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix & X, int N){ |
8283 |
- BLAS_FUNC(copy)(N, B, intone, X, intone); |
8284 |
- BLAS_FUNC(trsm)(CblasColMajor,CblasRight, CblasLower, CblasNoTrans, CblasNonUnit, N, N, fone, L, N, X, N); |
8285 |
- } |
8286 |
- |
8287 |
- static inline void trmm(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N){ |
8288 |
- BLAS_FUNC(trmm)(CblasColMajor,CblasLeft, CblasLower, CblasNoTrans,CblasNonUnit, N,N,fone,A,N,B,N); |
8289 |
- } |
8290 |
- |
8291 |
-}; |
8292 |
- |
8293 |
-SCALAR blas_interface<SCALAR>::fone = SCALAR(1); |
8294 |
-SCALAR blas_interface<SCALAR>::fzero = SCALAR(0); |
8295 |
|
8296 |
diff --git a/btl/libs/BLAS/main.cpp b/btl/libs/BLAS/main.cpp |
8297 |
index 401cb5b..da156b8 100644 |
8298 |
--- a/btl/libs/BLAS/main.cpp |
8299 |
+++ b/btl/libs/BLAS/main.cpp |
8300 |
@@ -1,8 +1,5 @@ |
8301 |
//===================================================== |
8302 |
-// File : main.cpp |
8303 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
8304 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:28 CEST 2002 |
8305 |
-// Copyright (C) 2011 Andrea Arteaga <andyspiros@×××××.com> |
8306 |
+// Copyright (C) 2012 Andrea Arteaga <andyspiros@×××××.com> |
8307 |
//===================================================== |
8308 |
// |
8309 |
// This program is free software; you can redistribute it and/or |
8310 |
@@ -19,17 +16,16 @@ |
8311 |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
8312 |
// |
8313 |
|
8314 |
-#ifndef BLAS_INTERFACE |
8315 |
-# ifndef CBLAS_INTERFACE |
8316 |
-# define BLAS_INTERFACE |
8317 |
-# endif |
8318 |
-#endif |
8319 |
+// Include the numeric interface |
8320 |
+#define NI_FORTRAN |
8321 |
+#include "NumericInterface.hpp" |
8322 |
|
8323 |
+// Include the BTL |
8324 |
#include "utilities.h" |
8325 |
-#include "blas_interface.hh" |
8326 |
#include "bench.hh" |
8327 |
-#include "basic_actions.hh" |
8328 |
-#include "action_trisolve_matrix.hh" |
8329 |
+ |
8330 |
+// Include the operations |
8331 |
+#include "actionsBLAS.hpp" |
8332 |
|
8333 |
#include <string> |
8334 |
|
8335 |
@@ -37,80 +33,17 @@ BTL_MAIN; |
8336 |
|
8337 |
int main(int argv, char **argc) |
8338 |
{ |
8339 |
- bool |
8340 |
- axpy=false, axpby=false, rot=false, |
8341 |
- matrix_vector=false, atv=false, symv=false, syr2=false, ger=false, trisolve_vector=false, |
8342 |
- matrix_matrix=false, aat=false, trisolve_matrix=false, trmm=false |
8343 |
- ; |
8344 |
- int N = 100; |
8345 |
- |
8346 |
- |
8347 |
- for (int i = 1; i < argv; ++i) { |
8348 |
- std::string arg = argc[i]; |
8349 |
- if (arg == "axpy") axpy = true; |
8350 |
- else if (arg == "axpby") axpby = true; |
8351 |
- else if (arg == "rot") rot = true; |
8352 |
- else if (arg == "matrix_vector") matrix_vector = true; |
8353 |
- else if (arg == "atv") atv = true; |
8354 |
- else if (arg == "symv") symv = true; |
8355 |
- else if (arg == "syr2") syr2 = true; |
8356 |
- else if (arg == "ger") ger = true; |
8357 |
- else if (arg == "trisolve_vector") trisolve_vector = true; |
8358 |
- else if (arg == "matrix_matrix") matrix_matrix = true; |
8359 |
- else if (arg == "aat") aat = true; |
8360 |
- else if (arg == "trisolve_matrix") trisolve_matrix = true; |
8361 |
- else if (arg == "trmm") trmm = true; |
8362 |
- |
8363 |
- else if (arg[0] == '1' && arg[1] == '\0') { |
8364 |
- axpy = true; axpby = true; rot = true; |
8365 |
- } |
8366 |
- else if (arg[0] == '2' && arg[1] == '\0') { |
8367 |
- matrix_vector=true; atv=true; symv=true; syr2=true; ger=true; trisolve_vector=true; |
8368 |
- } |
8369 |
- else if (arg[0] == '3' && arg[1] == '\0') { |
8370 |
- matrix_matrix=true; aat=true; trisolve_matrix=true; trmm=true; |
8371 |
- } |
8372 |
- |
8373 |
- // Check switch -N |
8374 |
- else if (arg[0] == '-' && arg[1] == 'N') { |
8375 |
- if (arg[2] != '\0') |
8376 |
- N = atoi(arg.c_str()+2); |
8377 |
- else |
8378 |
- N = atoi(argc[++i]); |
8379 |
- } |
8380 |
- } |
8381 |
- |
8382 |
- if (axpy) |
8383 |
- bench<Action_axpy<blas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY, N); |
8384 |
- if (axpby) |
8385 |
- bench<Action_axpby<blas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY, N); |
8386 |
- if (rot) |
8387 |
- bench<Action_rot<blas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY, N); |
8388 |
+ bench<Action_axpy<NumericInterface<double> > >(4, 6000, 20); |
8389 |
+ bench<Action_rot<NumericInterface<double> > >(4, 6000, 20); |
8390 |
|
8391 |
- if (matrix_vector) |
8392 |
- bench<Action_matrix_vector_product<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV, N); |
8393 |
- if (atv) |
8394 |
- bench<Action_atv_product<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV, N); |
8395 |
- if (symv) |
8396 |
- bench<Action_symv<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV, N); |
8397 |
- if (syr2) |
8398 |
- bench<Action_syr2<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV, N); |
8399 |
- if (ger) |
8400 |
- bench<Action_ger<blas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV, N); |
8401 |
- if (trisolve_vector) |
8402 |
- bench<Action_trisolve<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM, N); |
8403 |
- |
8404 |
- if (matrix_matrix) |
8405 |
- bench<Action_matrix_matrix_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM, N); |
8406 |
- if (aat) |
8407 |
- bench<Action_aat_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM, N); |
8408 |
- if (trisolve_matrix) |
8409 |
- bench<Action_trisolve_matrix<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM, N); |
8410 |
- if (trmm) |
8411 |
- bench<Action_trmm<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM, N); |
8412 |
+ bench<Action_MatrixVector<NumericInterface<double> > >(4, 2000, 20); |
8413 |
+ bench<Action_MatrixTVector<NumericInterface<double> > >(4, 2000, 20); |
8414 |
+ bench<Action_SymMatrixVector<NumericInterface<double> > >(4, 2000, 20); |
8415 |
+ bench<Action_TriSolveVector<NumericInterface<double> > >(4, 2000, 20); |
8416 |
+ bench<Action_Rank1Update<NumericInterface<double> > >(4, 2000, 20); |
8417 |
+ bench<Action_Rank2Update<NumericInterface<double> > >(4, 2000, 20); |
8418 |
|
8419 |
|
8420 |
return 0; |
8421 |
} |
8422 |
|
8423 |
- |
8424 |
|
8425 |
diff --git a/btl/libs/STL/CMakeLists.txt b/btl/libs/STL/CMakeLists.txt |
8426 |
deleted file mode 100644 |
8427 |
index 4cfc2dc..0000000 |
8428 |
--- a/btl/libs/STL/CMakeLists.txt |
8429 |
+++ /dev/null |
8430 |
@@ -1,2 +0,0 @@ |
8431 |
- |
8432 |
-btl_add_bench(btl_STL main.cpp OFF) |
8433 |
|
8434 |
diff --git a/btl/libs/STL/STL_interface.hh b/btl/libs/STL/STL_interface.hh |
8435 |
deleted file mode 100644 |
8436 |
index 060cb69..0000000 |
8437 |
--- a/btl/libs/STL/STL_interface.hh |
8438 |
+++ /dev/null |
8439 |
@@ -1,255 +0,0 @@ |
8440 |
-//===================================================== |
8441 |
-// File : STL_interface.hh |
8442 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
8443 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:24 CEST 2002 |
8444 |
-//===================================================== |
8445 |
-// |
8446 |
-// This program is free software; you can redistribute it and/or |
8447 |
-// modify it under the terms of the GNU General Public License |
8448 |
-// as published by the Free Software Foundation; either version 2 |
8449 |
-// of the License, or (at your option) any later version. |
8450 |
-// |
8451 |
-// This program is distributed in the hope that it will be useful, |
8452 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
8453 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8454 |
-// GNU General Public License for more details. |
8455 |
-// You should have received a copy of the GNU General Public License |
8456 |
-// along with this program; if not, write to the Free Software |
8457 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
8458 |
-// |
8459 |
-#ifndef STL_INTERFACE_HH |
8460 |
-#define STL_INTERFACE_HH |
8461 |
-#include <string> |
8462 |
-#include <vector> |
8463 |
-#include "utilities.h" |
8464 |
- |
8465 |
-using namespace std; |
8466 |
- |
8467 |
-template<class real> |
8468 |
-class STL_interface{ |
8469 |
- |
8470 |
-public : |
8471 |
- |
8472 |
- typedef real real_type ; |
8473 |
- |
8474 |
- typedef std::vector<real> stl_vector; |
8475 |
- typedef std::vector<stl_vector > stl_matrix; |
8476 |
- |
8477 |
- typedef stl_matrix gene_matrix; |
8478 |
- |
8479 |
- typedef stl_vector gene_vector; |
8480 |
- |
8481 |
- static inline std::string name( void ) |
8482 |
- { |
8483 |
- return "STL"; |
8484 |
- } |
8485 |
- |
8486 |
- static void free_matrix(gene_matrix & A, int N){} |
8487 |
- |
8488 |
- static void free_vector(gene_vector & B){} |
8489 |
- |
8490 |
- static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ |
8491 |
- A = A_stl; |
8492 |
- } |
8493 |
- |
8494 |
- static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){ |
8495 |
- B = B_stl; |
8496 |
- } |
8497 |
- |
8498 |
- static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){ |
8499 |
- B_stl = B ; |
8500 |
- } |
8501 |
- |
8502 |
- |
8503 |
- static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){ |
8504 |
- A_stl = A ; |
8505 |
- } |
8506 |
- |
8507 |
- static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){ |
8508 |
- for (int i=0;i<N;i++){ |
8509 |
- cible[i]=source[i]; |
8510 |
- } |
8511 |
- } |
8512 |
- |
8513 |
- |
8514 |
- static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){ |
8515 |
- for (int i=0;i<N;i++) |
8516 |
- for (int j=0;j<N;j++) |
8517 |
- cible[i][j]=source[i][j]; |
8518 |
- } |
8519 |
- |
8520 |
-// static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N) |
8521 |
-// { |
8522 |
-// real somme; |
8523 |
-// for (int j=0;j<N;j++){ |
8524 |
-// for (int i=0;i<N;i++){ |
8525 |
-// somme=0.0; |
8526 |
-// for (int k=0;k<N;k++) |
8527 |
-// somme += A[i][k]*A[j][k]; |
8528 |
-// X[j][i]=somme; |
8529 |
-// } |
8530 |
-// } |
8531 |
-// } |
8532 |
- |
8533 |
- static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N) |
8534 |
- { |
8535 |
- real somme; |
8536 |
- for (int j=0;j<N;j++){ |
8537 |
- for (int i=0;i<N;i++){ |
8538 |
- somme=0.0; |
8539 |
- if(i>=j) |
8540 |
- { |
8541 |
- for (int k=0;k<N;k++){ |
8542 |
- somme+=A[k][i]*A[k][j]; |
8543 |
- } |
8544 |
- X[j][i]=somme; |
8545 |
- } |
8546 |
- } |
8547 |
- } |
8548 |
- } |
8549 |
- |
8550 |
- |
8551 |
- static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N) |
8552 |
- { |
8553 |
- real somme; |
8554 |
- for (int j=0;j<N;j++){ |
8555 |
- for (int i=0;i<N;i++){ |
8556 |
- somme=0.0; |
8557 |
- for (int k=0;k<N;k++) |
8558 |
- somme+=A[k][i]*B[j][k]; |
8559 |
- X[j][i]=somme; |
8560 |
- } |
8561 |
- } |
8562 |
- } |
8563 |
- |
8564 |
- static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) |
8565 |
- { |
8566 |
- real somme; |
8567 |
- for (int i=0;i<N;i++){ |
8568 |
- somme=0.0; |
8569 |
- for (int j=0;j<N;j++) |
8570 |
- somme+=A[j][i]*B[j]; |
8571 |
- X[i]=somme; |
8572 |
- } |
8573 |
- } |
8574 |
- |
8575 |
- static inline void matrix_vector_product(gene_vector& A, gene_vector & B, gene_vector & X, int N) |
8576 |
- { |
8577 |
- real somme; |
8578 |
- for (int i=0;i<N;i++){ |
8579 |
- somme=0.0; |
8580 |
- for (int j=0;j<N;j++) |
8581 |
- somme+=A[j*N+i]*B[j]; |
8582 |
- X[i]=somme; |
8583 |
- } |
8584 |
- } |
8585 |
- |
8586 |
- static inline void symv(gene_matrix & A, gene_vector & B, gene_vector & X, int N) |
8587 |
- { |
8588 |
- for (int j=0; j<N; ++j) |
8589 |
- X[j] = 0; |
8590 |
- for (int j=0; j<N; ++j) |
8591 |
- { |
8592 |
- real t1 = B[j]; |
8593 |
- real t2 = 0; |
8594 |
- X[j] += t1 * A[j][j]; |
8595 |
- for (int i=j+1; i<N; ++i) { |
8596 |
- X[i] += t1 * A[j][i]; |
8597 |
- t2 += A[j][i] * B[i]; |
8598 |
- } |
8599 |
- X[j] += t2; |
8600 |
- } |
8601 |
- } |
8602 |
- |
8603 |
- static inline void syr2(gene_matrix & A, gene_vector & B, gene_vector & X, int N) |
8604 |
- { |
8605 |
- for (int j=0; j<N; ++j) |
8606 |
- { |
8607 |
- for (int i=j; i<N; ++i) |
8608 |
- A[j][i] += B[i]*X[j] + B[j]*X[i]; |
8609 |
- } |
8610 |
- } |
8611 |
- |
8612 |
- static inline void ger(gene_matrix & A, gene_vector & X, gene_vector & Y, int N) |
8613 |
- { |
8614 |
- for (int j=0; j<N; ++j) |
8615 |
- { |
8616 |
- for (int i=j; i<N; ++i) |
8617 |
- A[j][i] += X[i]*Y[j]; |
8618 |
- } |
8619 |
- } |
8620 |
- |
8621 |
- static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) |
8622 |
- { |
8623 |
- real somme; |
8624 |
- for (int i=0;i<N;i++){ |
8625 |
- somme = 0.0; |
8626 |
- for (int j=0;j<N;j++) |
8627 |
- somme += A[i][j]*B[j]; |
8628 |
- X[i] = somme; |
8629 |
- } |
8630 |
- } |
8631 |
- |
8632 |
- static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N){ |
8633 |
- for (int i=0;i<N;i++) |
8634 |
- Y[i]+=coef*X[i]; |
8635 |
- } |
8636 |
- |
8637 |
- static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){ |
8638 |
- for (int i=0;i<N;i++) |
8639 |
- Y[i] = a*X[i] + b*Y[i]; |
8640 |
- } |
8641 |
- |
8642 |
- static inline void trisolve_lower(const gene_matrix & L, const gene_vector & B, gene_vector & X, int N){ |
8643 |
- copy_vector(B,X,N); |
8644 |
- for(int i=0; i<N; ++i) |
8645 |
- { |
8646 |
- X[i] /= L[i][i]; |
8647 |
- real tmp = X[i]; |
8648 |
- for (int j=i+1; j<N; ++j) |
8649 |
- X[j] -= tmp * L[i][j]; |
8650 |
- } |
8651 |
- } |
8652 |
- |
8653 |
- static inline real norm_diff(const stl_vector & A, const stl_vector & B) |
8654 |
- { |
8655 |
- int N=A.size(); |
8656 |
- real somme=0.0; |
8657 |
- real somme2=0.0; |
8658 |
- |
8659 |
- for (int i=0;i<N;i++){ |
8660 |
- real diff=A[i]-B[i]; |
8661 |
- somme+=diff*diff; |
8662 |
- somme2+=A[i]*A[i]; |
8663 |
- } |
8664 |
- return somme/somme2; |
8665 |
- } |
8666 |
- |
8667 |
- static inline real norm_diff(const stl_matrix & A, const stl_matrix & B) |
8668 |
- { |
8669 |
- int N=A[0].size(); |
8670 |
- real somme=0.0; |
8671 |
- real somme2=0.0; |
8672 |
- |
8673 |
- for (int i=0;i<N;i++){ |
8674 |
- for (int j=0;j<N;j++){ |
8675 |
- real diff=A[i][j] - B[i][j]; |
8676 |
- somme += diff*diff; |
8677 |
- somme2 += A[i][j]*A[i][j]; |
8678 |
- } |
8679 |
- } |
8680 |
- |
8681 |
- return somme/somme2; |
8682 |
- } |
8683 |
- |
8684 |
- static inline void display_vector(const stl_vector & A) |
8685 |
- { |
8686 |
- int N=A.size(); |
8687 |
- for (int i=0;i<N;i++){ |
8688 |
- INFOS("A["<<i<<"]="<<A[i]<<endl); |
8689 |
- } |
8690 |
- } |
8691 |
- |
8692 |
-}; |
8693 |
- |
8694 |
-#endif |
8695 |
|
8696 |
diff --git a/btl/libs/STL/main.cpp b/btl/libs/STL/main.cpp |
8697 |
deleted file mode 100644 |
8698 |
index 4e73328..0000000 |
8699 |
--- a/btl/libs/STL/main.cpp |
8700 |
+++ /dev/null |
8701 |
@@ -1,42 +0,0 @@ |
8702 |
-//===================================================== |
8703 |
-// File : main.cpp |
8704 |
-// Author : L. Plagne <laurent.plagne@×××.fr)> |
8705 |
-// Copyright (C) EDF R&D, lun sep 30 14:23:23 CEST 2002 |
8706 |
-//===================================================== |
8707 |
-// |
8708 |
-// This program is free software; you can redistribute it and/or |
8709 |
-// modify it under the terms of the GNU General Public License |
8710 |
-// as published by the Free Software Foundation; either version 2 |
8711 |
-// of the License, or (at your option) any later version. |
8712 |
-// |
8713 |
-// This program is distributed in the hope that it will be useful, |
8714 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
8715 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8716 |
-// GNU General Public License for more details. |
8717 |
-// You should have received a copy of the GNU General Public License |
8718 |
-// along with this program; if not, write to the Free Software |
8719 |
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
8720 |
-// |
8721 |
-#include "utilities.h" |
8722 |
-#include "STL_interface.hh" |
8723 |
-#include "bench.hh" |
8724 |
-#include "basic_actions.hh" |
8725 |
- |
8726 |
-BTL_MAIN; |
8727 |
- |
8728 |
-int main() |
8729 |
-{ |
8730 |
- bench<Action_axpy<STL_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); |
8731 |
- bench<Action_axpby<STL_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); |
8732 |
- bench<Action_matrix_vector_product<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); |
8733 |
- bench<Action_atv_product<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); |
8734 |
- bench<Action_symv<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); |
8735 |
- bench<Action_syr2<STL_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); |
8736 |
- bench<Action_matrix_matrix_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); |
8737 |
- bench<Action_ata_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); |
8738 |
- bench<Action_aat_product<STL_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); |
8739 |
- |
8740 |
- return 0; |
8741 |
-} |
8742 |
- |
8743 |
- |
8744 |
|
8745 |
diff --git a/numbench/modules/internal/blasBase.py b/numbench/modules/internal/blasBase.py |
8746 |
index dd786db..bf2faf5 100644 |
8747 |
--- a/numbench/modules/internal/blasBase.py |
8748 |
+++ b/numbench/modules/internal/blasBase.py |
8749 |
@@ -21,11 +21,12 @@ import btlBase |
8750 |
from os.path import join as pjoin |
8751 |
|
8752 |
|
8753 |
-avail1 = ('axpy', 'axpby', 'rot') |
8754 |
-avail2 = ('matrix_vector', 'atv', 'symv', 'ger', 'syr2', 'trisolve_vector') |
8755 |
-avail3 = ('matrix_matrix', 'aat', 'trisolve_matrix', 'trmm') |
8756 |
+avail1 = ('axpy', 'rot') |
8757 |
+avail2 = ('MatrixVector', 'MatrixTVector', 'SymMatrixVector', |
8758 |
+ 'Rank1Update', 'Rank2Update', 'TriSolveVector') |
8759 |
+avail3 = ('MatrixMatrix', 'MatrixTMatrix', 'TriMatrixMatrix', 'TriSolveMatrix') |
8760 |
availableTests = avail1 + avail2 + avail3 |
8761 |
-defaultTests = ('axpy', 'matrix_vector', 'trisolve_vector', 'matrix_matrix') |
8762 |
+defaultTests = ('axpy', 'MatrixVector', 'TriSolveVector', 'MatrixMatrix') |
8763 |
|
8764 |
|
8765 |
def init(self, args): |
8766 |
|
8767 |
diff --git a/numbench/testdescr.py b/numbench/testdescr.py |
8768 |
index 3db919b..1f96080 100644 |
8769 |
--- a/numbench/testdescr.py |
8770 |
+++ b/numbench/testdescr.py |
8771 |
@@ -20,18 +20,18 @@ testdescr = { |
8772 |
'axpy' : 'y = a*x + y', |
8773 |
'axpby' : 'y = a*x + b*y', |
8774 |
'rot': 'Apply Givens rotation', |
8775 |
-'matrix_vector': 'Matrix-Vector multiply', |
8776 |
-'atv': 'Transposed Matrix-Vector multiply (A\' * x)', |
8777 |
-'symv': 'Symmetric Matrix-Vector multiply', |
8778 |
-'ger': 'Rank-1 update', |
8779 |
-'syr2': 'Symmetric Rank-2 update', |
8780 |
-'trisolve_vector': 'Triangular system solution', |
8781 |
-'matrix_matrix': 'Matrix-Matrix multiply', |
8782 |
-'aat': 'Symmetric Rank-n update', |
8783 |
-'trisolve_matrix': 'Triangular system solution with n right hand side vectors', |
8784 |
-'trmm': 'Triangular Matrix-Matrix multiply', |
8785 |
+'MatrixVector': 'Matrix-Vector multiply', |
8786 |
+'MatrixTVector': 'Transposed Matrix-Vector multiply (A\' * x)', |
8787 |
+'SymMatrixVector': 'Symmetric Matrix-Vector multiply', |
8788 |
+'Rank1Update': 'Rank-1 update', |
8789 |
+'Rank2Update': 'Symmetric Rank-2 update', |
8790 |
+'TriSolveVector': 'Triangular system solution', |
8791 |
+'MatrixMatrix': 'Matrix-Matrix multiply', |
8792 |
+'MatrixTMatrix': 'Symmetric Rank-n update', |
8793 |
+'TriMatrixMatrix': 'Triangular Matrix-Matrix multiply', |
8794 |
+'TriSolveMatrix': 'Triangular system solution with n right hand side vectors', |
8795 |
|
8796 |
-# LAPACK |
8797 |
+# LAPACK(e) |
8798 |
'general_solve': 'Solution of a generic linear system of equations', |
8799 |
'least_squares': 'Least squares solution', |
8800 |
'lu_decomp': 'LU-decomposition', |