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*,
std::vector<QueueItem*>,
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 InputPath &path;

View File

@ -28,7 +28,7 @@ Search::Search(Manager &mgr)
:Moses2::Search(mgr)
,m_stacks(mgr)
,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:
NSCubePruning::Stacks m_stacks;
NSCubePruning::CubeEdge::Queue &m_queue;
NSCubePruning::CubeEdge::SeenPositions &m_seenPositions;
NSCubePruning::CubeEdge::SeenPositions m_seenPositions;
// CUBE PRUNING VARIABLES
// setup

View File

@ -170,10 +170,5 @@ NSCubePruning::CubeEdge::Queue &System::GetQueue() const
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;
Bitmaps &GetBitmaps() const;
NSCubePruning::CubeEdge::Queue &GetQueue() const;
NSCubePruning::CubeEdge::SeenPositions &GetSeenPositions() const;
protected:
mutable FactorCollection m_vocab;
@ -75,7 +74,6 @@ protected:
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::SeenPositions> m_seenPositions;
mutable boost::thread_specific_ptr<Bitmaps> m_bitmaps;