mirror of
https://github.com/marian-nmt/marian.git
synced 2024-12-03 03:54:56 +03:00
make sure it runs on machine with GPU or CUDA
This commit is contained in:
parent
84f3cb5cc8
commit
fd74cc932a
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user