mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 20:46:59 +03:00
timer
This commit is contained in:
parent
e58e2fd777
commit
500e967730
@ -47,6 +47,7 @@ import path ;
|
|||||||
legacy/Range.cpp
|
legacy/Range.cpp
|
||||||
legacy/SquareMatrix.cpp
|
legacy/SquareMatrix.cpp
|
||||||
legacy/ThreadPool.cpp
|
legacy/ThreadPool.cpp
|
||||||
|
legacy/Timer.cpp
|
||||||
legacy/Util2.cpp
|
legacy/Util2.cpp
|
||||||
legacy/ProbingPT/hash.cpp
|
legacy/ProbingPT/hash.cpp
|
||||||
legacy/ProbingPT/huffmanish.cpp
|
legacy/ProbingPT/huffmanish.cpp
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "legacy/InputFileStream.h"
|
#include "legacy/InputFileStream.h"
|
||||||
#include "legacy/Parameter.h"
|
#include "legacy/Parameter.h"
|
||||||
#include "legacy/ThreadPool.h"
|
#include "legacy/ThreadPool.h"
|
||||||
|
#include "legacy/Timer.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -34,6 +35,8 @@ int main(int argc, char** argv)
|
|||||||
istream &inStream = GetInputStream(params);
|
istream &inStream = GetInputStream(params);
|
||||||
|
|
||||||
cerr << "system.numThreads=" << system.numThreads << endl;
|
cerr << "system.numThreads=" << system.numThreads << endl;
|
||||||
|
Timer timer;
|
||||||
|
timer.start();
|
||||||
|
|
||||||
ThreadPool pool(system.numThreads);
|
ThreadPool pool(system.numThreads);
|
||||||
|
|
||||||
@ -51,6 +54,8 @@ int main(int argc, char** argv)
|
|||||||
delete &inStream;
|
delete &inStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cerr << "Decoding took " << timer.get_elapsed_time() << endl;
|
||||||
// cerr << "g_numHypos=" << g_numHypos << endl;
|
// cerr << "g_numHypos=" << g_numHypos << endl;
|
||||||
cerr << "Finished" << endl;
|
cerr << "Finished" << endl;
|
||||||
}
|
}
|
||||||
|
@ -100,9 +100,13 @@ void PhraseTableMemory::Load(System &system)
|
|||||||
|
|
||||||
MemPool tmpPool;
|
MemPool tmpPool;
|
||||||
vector<string> toks;
|
vector<string> toks;
|
||||||
|
size_t lineNum = 0;
|
||||||
InputFileStream strme(m_path);
|
InputFileStream strme(m_path);
|
||||||
string line;
|
string line;
|
||||||
while (getline(strme, line)) {
|
while (getline(strme, line)) {
|
||||||
|
if (++lineNum % 10000) {
|
||||||
|
cerr << lineNum << " ";
|
||||||
|
}
|
||||||
toks.clear();
|
toks.clear();
|
||||||
TokenizeMultiCharSeparator(toks, line, "|||");
|
TokenizeMultiCharSeparator(toks, line, "|||");
|
||||||
assert(toks.size() >= 3);
|
assert(toks.size() >= 3);
|
||||||
|
Loading…
Reference in New Issue
Block a user