|
|
|
@ -3593,10 +3593,10 @@ void parse_arg(int key, char *arg)
@@ -3593,10 +3593,10 @@ void parse_arg(int key, char *arg)
|
|
|
|
|
{ |
|
|
|
|
int device_thr[MAX_GPUS] = { 0 }; |
|
|
|
|
int ngpus = cuda_num_devices(); |
|
|
|
|
char * pch = strtok (arg,","); |
|
|
|
|
char* pch = strtok(arg,","); |
|
|
|
|
opt_n_threads = 0; |
|
|
|
|
while (pch != NULL && opt_n_threads < MAX_GPUS) { |
|
|
|
|
if (pch[0] >= '0' && pch[0] <= '9' && pch[1] == '\0') |
|
|
|
|
if (pch[0] >= '0' && pch[0] <= '9' && strlen(pch) <= 2) |
|
|
|
|
{ |
|
|
|
|
if (atoi(pch) < ngpus) |
|
|
|
|
device_map[opt_n_threads++] = atoi(pch); |
|
|
|
|