106 |
exit (1); |
exit (1); |
107 |
} |
} |
108 |
CHECK(clGetDeviceInfo ( |
CHECK(clGetDeviceInfo ( |
109 |
|
devices[i], CL_DEVICE_VENDOR_ID, sizeof(cl_uint), &(dev->vendorId), 0)); |
110 |
|
CHECK(clGetDeviceInfo ( |
111 |
devices[i], CL_DEVICE_TYPE, sizeof(cl_device_type), &(dev->ty), 0)); |
devices[i], CL_DEVICE_TYPE, sizeof(cl_device_type), &(dev->ty), 0)); |
112 |
CHECK(clGetDeviceInfo ( |
CHECK(clGetDeviceInfo ( |
113 |
devices[i], CL_DEVICE_AVAILABLE, sizeof(cl_bool), &(dev->isAvail), 0)); |
devices[i], CL_DEVICE_AVAILABLE, sizeof(cl_bool), &(dev->isAvail), 0)); |
168 |
CHECK(clGetDeviceInfo ( |
CHECK(clGetDeviceInfo ( |
169 |
devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->doubleWid), 0)); |
devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->doubleWid), 0)); |
170 |
// determine the compute-unit width |
// determine the compute-unit width |
171 |
|
|
172 |
if (isCPUDevice(dev)) |
if (isCPUDevice(dev)) |
173 |
dev->cuWidth = 1; |
dev->cuWidth = 1; |
174 |
else if (isGPUDevice(dev)) |
else if (isGPUDevice(dev)) |
175 |
if (strcasecmp("AMD", dev->vendor) == 0) |
if (dev->vendorId == AMD_VENDOR_ID) |
176 |
dev->cuWidth = 64; // an AMD wavefront is 64-wide |
dev->cuWidth = 64; // an AMD wavefront is 64-wide |
177 |
else if (strcasecmp("NVIDIA", dev->vendor) == 0) |
else if (dev->vendorId == NVIDIA_VENDOR_ID) |
178 |
dev->cuWidth = 32; // an NVIDIA warp is 32-wide |
dev->cuWidth = 32; // an NVIDIA warp is 32-wide |
179 |
else |
else |
180 |
dev->cuWidth = 32; // FIXME: not sure what this should be? |
dev->cuWidth = 32; // FIXME: not sure what this should be? |
206 |
else |
else |
207 |
fprintf (outS, " Device %d.%d (%s): **UNAVAILABLE**\n", i, j, dev->name); |
fprintf (outS, " Device %d.%d (%s): **UNAVAILABLE**\n", i, j, dev->name); |
208 |
fprintf (outS, " Vendor: %s\n", dev->vendor); |
fprintf (outS, " Vendor: %s\n", dev->vendor); |
209 |
|
fprintf (outS, " Vendor Id: %d\n", dev->vendorId); |
210 |
fprintf (outS, " OpenCL version: %d.%d\n", |
fprintf (outS, " OpenCL version: %d.%d\n", |
211 |
dev->majorVersion, dev->minorVersion); |
dev->majorVersion, dev->minorVersion); |
212 |
fprintf (outS, " Type: "); |
fprintf (outS, " Type: "); |