Browse Source

Display all OpenCL devices when -n is called as well to allow debugging of differential mapping of OpenCL to ADL.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
9175e4f25c
  1. 12
      ocl.c

12
ocl.c

@ -123,6 +123,18 @@ int clDevicesNum(void) {
applog(LOG_INFO, "Platform %d devices: %d", i, numDevices); applog(LOG_INFO, "Platform %d devices: %d", i, numDevices);
if (numDevices > most_devices) if (numDevices > most_devices)
most_devices = numDevices; most_devices = numDevices;
if (numDevices) {
unsigned int j;
char pbuff[256];
cl_device_id *devices = (cl_device_id *)malloc(numDevices*sizeof(cl_device_id));
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numDevices, devices, NULL);
for (j = 0; j < numDevices; j++) {
clGetDeviceInfo(devices[j], CL_DEVICE_NAME, sizeof(pbuff), pbuff, NULL);
applog(LOG_INFO, "\t%i\t%s", j, pbuff);
}
free(devices);
}
} }
return most_devices; return most_devices;

Loading…
Cancel
Save