Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _STATIC_SIZE_GENERATOR_HH
00021 #define _STATIC_SIZE_GENERATOR_HH
00022 #include <vector>
00023
00024 using namespace std;
00025
00026
00027
00028 template <int SIZE,template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface>
00029 struct static_size_generator{
00030 static void go(vector<double> & tab_sizes, vector<double> & tab_mflops)
00031 {
00032 tab_sizes.push_back(SIZE);
00033 std::cout << tab_sizes.back() << " \t" << std::flush;
00034 Perf_Analyzer<Action<Interface<REAL_TYPE,SIZE> > > perf_action;
00035 tab_mflops.push_back(perf_action.eval_mflops(SIZE));
00036 std::cout << tab_mflops.back() << " MFlops" << std::endl;
00037 static_size_generator<SIZE-1,Perf_Analyzer,Action,Interface>::go(tab_sizes,tab_mflops);
00038 };
00039 };
00040
00041
00042
00043 template <template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface>
00044 struct static_size_generator<1,Perf_Analyzer,Action,Interface>{
00045 static void go(vector<double> & tab_sizes, vector<double> & tab_mflops)
00046 {
00047 tab_sizes.push_back(1);
00048 Perf_Analyzer<Action<Interface<REAL_TYPE,1> > > perf_action;
00049 tab_mflops.push_back(perf_action.eval_mflops(1));
00050 };
00051 };
00052
00053 #endif
00054
00055
00056
00057