Le test continue
This commit is contained in:
parent
6c7abb0744
commit
ebdc90f26f
24
include/triskeleDebug.tpp
Normal file
24
include/triskeleDebug.tpp
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef _OTB_TRISKELE_DEBUG_TPP
|
||||
#define _OTB_TRISKELE_DEBUG_TPP
|
||||
|
||||
string
|
||||
ns2string (double delta) {
|
||||
using namespace boost::chrono;
|
||||
|
||||
ostringstream oss;
|
||||
duration<double> ns (delta);
|
||||
oss.fill ('0');
|
||||
// typedef duration<int, ratio<86400> > days;
|
||||
// auto d = duration_cast<days>(ns);
|
||||
// ns -= d;
|
||||
auto h = duration_cast<hours> (ns);
|
||||
ns -= h;
|
||||
auto m = duration_cast<minutes> (ns);
|
||||
ns -= m;
|
||||
oss << setw (2) << h.count () << ":"
|
||||
<< setw (2) << m.count () << ":"
|
||||
<< setw (9) << fixed << setprecision (6) << ns.count ();
|
||||
return oss.str ();
|
||||
}
|
||||
|
||||
#endif // _OTB_TRISKELE_DEBUG_TPP
|
80
test/TestThread.hpp
Normal file
80
test/TestThread.hpp
Normal file
@ -0,0 +1,80 @@
|
||||
// OK faire une classe
|
||||
// OK changer coreCount en maxCoreCount
|
||||
// faire test 10000 + lamba + 1...coreCount
|
||||
// découpe fichier TestThread.cpp
|
||||
// calcul alignement
|
||||
// lecture seq => faire somme
|
||||
// lecture // => faire somme
|
||||
|
||||
// écriture seq => écrire idx
|
||||
// écriture // => écrire idx
|
||||
|
||||
// lecture/écriture seq => écrire x/2
|
||||
// lecture/écriture // => écrire x/2
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/accumulators/accumulators.hpp>
|
||||
#include <boost/accumulators/statistics/stats.hpp>
|
||||
#include <boost/accumulators/statistics/sum.hpp>
|
||||
#include <boost/accumulators/statistics/count.hpp>
|
||||
#include <boost/accumulators/statistics/min.hpp>
|
||||
#include <boost/accumulators/statistics/max.hpp>
|
||||
#include <boost/accumulators/statistics/mean.hpp>
|
||||
|
||||
namespace otb {
|
||||
namespace triskele {
|
||||
using namespace std;
|
||||
namespace ba = boost::accumulators;
|
||||
typedef ba::accumulator_set<double,
|
||||
ba::stats<ba::tag::sum,
|
||||
ba::tag::count,
|
||||
ba::tag::mean,
|
||||
ba::tag::min,
|
||||
ba::tag::max> > AlgoStat;
|
||||
enum TimeType {
|
||||
directDealStats,
|
||||
lambdaDealStats,
|
||||
threadDealStats,
|
||||
inThreadDealStats,
|
||||
|
||||
initStats,
|
||||
seqReadStats,
|
||||
parReadStats,
|
||||
seqWriteStats,
|
||||
parWriteStats,
|
||||
seqRWStats,
|
||||
parRWStats,
|
||||
|
||||
TimeTypeCard
|
||||
};
|
||||
typedef uint32_t DimImg;
|
||||
|
||||
class TestThread {
|
||||
public:
|
||||
|
||||
static const unsigned int maxCoreCount;
|
||||
unsigned int coreCount;
|
||||
AlgoStat timeStats[TimeTypeCard];
|
||||
size_t nbItem = 1000000;
|
||||
// XXX vérifier l'alignement vector
|
||||
vector<DimImg> global;
|
||||
|
||||
TestThread (const unsigned int &coreCount = maxCoreCount);
|
||||
// XXX en commun
|
||||
static inline string ns2string (double delta);
|
||||
inline void addTime (const TimeType &timeType, const double &duration) {
|
||||
timeStats[timeType] (duration);
|
||||
}
|
||||
ostream &print (ostream &out, const AlgoStat stats[]);
|
||||
// XXX déclarer nodealThread
|
||||
|
||||
template <typename T>
|
||||
void fillVector (vector<T> &vect);
|
||||
void multiTest ();
|
||||
|
||||
void testDeal ();
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user