Checking that number of requested GPUs is not more than number of available GPUs

Этот коммит содержится в:
Gilbert Lee committed 2019-07-11 15:36:21 +00:00
1 родитель 924521ff57
Коммит 043eef6999
1 file changed
+9
+9
Просмотреть файл
@@ -738,6 +738,15 @@ int main(int argc, char* argv[]) {
return 0;
}
}
int numDevices;
HIPCHECK(hipGetDeviceCount(&numDevices));
if (nGpus > numDevices)
{
fprintf(stderr, "[ERROR] The number of requested GPUs (%d) is greater than the number of GPUs available (%d)\n", nGpus, numDevices);
return testNcclError;
}
#ifdef MPI_SUPPORT
MPI_Init(&argc, &argv);
#endif