23#include "STL_interface.hh"
31template<
class Interface>
44 init_vector<pseudo_random>(X_stl,_size);
45 init_vector<pseudo_random>(Y_stl,_size);
46 init_vector<null_function>(resu_stl,_size);
50 Interface::vector_from_stl(X_ref,X_stl);
51 Interface::vector_from_stl(Y_ref,Y_stl);
53 Interface::vector_from_stl(X,X_stl);
54 Interface::vector_from_stl(Y,Y_stl);
63 INFOS(
"illegal call to Action_axpy Copy Ctor");
75 Interface::free_vector(X_ref);
76 Interface::free_vector(Y_ref);
78 Interface::free_vector(X);
79 Interface::free_vector(Y);
84 static inline std::string
name(
void )
86 return "axpy_"+Interface::name();
94 Interface::copy_vector(X_ref,X,_size);
95 Interface::copy_vector(Y_ref,Y,_size);
100 Interface::axpy(_coef,X,Y,_size);
105 if (_size>128)
return;
108 Interface::vector_to_stl(Y,resu_stl);
110 STL_interface<typename Interface::real_type>::axpy(_coef,X_stl,Y_stl,_size);
112 typename Interface::real_type error=
113 STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl);
116 INFOS(
"WRONG CALCULATION...residual=" << error);
124 typename Interface::stl_vector X_stl;
125 typename Interface::stl_vector Y_stl;
126 typename Interface::stl_vector resu_stl;
128 typename Interface::gene_vector X_ref;
129 typename Interface::gene_vector Y_ref;
131 typename Interface::gene_vector X;
132 typename Interface::gene_vector Y;
134 typename Interface::real_type _coef;
Scalar Scalar int size
Definition benchVecAdd.cpp:17
#define BTL_ASM_COMMENT(X)
Definition btl.hh:44
Definition action_axpy.hh:32
Action_axpy(int size)
Definition action_axpy.hh:38
~Action_axpy(void)
Definition action_axpy.hh:69
void initialize(void)
Definition action_axpy.hh:93
double nb_op_base(void)
Definition action_axpy.hh:89
void check_result(void)
Definition action_axpy.hh:104
Action_axpy(const Action_axpy &)
Definition action_axpy.hh:61
void calculate(void)
Definition action_axpy.hh:98
static std::string name(void)
Definition action_axpy.hh:84
#define INFOS(chain)
Definition utilities.h:22
#define MESSAGE(chain)
Definition utilities.h:76