make sure it runs on machine with GPU or CUDA

This commit is contained in:
Hieu Hoang 2017-02-07 16:29:11 +00:00
parent 84f3cb5cc8
commit fd74cc932a
2 changed files with 0 additions and 14 deletions

View File

@ -27,19 +27,6 @@ MosesPlugin::~MosesPlugin()
{
}
size_t MosesPlugin::GetDevices(size_t maxDevices) {
int num_gpus = 0; // number of CUDA GPUs
HANDLE_ERROR( cudaGetDeviceCount(&num_gpus));
std::cerr << "Number of CUDA devices: " << num_gpus << std::endl;
for (int i = 0; i < num_gpus; i++) {
cudaDeviceProp dprop;
HANDLE_ERROR( cudaGetDeviceProperties(&dprop, i));
std::cerr << i << ": " << dprop.name << std::endl;
}
return (size_t)std::min(num_gpus, (int)maxDevices);
}
AmunOutput MosesPlugin::SetSource(const std::vector<size_t>& words) {
AmunOutput ret;

View File

@ -25,7 +25,6 @@ class MosesPlugin {
MosesPlugin();
~MosesPlugin();
static size_t GetDevices(size_t = 1);
void SetDevice();
size_t GetDevice();
const amunmt::God &GetGod() const