mirror of
https://github.com/marian-nmt/marian.git
synced 2024-12-11 09:54:22 +03:00
variable rename
This commit is contained in:
parent
7d23502faf
commit
3aed45cd47
@ -258,9 +258,9 @@ DeviceInfo God::GetNextDevice() const
|
|||||||
|
|
||||||
ret.threadInd = threadIncrGPU / devices.size();
|
ret.threadInd = threadIncrGPU / devices.size();
|
||||||
|
|
||||||
ret.deviceInd = threadIncrGPU % devices.size();
|
size_t deviceInd = threadIncrGPU % devices.size();
|
||||||
assert(ret.deviceInd < devices.size());
|
assert(deviceInd < devices.size());
|
||||||
ret.deviceInd = devices[ret.deviceInd];
|
ret.deviceId = devices[deviceInd];
|
||||||
|
|
||||||
UTIL_THROW_IF2(ret.threadInd >= gpuThreads, "Too many GPU threads");
|
UTIL_THROW_IF2(ret.threadInd >= gpuThreads, "Too many GPU threads");
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
std::ostream& operator<<(std::ostream& out, const DeviceInfo& obj)
|
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;
|
return out;
|
||||||
}
|
}
|
||||||
|
@ -23,5 +23,5 @@ struct DeviceInfo
|
|||||||
|
|
||||||
DeviceType deviceType;
|
DeviceType deviceType;
|
||||||
size_t threadInd;
|
size_t threadInd;
|
||||||
size_t deviceInd;
|
size_t deviceId;
|
||||||
};
|
};
|
||||||
|
@ -148,7 +148,7 @@ void EncoderDecoderLoader::Load(const God &god) {
|
|||||||
|
|
||||||
ScorerPtr EncoderDecoderLoader::NewScorer(const God &god, const DeviceInfo &deviceInfo) const {
|
ScorerPtr EncoderDecoderLoader::NewScorer(const God &god, const DeviceInfo &deviceInfo) const {
|
||||||
//size_t i = deviceInfo.threadInd;
|
//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;
|
//cerr << "NewScorer=" << i << " " << d << endl;
|
||||||
|
|
||||||
cudaSetDevice(d);
|
cudaSetDevice(d);
|
||||||
|
Loading…
Reference in New Issue
Block a user