summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiros <andyspiros@gmail.com>2011-07-21 00:27:37 +0200
committerspiros <andyspiros@gmail.com>2011-07-21 00:27:37 +0200
commitcb8694256a08f68e6447c7ff89e65809ef576e05 (patch)
treee1a5e1f4bc3897f9ecce65f552b221b9d0a76c02
parentUpdated much of the parallel BTL. Added first version of (almost (diff)
downloadauto-numerical-bench-cb8694256a08f68e6447c7ff89e65809ef576e05.tar.gz
auto-numerical-bench-cb8694256a08f68e6447c7ff89e65809ef576e05.tar.bz2
auto-numerical-bench-cb8694256a08f68e6447c7ff89e65809ef576e05.zip
Added 2D FFTW tests. Much work around FFTW.
-rw-r--r--btl/actions/action_fftw_1d.hh111
-rw-r--r--btl/actions/action_fftw_1d_backward_estimate.hh94
-rw-r--r--btl/actions/action_fftw_1d_backward_measure.hh94
-rw-r--r--btl/actions/action_fftw_1d_forward_estimate.hh94
-rw-r--r--btl/actions/action_fftw_1d_forward_measure.hh94
-rw-r--r--btl/actions/action_fftw_2d.hh111
-rw-r--r--btl/actions/base_action_fftw.hh69
-rw-r--r--btl/actions/fftw_actions.hh7
-rw-r--r--btl/generic_bench/bench.hh6
-rw-r--r--btl/generic_bench/timers/distributed_perf_analyzer_root.hh4
-rw-r--r--btl/libs/FFTW/fftw_interface.hh4
-rw-r--r--btl/libs/FFTW/main.cpp31
-rw-r--r--fftw.py5
13 files changed, 334 insertions, 390 deletions
diff --git a/btl/actions/action_fftw_1d.hh b/btl/actions/action_fftw_1d.hh
new file mode 100644
index 0000000..f81d4c3
--- /dev/null
+++ b/btl/actions/action_fftw_1d.hh
@@ -0,0 +1,111 @@
+#ifndef ACTION_FFTW_1D
+#define ACTION_FFTW_1D
+#include <string>
+#include <cmath>
+
+#include "base_action_fftw.hh"
+
+
+/* FORWARD - MEASURE */
+template<class Interface>
+class Action_FFTW_1D_Forward_Measure : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_1D_Forward_Measure(const int& size) :
+ Action_FFTW_base<Interface>(size, 1)
+ {
+ Interface::fftw_init_plan(this->p, size, this->X, this->Y, FFTW_FORWARD, FFTW_MEASURE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_1D_Forward_Measure_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return this->size_ * std::log(this->size_)/log_2;
+ }
+};
+
+
+/* FORWARD - ESTIMATE */
+template<class Interface>
+class Action_FFTW_1D_Forward_Estimate : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_1D_Forward_Estimate(const int& size) :
+ Action_FFTW_base<Interface>(size, 1)
+ {
+ Interface::fftw_init_plan(this->p, size, this->X, this->Y, FFTW_FORWARD, FFTW_ESTIMATE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_1D_Forward_Estimate_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return this->size_ * std::log(this->size_)/log_2;
+ }
+};
+
+/* BACKWARD - MEASURE */
+template<class Interface>
+class Action_FFTW_1D_Backward_Measure : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_1D_Backward_Measure(const int& size) :
+ Action_FFTW_base<Interface>(size, 1)
+ {
+ Interface::fftw_init_plan(this->p, size, this->X, this->Y, FFTW_BACKWARD, FFTW_MEASURE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_1D_Backward_Measure_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return this->size_ * std::log(this->size_)/log_2;
+ }
+};
+
+
+/* BACKWARD - ESTIMATE */
+template<class Interface>
+class Action_FFTW_1D_Backward_Estimate : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_1D_Backward_Estimate(const int& size) :
+ Action_FFTW_base<Interface>(size, 1)
+ {
+ Interface::fftw_init_plan(this->p, size, this->X, this->Y, FFTW_BACKWARD, FFTW_ESTIMATE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_1D_Backward_Estimate_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return this->size_ * std::log(this->size_)/log_2;
+ }
+};
+
+#endif // ACTION_FFTW_1D
diff --git a/btl/actions/action_fftw_1d_backward_estimate.hh b/btl/actions/action_fftw_1d_backward_estimate.hh
deleted file mode 100644
index eda5468..0000000
--- a/btl/actions/action_fftw_1d_backward_estimate.hh
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef ACTION_FFTW_1D_BACKWARD_ESTIMATE
-#define ACTION_FFTW_1D_BACKWARD_ESTIMATE
-#include "utilities.h"
-#include "STL_interface.hh"
-#include <string>
-#include <cmath>
-#include "init/init_function.hh"
-#include "init/init_vector.hh"
-
-using namespace std;
-
-template<class Interface>
-class Action_FFTW_1D_Backward_Estimate {
-
-public :
-
- // Ctor
-
- Action_FFTW_1D_Backward_Estimate( int size ):_size(size)
- {
- MESSAGE("Action_FFTW_1D_Backward_Estimate Ctor");
-
- // STL vector initialization
-
- init_vector<pseudo_random>(X_stl,_size);
- init_vector<null_function>(Y_stl,_size);
-
- // generic matrix and vector initialization
-
- Interface::vector_from_stl(X,X_stl);
- Interface::vector_from_stl(Y,Y_stl);
-
- Interface::fftw_init_plan(p,_size, X, Y, FFTW_FORWARD, FFTW_MEASURE);
-
- }
-
- // invalidate copy ctor
-
- Action_FFTW_1D_Backward_Estimate( const Action_FFTW_1D_Backward_Estimate & )
- {
- INFOS("illegal call to Action_FFTW_1D_Backward_Estimate Copy Ctor");
- exit(1);
- }
-
- // Dtor
-
- ~Action_FFTW_1D_Backward_Estimate( void ){
-
- MESSAGE("Action_FFTW_1D_Backward_Estimate Dtor");
-
- // deallocation
-
- Interface::free_vector(X);
- Interface::free_vector(Y);
- }
-
- // action name
-
- static inline std::string name( void )
- {
- return "FFTW_1D_Backward_Estimate_"+Interface::name();
- }
-
- double nb_op_base( void ){
- const static double log_2 = log(2.);
- return _size * log(_size)/log_2;
- }
-
- inline void initialize( void ){
- }
-
- inline void calculate( void ) {
- BTL_ASM_COMMENT("mybegin FFTW_1D_Backward_Estimate");
- Interface::fftw_run(p);
- BTL_ASM_COMMENT("myend FFTW_1D_Backward_Estimate");
- }
-
- void check_result( void ){
- }
-
-private :
-
- typename Interface::stl_vector X_stl;
- typename Interface::stl_vector Y_stl;
-
- typename Interface::gene_vector X;
- typename Interface::gene_vector Y;
-
- typename Interface::plan p;
-
- int _size;
-};
-
-#endif // ACTION_FFTW_1D_BACKWARD_ESTIMATE
diff --git a/btl/actions/action_fftw_1d_backward_measure.hh b/btl/actions/action_fftw_1d_backward_measure.hh
deleted file mode 100644
index e204423..0000000
--- a/btl/actions/action_fftw_1d_backward_measure.hh
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef ACTION_FFTW_1D_BACKWARD_MEASURE
-#define ACTION_FFTW_1D_BACKWARD_MEASURE
-#include "utilities.h"
-#include "STL_interface.hh"
-#include <string>
-#include <cmath>
-#include "init/init_function.hh"
-#include "init/init_vector.hh"
-
-using namespace std;
-
-template<class Interface>
-class Action_FFTW_1D_Backward_Measure {
-
-public :
-
- // Ctor
-
- Action_FFTW_1D_Backward_Measure( int size ):_size(size)
- {
- MESSAGE("Action_FFTW_1D_Backward_Measure Ctor");
-
- // STL vector initialization
-
- init_vector<pseudo_random>(X_stl,_size);
- init_vector<null_function>(Y_stl,_size);
-
- // generic matrix and vector initialization
-
- Interface::vector_from_stl(X,X_stl);
- Interface::vector_from_stl(Y,Y_stl);
-
- Interface::fftw_init_plan(p,_size, X, Y, FFTW_FORWARD, FFTW_MEASURE);
-
- }
-
- // invalidate copy ctor
-
- Action_FFTW_1D_Backward_Measure( const Action_FFTW_1D_Backward_Measure & )
- {
- INFOS("illegal call to Action_FFTW_1D_Backward_Measure Copy Ctor");
- exit(1);
- }
-
- // Dtor
-
- ~Action_FFTW_1D_Backward_Measure( void ){
-
- MESSAGE("Action_FFTW_1D_Backward_Measure Dtor");
-
- // deallocation
-
- Interface::free_vector(X);
- Interface::free_vector(Y);
- }
-
- // action name
-
- static inline std::string name( void )
- {
- return "FFTW_1D_Backward_Measure_"+Interface::name();
- }
-
- double nb_op_base( void ){
- const static double log_2 = log(2.);
- return _size * log(_size)/log_2;
- }
-
- inline void initialize( void ){
- }
-
- inline void calculate( void ) {
- BTL_ASM_COMMENT("mybegin FFTW_1D_Backward_Measure");
- Interface::fftw_run(p);
- BTL_ASM_COMMENT("myend FFTW_1D_Backward_Measure");
- }
-
- void check_result( void ){
- }
-
-private :
-
- typename Interface::stl_vector X_stl;
- typename Interface::stl_vector Y_stl;
-
- typename Interface::gene_vector X;
- typename Interface::gene_vector Y;
-
- typename Interface::plan p;
-
- int _size;
-};
-
-#endif // ACTION_FFTW_1D_BACKWARD_MEASURE
diff --git a/btl/actions/action_fftw_1d_forward_estimate.hh b/btl/actions/action_fftw_1d_forward_estimate.hh
deleted file mode 100644
index efd8743..0000000
--- a/btl/actions/action_fftw_1d_forward_estimate.hh
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef ACTION_FFTW_1D_FORWARD_ESTIMATE
-#define ACTION_FFTW_1D_FORWARD_ESTIMATE
-#include "utilities.h"
-#include "STL_interface.hh"
-#include <string>
-#include <cmath>
-#include "init/init_function.hh"
-#include "init/init_vector.hh"
-
-using namespace std;
-
-template<class Interface>
-class Action_FFTW_1D_Forward_Estimate {
-
-public :
-
- // Ctor
-
- Action_FFTW_1D_Forward_Estimate( int size ):_size(size)
- {
- MESSAGE("Action_FFTW_1D_Forward_Estimate Ctor");
-
- // STL vector initialization
-
- init_vector<pseudo_random>(X_stl,_size);
- init_vector<null_function>(Y_stl,_size);
-
- // generic matrix and vector initialization
-
- Interface::vector_from_stl(X,X_stl);
- Interface::vector_from_stl(Y,Y_stl);
-
- Interface::fftw_init_plan(p,_size, X, Y, FFTW_FORWARD, FFTW_MEASURE);
-
- }
-
- // invalidate copy ctor
-
- Action_FFTW_1D_Forward_Estimate( const Action_FFTW_1D_Forward_Estimate & )
- {
- INFOS("illegal call to Action_FFTW_1D_Forward_Estimate Copy Ctor");
- exit(1);
- }
-
- // Dtor
-
- ~Action_FFTW_1D_Forward_Estimate( void ){
-
- MESSAGE("Action_FFTW_1D_Forward_Estimate Dtor");
-
- // deallocation
-
- Interface::free_vector(X);
- Interface::free_vector(Y);
- }
-
- // action name
-
- static inline std::string name( void )
- {
- return "FFTW_1D_Forward_Estimate_"+Interface::name();
- }
-
- double nb_op_base( void ){
- const static double log_2 = log(2.);
- return _size * log(_size)/log_2;
- }
-
- inline void initialize( void ){
- }
-
- inline void calculate( void ) {
- BTL_ASM_COMMENT("mybegin FFTW_1D_Forward_Estimate");
- Interface::fftw_run(p);
- BTL_ASM_COMMENT("myend FFTW_1D_Forward_Estimate");
- }
-
- void check_result( void ){
- }
-
-private :
-
- typename Interface::stl_vector X_stl;
- typename Interface::stl_vector Y_stl;
-
- typename Interface::gene_vector X;
- typename Interface::gene_vector Y;
-
- typename Interface::plan p;
-
- int _size;
-};
-
-#endif // ACTION_FFTW_1D_FORWARD_ESTIMATE
diff --git a/btl/actions/action_fftw_1d_forward_measure.hh b/btl/actions/action_fftw_1d_forward_measure.hh
deleted file mode 100644
index 2697230..0000000
--- a/btl/actions/action_fftw_1d_forward_measure.hh
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef ACTION_FFTW_1D_FORWARD_MEASURE
-#define ACTION_FFTW_1D_FORWARD_MEASURE
-#include "utilities.h"
-#include "STL_interface.hh"
-#include <string>
-#include <cmath>
-#include "init/init_function.hh"
-#include "init/init_vector.hh"
-
-using namespace std;
-
-template<class Interface>
-class Action_FFTW_1D_Forward_Measure {
-
-public :
-
- // Ctor
-
- Action_FFTW_1D_Forward_Measure( int size ):_size(size)
- {
- MESSAGE("Action_FFTW_1D_Forward_Measure Ctor");
-
- // STL vector initialization
-
- init_vector<pseudo_random>(X_stl,_size);
- init_vector<null_function>(Y_stl,_size);
-
- // generic matrix and vector initialization
-
- Interface::vector_from_stl(X,X_stl);
- Interface::vector_from_stl(Y,Y_stl);
-
- Interface::fftw_init_plan(p,_size, X, Y, FFTW_FORWARD, FFTW_MEASURE);
-
- }
-
- // invalidate copy ctor
-
- Action_FFTW_1D_Forward_Measure( const Action_FFTW_1D_Forward_Measure & )
- {
- INFOS("illegal call to Action_FFTW_1D_Forward_Measure Copy Ctor");
- exit(1);
- }
-
- // Dtor
-
- ~Action_FFTW_1D_Forward_Measure( void ){
-
- MESSAGE("Action_FFTW_1D_Forward_Measure Dtor");
-
- // deallocation
-
- Interface::free_vector(X);
- Interface::free_vector(Y);
- }
-
- // action name
-
- static inline std::string name( void )
- {
- return "FFTW_1D_Forward_Measure_"+Interface::name();
- }
-
- double nb_op_base( void ){
- const static double log_2 = log(2.);
- return _size * log(_size)/log_2;
- }
-
- inline void initialize( void ){
- }
-
- inline void calculate( void ) {
- BTL_ASM_COMMENT("mybegin FFTW_1D_Forward_Measure");
- Interface::fftw_run(p);
- BTL_ASM_COMMENT("myend FFTW_1D_Forward_Measure");
- }
-
- void check_result( void ){
- }
-
-private :
-
- typename Interface::stl_vector X_stl;
- typename Interface::stl_vector Y_stl;
-
- typename Interface::gene_vector X;
- typename Interface::gene_vector Y;
-
- typename Interface::plan p;
-
- int _size;
-};
-
-#endif // ACTION_FFTW_1D_FORWARD_MEASURE
diff --git a/btl/actions/action_fftw_2d.hh b/btl/actions/action_fftw_2d.hh
new file mode 100644
index 0000000..c8aff39
--- /dev/null
+++ b/btl/actions/action_fftw_2d.hh
@@ -0,0 +1,111 @@
+#ifndef ACTION_FFTW_2D
+#define ACTION_FFTW_2D
+#include <string>
+#include <cmath>
+
+#include "base_action_fftw.hh"
+
+
+/* FORWARD - MEASURE */
+template<class Interface>
+class Action_FFTW_2D_Forward_Measure : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_2D_Forward_Measure(const int& size) :
+ Action_FFTW_base<Interface>(size, 2)
+ {
+ Interface::fftw_init_plan_2d(this->p, size, this->X, this->Y, FFTW_FORWARD, FFTW_MEASURE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_2D_Forward_Measure_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return (this->size_ * std::log(this->size_)/log_2) * 2*this->size_;
+ }
+};
+
+
+/* FORWARD - ESTIMATE */
+template<class Interface>
+class Action_FFTW_2D_Forward_Estimate : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_2D_Forward_Estimate(const int& size) :
+ Action_FFTW_base<Interface>(size, 2)
+ {
+ Interface::fftw_init_plan(this->p, size, this->X, this->Y, FFTW_FORWARD, FFTW_ESTIMATE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_2D_Forward_Estimate_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return (this->size_ * std::log(this->size_)/log_2) * 2*this->size_;
+ }
+};
+
+/* BACKWARD - MEASURE */
+template<class Interface>
+class Action_FFTW_2D_Backward_Measure : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_2D_Backward_Measure(const int& size) :
+ Action_FFTW_base<Interface>(size, 2)
+ {
+ Interface::fftw_init_plan(this->p, size, this->X, this->Y, FFTW_BACKWARD, FFTW_MEASURE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_2D_Backward_Measure_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return (this->size_ * std::log(this->size_)/log_2) * 2*this->size_;
+ }
+};
+
+
+/* BACKWARD - ESTIMATE */
+template<class Interface>
+class Action_FFTW_2D_Backward_Estimate : public Action_FFTW_base<Interface>
+{
+public:
+ // Constructor
+ Action_FFTW_2D_Backward_Estimate(const int& size) :
+ Action_FFTW_base<Interface>(size, 2)
+ {
+ Interface::fftw_init_plan(this->p, size, this->X, this->Y, FFTW_BACKWARD, FFTW_ESTIMATE);
+ }
+
+ // Action name
+ static inline std::string name( void )
+ {
+ return "FFTW_2D_Backward_Estimate_"+Interface::name();
+ }
+
+ // Algorithm complexity
+ double nb_op_base( void ){
+ const static double log_2 = std::log(2.);
+ return (this->size_ * std::log(this->size_)/log_2) * 2*this->size_;
+ }
+};
+
+#endif // ACTION_FFTW_2D
diff --git a/btl/actions/base_action_fftw.hh b/btl/actions/base_action_fftw.hh
new file mode 100644
index 0000000..410161c
--- /dev/null
+++ b/btl/actions/base_action_fftw.hh
@@ -0,0 +1,69 @@
+#ifndef BASE_ACTION_FFTW_HH
+#define BASE_ACTION_FFTW_HH
+
+#include "utilities.h"
+#include "init/init_function.hh"
+#include "init/init_vector.hh"
+
+inline int power(const int& base, const int& exp) {
+ int ret = 1;
+ for (int i = 0; i < exp; ++i)
+ ret *= base;
+ return ret;
+}
+
+template<class Interface>
+class Action_FFTW_base
+{
+public:
+ // Constructor
+ Action_FFTW_base(const int& size, const int& dimensions) :
+ size_(size), dimensions_(dimensions), N_(power(size, dimensions))
+ {
+ // STL vector initialization
+ init_vector < pseudo_random > (X_stl, N_);
+ init_vector < null_function > (Y_stl, N_);
+
+ // Generic vector initialization
+ Interface::vector_from_stl(X, X_stl);
+ Interface::vector_from_stl(Y, Y_stl);
+
+ // To be done by the child:
+ /* initialize plan! */
+ }
+
+ // Invalidate copy constructor
+ Action_FFTW_base( const Action_FFTW_base & )
+ {
+ INFOS("illegal call to Action_FFTW_base Copy Ctor");
+ exit(1);
+ }
+
+ // Destructor:
+ // frees the memory
+ ~Action_FFTW_base()
+ {
+ Interface::free_vector(X);
+ Interface::free_vector(Y);
+ }
+
+ inline void initialize() { }
+
+ inline void calculate( void ) {
+ Interface::fftw_run(p);
+ }
+
+ void check_result( void ){
+ }
+
+
+protected:
+ const int size_, dimensions_, N_;
+
+ typename Interface::stl_vector X_stl, Y_stl;
+ typename Interface::gene_vector X, Y;
+
+ typename Interface::plan p;
+};
+
+#endif /* BASE_ACTION_FFTW_HH */
diff --git a/btl/actions/fftw_actions.hh b/btl/actions/fftw_actions.hh
index 3aced22..e18f746 100644
--- a/btl/actions/fftw_actions.hh
+++ b/btl/actions/fftw_actions.hh
@@ -1,9 +1,8 @@
#ifndef ACTION_FFTW
#define ACTION_FFTW
-#include "action_fftw_1d_forward_measure.hh"
-#include "action_fftw_1d_forward_estimate.hh"
-#include "action_fftw_1d_backward_measure.hh"
-#include "action_fftw_1d_backward_estimate.hh"
+#include "base_action_fftw.hh"
+#include "action_fftw_1d.hh"
+#include "action_fftw_2d.hh"
#endif // ACTION_FFTW
diff --git a/btl/generic_bench/bench.hh b/btl/generic_bench/bench.hh
index 2a5ba36..7843cf7 100644
--- a/btl/generic_bench/bench.hh
+++ b/btl/generic_bench/bench.hh
@@ -29,8 +29,12 @@
#include <vector>
#include <string>
#include "timers/portable_perf_analyzer.hh"
+
+#ifdef DISTRIBUTED
#include "timers/distributed_perf_analyzer_root.hh"
#include "timers/distributed_perf_analyzer_node.hh"
+#endif
+
// #include "timers/mixed_perf_analyzer.hh"
// #include "timers/x86_perf_analyzer.hh"
// #include "timers/STL_perf_analyzer.hh"
@@ -80,6 +84,7 @@ BTL_DONT_INLINE void bench( int size_min, int size_max, int nb_point, bool silen
bench<Portable_Perf_Analyzer,Action>(size_min,size_max,nb_point,silent);
}
+#ifdef DISTRIBUTED
// distributed Perf Analyzer
template <class Action>
@@ -92,5 +97,6 @@ BTL_DONT_INLINE void distr_bench( int size_min, int size_max, int nb_point, bool
else
bench<Distributed_Perf_Analyzer_Root, Action>(size_min, size_max, nb_point, silent);
}
+#endif
#endif
diff --git a/btl/generic_bench/timers/distributed_perf_analyzer_root.hh b/btl/generic_bench/timers/distributed_perf_analyzer_root.hh
index 98a08ef..807f20a 100644
--- a/btl/generic_bench/timers/distributed_perf_analyzer_root.hh
+++ b/btl/generic_bench/timers/distributed_perf_analyzer_root.hh
@@ -45,14 +45,14 @@ public:
for (int i = 1; i < tries; ++i) {
Action _action(size);
if (!silent)
- std::cout << " " << _action.nb_op_base()*_nb_calc/(m_time_action*1e6) << " ";
+ std::cout << " " << _action.nb_op_base()*_nb_calc/(m_time_action*1e6) << " " << std::flush;
_action.initialize();
m_time_action = std::min(m_time_action, time_calculate(_action));
}
double time_action = m_time_action / (double(_nb_calc));
/* Check */
- int do_check = (BtlConfig::Instance.checkResults && size<128) ? 1 : 1;
+ int do_check = (BtlConfig::Instance.checkResults && size<128) ? 1 : 0;
igebs2d_(&context, "A", " ", &iONE, &iONE, &do_check, &iONE);
if (do_check > 0) {
action.initialize();
diff --git a/btl/libs/FFTW/fftw_interface.hh b/btl/libs/FFTW/fftw_interface.hh
index db62519..f3077f3 100644
--- a/btl/libs/FFTW/fftw_interface.hh
+++ b/btl/libs/FFTW/fftw_interface.hh
@@ -54,6 +54,10 @@ public:
p = fftw_plan_dft_1d(N, x, y, sign, flags);
}
+ static inline void fftw_init_plan_2d(plan & p, const int & N, gene_vector & x, gene_vector& y, const int & sign, const int & flags){
+ p = fftw_plan_dft_2d(N, N, x, y, sign, flags);
+ }
+
static inline void fftw_run(plan & p){
fftw_execute(p);
}
diff --git a/btl/libs/FFTW/main.cpp b/btl/libs/FFTW/main.cpp
index 3f2f0c4..034a279 100644
--- a/btl/libs/FFTW/main.cpp
+++ b/btl/libs/FFTW/main.cpp
@@ -7,37 +7,54 @@
BTL_MAIN;
-int main(int argv, char **argc)
+int main(int argc, char **argv)
{
bool
fftw_1d_forward_measure = false,
fftw_1d_forward_estimate = false,
fftw_1d_backward_measure = false,
- fftw_1d_backward_estimate = false
+ fftw_1d_backward_estimate = false,
+
+ fftw_2d_forward_measure = false,
+ fftw_2d_forward_estimate = false,
+ fftw_2d_backward_measure = false,
+ fftw_2d_backward_estimate = false
;
- for (int i = 1; i < argv; ++i) {
- std::string arg = argc[i];
+ for (int i = 1; i < argc; ++i) {
+ std::string arg = argv[i];
+
if (arg == "FFTW_1D_Forward_Measure" || arg == "all") fftw_1d_forward_measure = true;
if (arg == "FFTW_1D_Forward_Estimate" || arg == "all") fftw_1d_forward_estimate = true;
if (arg == "FFTW_1D_Backward_Measure" || arg == "all") fftw_1d_backward_measure = true;
if (arg == "FFTW_1D_Backward_Estimate" || arg == "all") fftw_1d_backward_estimate = true;
+
+ if (arg == "FFTW_2D_Forward_Measure" || arg == "all") fftw_2d_forward_measure = true;
+ if (arg == "FFTW_2D_Forward_Estimate" || arg == "all") fftw_2d_forward_estimate = true;
+ if (arg == "FFTW_2D_Backward_Measure" || arg == "all") fftw_2d_backward_measure = true;
+ if (arg == "FFTW_2D_Backward_Estimate" || arg == "all") fftw_2d_backward_estimate = true;
}
if (fftw_1d_forward_measure)
bench<Action_FFTW_1D_Forward_Measure<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
-
if (fftw_1d_forward_estimate)
bench<Action_FFTW_1D_Forward_Estimate<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
-
if (fftw_1d_backward_measure)
bench<Action_FFTW_1D_Backward_Measure<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
-
if (fftw_1d_backward_estimate)
bench<Action_FFTW_1D_Backward_Estimate<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
+ if (fftw_2d_forward_measure)
+ bench<Action_FFTW_2D_Forward_Measure<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
+// if (fftw_1d_forward_estimate)
+// bench<Action_FFTW_1D_Forward_Estimate<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
+// if (fftw_1d_backward_measure)
+// bench<Action_FFTW_1D_Backward_Measure<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
+// if (fftw_1d_backward_estimate)
+// bench<Action_FFTW_1D_Backward_Estimate<fftw_interface> >(MIN_MV,MAX_MV,NB_POINT);
+
return 0;
}
diff --git a/fftw.py b/fftw.py
index d589509..dd2b6e8 100644
--- a/fftw.py
+++ b/fftw.py
@@ -5,7 +5,10 @@ class Module(btlbase.BTLBase):
self.libname = "fftw"
self.avail = (
"FFTW_1D_Forward_Measure", "FFTW_1D_Forward_Estimate",
- "FFTW_1D_Backward_Measure", "FFTW_1D_Backward_Estimate"
+ "FFTW_1D_Backward_Measure", "FFTW_1D_Backward_Estimate",
+
+ "FFTW_2D_Forward_Measure", "FFTW_2D_Forward_Estimate",
+ "FFTW_2D_Backward_Measure", "FFTW_2D_Backward_Estimate"
)
def _parse_args(self, args):