Revert "GetScorers() use DeviceType"

This reverts commit 28730359ef.
This commit is contained in:
Hieu Hoang 2017-01-22 23:04:46 +00:00
parent 266f56f312
commit 20363f1a00
5 changed files with 5 additions and 35 deletions

View File

@ -50,11 +50,6 @@
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu</locationURI>
</link>
<link>
<name>plugin</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>python</name>
<type>2</type>
@ -75,31 +70,6 @@
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/cnpy/cnpy.h</locationURI>
</link>
<link>
<name>plugin/nbest.cu</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nbest.cu</locationURI>
</link>
<link>
<name>plugin/nbest.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nbest.h</locationURI>
</link>
<link>
<name>plugin/neural_phrase.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/neural_phrase.h</locationURI>
</link>
<link>
<name>plugin/nmt.cu</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nmt.cu</locationURI>
</link>
<link>
<name>plugin/nmt.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/plugin/nmt.h</locationURI>
</link>
<link>
<name>python/amunmt.cpp</name>
<type>1</type>

View File

@ -177,12 +177,12 @@ OutputCollector& God::GetOutputCollector() {
return outputCollector_;
}
std::vector<ScorerPtr> God::GetScorers(DeviceType deviceType, size_t threadId) {
std::vector<ScorerPtr> God::GetScorers(size_t threadId) {
std::vector<ScorerPtr> scorers;
size_t cpuThreads = God::Get<size_t>("cpu-threads");
if (deviceType == CPUDevice) {
if (threadId < cpuThreads) {
for (auto&& loader : cpuLoaders_ | boost::adaptors::map_values)
scorers.emplace_back(loader->NewScorer(*this, threadId));
} else {

View File

@ -57,7 +57,7 @@ class God {
BestHypsBase &GetBestHyps(size_t threadId);
std::vector<ScorerPtr> GetScorers(DeviceType deviceType, size_t);
std::vector<ScorerPtr> GetScorers(size_t);
std::vector<std::string> GetScorerNames();
std::map<std::string, float>& GetScorerWeights();

View File

@ -10,7 +10,7 @@
using namespace std;
Search::Search(God &god, DeviceType deviceType, size_t threadId)
: scorers_(god.GetScorers(deviceType, threadId)),
: scorers_(god.GetScorers(threadId)),
bestHyps_(god.GetBestHyps(threadId)) {
}

View File

@ -19,7 +19,7 @@ void MosesPlugin::initGod(const std::string& configPath) {
god_ = new God();
god_->Init(configs);
scorers_ = god_->GetScorers(CPUDevice, 1);
scorers_ = god_->GetScorers(1);
bestHyps_ = &god_->GetBestHyps(1);
}