//===================================================== // File : bench.hh // Author : L. Plagne <laurent.plagne@edf.fr)> // Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 //===================================================== // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #ifndef BENCH_HH #define BENCH_HH
template <template<class> class Perf_Analyzer, class Action>
BTL_DONT_INLINE void bench( int size_min, int size_max, int nb_point )
{ if (BtlConfig::skipAction(Action::name())) return;
if (!BtlConfig::Instance.overwriteResults)
{ if (hasOldResults)
{ // merge the two data
std::vector<int> newSizes;
std::vector<double> newFlops; unsignedint i=0; unsignedint j=0; while (i<tab_sizes.size() && j<oldSizes.size())
{ if (tab_sizes[i] == oldSizes[j])
{
newSizes.push_back(tab_sizes[i]);
newFlops.push_back(std::max(tab_mflops[i], oldFlops[j]));
++i;
++j;
} elseif (tab_sizes[i] < oldSizes[j])
{
newSizes.push_back(tab_sizes[i]);
newFlops.push_back(tab_mflops[i]);
++i;
} else
{
newSizes.push_back(oldSizes[j]);
newFlops.push_back(oldFlops[j]);
++j;
}
} while (i<tab_sizes.size())
{
newSizes.push_back(tab_sizes[i]);
newFlops.push_back(tab_mflops[i]);
++i;
} while (j<oldSizes.size())
{
newSizes.push_back(oldSizes[j]);
newFlops.push_back(oldFlops[j]);
++j;
}
tab_mflops = newFlops;
tab_sizes = newSizes;
}
}
// dump the result in a file :
dump_xy_file(tab_sizes,tab_mflops,filename);
}
// default Perf Analyzer
template <class Action>
BTL_DONT_INLINE void bench( int size_min, int size_max, int nb_point ){
// if the rdtsc is not available :
bench<Portable_Perf_Analyzer,Action>(size_min,size_max,nb_point); // if the rdtsc is available : // bench<Mixed_Perf_Analyzer,Action>(size_min,size_max,nb_point);
// Only for small problem size. Otherwise it will be too long // bench<X86_Perf_Analyzer,Action>(size_min,size_max,nb_point); // bench<STL_Perf_Analyzer,Action>(size_min,size_max,nb_point);
}
#endif
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.