1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

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

This commit is contained in:
Con Kolivas 2012-04-23 17:56:31 +10:00
parent f5f089f5b4
commit 9175e4f25c

12
ocl.c
View File

@ -123,6 +123,18 @@ int clDevicesNum(void) {
applog(LOG_INFO, "Platform %d devices: %d", i, numDevices);
if (numDevices > most_devices)
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;