Merge branch 'perf_moses2' of github.com:hieuhoang/mosesdecoder into perf_moses2

This commit is contained in:
Hieu Hoang 2015-12-29 11:30:58 -05:00
commit 8af0300334
5 changed files with 7 additions and 10 deletions

View File

@ -60,7 +60,11 @@ public:
typedef std::priority_queue<QueueItem*, typedef std::priority_queue<QueueItem*,
std::vector<QueueItem*>, std::vector<QueueItem*>,
QueueItemOrderer> Queue; QueueItemOrderer> Queue;
typedef boost::unordered_set< std::pair<const CubeEdge*, int> > SeenPositions; typedef boost::unordered_set< std::pair<const CubeEdge*, int>,
boost::hash< std::pair<const CubeEdge*, int> >,
std::equal_to< std::pair<const CubeEdge*, int> >,
MemPoolAllocator< std::pair<const CubeEdge*, int> >
> SeenPositions;
const Hypotheses &hypos; const Hypotheses &hypos;
const InputPath &path; const InputPath &path;

View File

@ -28,7 +28,7 @@ Search::Search(Manager &mgr)
:Moses2::Search(mgr) :Moses2::Search(mgr)
,m_stacks(mgr) ,m_stacks(mgr)
,m_queue(mgr.system.GetQueue()) ,m_queue(mgr.system.GetQueue())
,m_seenPositions(mgr.system.GetSeenPositions()) ,m_seenPositions(MemPoolAllocator<std::pair<const CubeEdge*, int>>(mgr.GetPool()))
{ {
} }

View File

@ -35,7 +35,7 @@ public:
protected: protected:
NSCubePruning::Stacks m_stacks; NSCubePruning::Stacks m_stacks;
NSCubePruning::CubeEdge::Queue &m_queue; NSCubePruning::CubeEdge::Queue &m_queue;
NSCubePruning::CubeEdge::SeenPositions &m_seenPositions; NSCubePruning::CubeEdge::SeenPositions m_seenPositions;
// CUBE PRUNING VARIABLES // CUBE PRUNING VARIABLES
// setup // setup

View File

@ -170,10 +170,5 @@ NSCubePruning::CubeEdge::Queue &System::GetQueue() const
return GetThreadSpecificObj(m_queue); return GetThreadSpecificObj(m_queue);
} }
NSCubePruning::CubeEdge::SeenPositions &System::GetSeenPositions() const
{
return GetThreadSpecificObj(m_seenPositions);
}
} }

View File

@ -66,7 +66,6 @@ public:
ObjectPoolContiguous<Hypothesis*> &GetBatchForEval() const; ObjectPoolContiguous<Hypothesis*> &GetBatchForEval() const;
Bitmaps &GetBitmaps() const; Bitmaps &GetBitmaps() const;
NSCubePruning::CubeEdge::Queue &GetQueue() const; NSCubePruning::CubeEdge::Queue &GetQueue() const;
NSCubePruning::CubeEdge::SeenPositions &GetSeenPositions() const;
protected: protected:
mutable FactorCollection m_vocab; mutable FactorCollection m_vocab;
@ -75,7 +74,6 @@ protected:
mutable boost::thread_specific_ptr< ObjectPoolContiguous<Hypothesis*> > m_batchForEval; mutable boost::thread_specific_ptr< ObjectPoolContiguous<Hypothesis*> > m_batchForEval;
mutable boost::thread_specific_ptr< NSCubePruning::CubeEdge::Queue> m_queue; mutable boost::thread_specific_ptr< NSCubePruning::CubeEdge::Queue> m_queue;
mutable boost::thread_specific_ptr< NSCubePruning::CubeEdge::SeenPositions> m_seenPositions;
mutable boost::thread_specific_ptr<Bitmaps> m_bitmaps; mutable boost::thread_specific_ptr<Bitmaps> m_bitmaps;