Skip to content

Commit

Permalink
Fixed build w/o ADL
Browse files Browse the repository at this point in the history
  • Loading branch information
reorder committed Feb 26, 2014
1 parent 6e8c72b commit 38e6518
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions driver-opencl.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,35 @@ char *set_kernel(char *arg)
}
#endif

char *set_gpu_threads(char *arg)
{
int i, val = 1, device = 0;
char *nextptr;

nextptr = strtok(arg, ",");
if (nextptr == NULL)
return "Invalid parameters for set_gpu_threads";
val = atoi(nextptr);
if (val < 1 || val > 10)
return "Invalid value passed to set_gpu_threads";

gpus[device++].threads = val;

while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
if (val < 1 || val > 10)
return "Invalid value passed to set_gpu_threads";

gpus[device++].threads = val;
}
if (device == 1) {
for (i = device; i < MAX_GPUDEVICES; i++)
gpus[i].threads = gpus[0].threads;
}

return NULL;
}

#ifdef HAVE_ADL
/* This function allows us to map an adl device to an opencl device for when
* simple enumeration has failed to match them. */
Expand Down Expand Up @@ -310,35 +339,6 @@ char *set_gpu_map(char *arg)
return NULL;
}

char *set_gpu_threads(char *arg)
{
int i, val = 1, device = 0;
char *nextptr;

nextptr = strtok(arg, ",");
if (nextptr == NULL)
return "Invalid parameters for set_gpu_threads";
val = atoi(nextptr);
if (val < 1 || val > 10)
return "Invalid value passed to set_gpu_threads";

gpus[device++].threads = val;

while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
if (val < 1 || val > 10)
return "Invalid value passed to set_gpu_threads";

gpus[device++].threads = val;
}
if (device == 1) {
for (i = device; i < MAX_GPUDEVICES; i++)
gpus[i].threads = gpus[0].threads;
}

return NULL;
}

char *set_gpu_engine(char *arg)
{
int i, min_val = 0, gpu_val = 0, exit_val = 0, device = 0;
Expand Down

0 comments on commit 38e6518

Please sign in to comment.