22#include "STL_interface.hh"
30template<
class Interface>
41 init_vector<pseudo_random>(X_stl,_size);
42 init_vector<pseudo_random>(Y_stl,_size);
43 init_vector<null_function>(resu_stl,_size);
46 Interface::vector_from_stl(X_ref,X_stl);
47 Interface::vector_from_stl(Y_ref,Y_stl);
49 Interface::vector_from_stl(X,X_stl);
50 Interface::vector_from_stl(Y,Y_stl);
56 INFOS(
"illegal call to Action_axpby Copy Ctor");
65 Interface::free_vector(X_ref);
66 Interface::free_vector(Y_ref);
68 Interface::free_vector(X);
69 Interface::free_vector(Y);
73 static inline std::string
name(
void )
75 return "axpby_"+Interface::name();
83 Interface::copy_vector(X_ref,X,_size);
84 Interface::copy_vector(Y_ref,Y,_size);
89 Interface::axpby(_alpha,X,_beta,Y,_size);
94 if (_size>128)
return;
96 Interface::vector_to_stl(Y,resu_stl);
98 STL_interface<typename Interface::real_type>::axpby(_alpha,X_stl,_beta,Y_stl,_size);
100 typename Interface::real_type error=
101 STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl);
104 INFOS(
"WRONG CALCULATION...residual=" << error);
111 typename Interface::stl_vector X_stl;
112 typename Interface::stl_vector Y_stl;
113 typename Interface::stl_vector resu_stl;
115 typename Interface::gene_vector X_ref;
116 typename Interface::gene_vector Y_ref;
118 typename Interface::gene_vector X;
119 typename Interface::gene_vector Y;
121 typename Interface::real_type _alpha;
122 typename Interface::real_type _beta;
Scalar Scalar int size
Definition benchVecAdd.cpp:17
#define BTL_ASM_COMMENT(X)
Definition btl.hh:44
Definition action_axpby.hh:31
double nb_op_base(void)
Definition action_axpby.hh:78
Action_axpby(const Action_axpby &)
Definition action_axpby.hh:54
Action_axpby(int size)
Definition action_axpby.hh:36
static std::string name(void)
Definition action_axpby.hh:73
~Action_axpby(void)
Definition action_axpby.hh:61
void initialize(void)
Definition action_axpby.hh:82
void check_result(void)
Definition action_axpby.hh:93
void calculate(void)
Definition action_axpby.hh:87
#define INFOS(chain)
Definition utilities.h:22
#define MESSAGE(chain)
Definition utilities.h:76