OpenCL: Add a second API for boinc_get_opencl_ids() which is compatible with older clients (before BOINC 7.0.12)

This commit is contained in:
Charlie Fenton 2012-12-04 05:38:22 -08:00 committed by Oliver Bock
parent e8abd328d1
commit ed35d78490
1 changed files with 2 additions and 2 deletions

View File

@ -183,9 +183,9 @@ int boinc_get_opencl_ids(int argc, char** argv, char* type, cl_device_id* device
gpu_device_num = aid.gpu_device_num;
if (gpu_device_num < 0) {
// Even older versions of init_data.xml don't have gpu_device_num field
for (i=1; i<argc; i++) {
for (i=0; i<argc-1; i++) {
if ((!strcmp(argv[i], "--device")) || (!strcmp(argv[i], "-device"))) {
gpu_device_num = atoi(argv[++i]);
gpu_device_num = atoi(argv[i+1]);
break;
}
}