variable rename

This commit is contained in:
Hieu Hoang 2017-01-25 16:21:15 +00:00
parent 7d23502faf
commit 3aed45cd47
4 changed files with 6 additions and 6 deletions

View File

@ -258,9 +258,9 @@ DeviceInfo God::GetNextDevice() const
ret.threadInd = threadIncrGPU / devices.size();
ret.deviceInd = threadIncrGPU % devices.size();
assert(ret.deviceInd < devices.size());
ret.deviceInd = devices[ret.deviceInd];
size_t deviceInd = threadIncrGPU % devices.size();
assert(deviceInd < devices.size());
ret.deviceId = devices[deviceInd];
UTIL_THROW_IF2(ret.threadInd >= gpuThreads, "Too many GPU threads");
}

View File

@ -2,6 +2,6 @@
std::ostream& operator<<(std::ostream& out, const DeviceInfo& obj)
{
out << obj.deviceType << " t=" << obj.threadInd << " d=" << obj.deviceInd;
out << obj.deviceType << " t=" << obj.threadInd << " d=" << obj.deviceId;
return out;
}

View File

@ -23,5 +23,5 @@ struct DeviceInfo
DeviceType deviceType;
size_t threadInd;
size_t deviceInd;
size_t deviceId;
};

View File

@ -148,7 +148,7 @@ void EncoderDecoderLoader::Load(const God &god) {
ScorerPtr EncoderDecoderLoader::NewScorer(const God &god, const DeviceInfo &deviceInfo) const {
//size_t i = deviceInfo.threadInd;
size_t d = deviceInfo.deviceInd; // TODO what is not using gpu0?
size_t d = deviceInfo.deviceId; // TODO what is not using gpu0?
//cerr << "NewScorer=" << i << " " << d << endl;
cudaSetDevice(d);