void LexicalReorderingTableCreator::CompressScores()
{
#ifdef WITH_THREADS
  boost::thread_group threads;
  for (size_t i = 0; i < m_threads; ++i) {
    CompressionTaskReordering* ct = new CompressionTaskReordering(m_encodedScores, *this);    
    threads.create_thread(*ct);
  }
  threads.join_all();
#else
  CompressionTaskReordering* ct = new CompressionTaskReordering(m_encodedScores, *this);
  (*ct)();
  delete ct;
#endif
  FlushCompressedQueue(true);
}
Пример #2
0
void PhraseTableCreator::CompressTargetPhrases()
{
#ifdef WITH_THREADS
  boost::thread_group threads;
  for (size_t i = 0; i < m_threads; ++i) {
    CompressionTask* ct = new CompressionTask(*m_encodedTargetPhrases, *this);
    threads.create_thread(*ct);
  }
  threads.join_all();
#else
  CompressionTask* ct = new CompressionTask(*m_encodedTargetPhrases, *this);
  (*ct)();
  delete ct;
#endif
  FlushCompressedQueue(true);
}