Kaydet (Commit) 55947853 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Keep also the platform vendor in ds_device

Change-Id: Id195cf9d079b24108b1fb9abeb1f0bf1529d2f72
üst 372bef89
...@@ -49,6 +49,7 @@ struct ds_device ...@@ -49,6 +49,7 @@ struct ds_device
{ {
ds_device_type type; ds_device_type type;
cl_device_id oclDeviceID; cl_device_id oclDeviceID;
char* oclPlatformVendor;
char* oclDeviceName; char* oclDeviceName;
char* oclDriverVersion; char* oclDriverVersion;
void* score; // a pointer to the score data, the content/format is application defined void* score; // a pointer to the score data, the content/format is application defined
...@@ -73,6 +74,7 @@ inline ds_status releaseDSProfile(ds_profile* profile, ds_score_release sr) ...@@ -73,6 +74,7 @@ inline ds_status releaseDSProfile(ds_profile* profile, ds_score_release sr)
unsigned int i; unsigned int i;
for (i = 0; i < profile->numDevices; i++) for (i = 0; i < profile->numDevices; i++)
{ {
free(profile->devices[i].oclPlatformVendor);
free(profile->devices[i].oclDeviceName); free(profile->devices[i].oclDeviceName);
free(profile->devices[i].oclDriverVersion); free(profile->devices[i].oclDriverVersion);
status = sr(profile->devices[i].score); status = sr(profile->devices[i].score);
...@@ -148,6 +150,9 @@ inline ds_status initDSProfile(ds_profile** p, const char* version) ...@@ -148,6 +150,9 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
{ {
cl_uint num; cl_uint num;
unsigned j; unsigned j;
char vendor[256];
if (clGetPlatformInfo(platforms[i], CL_PLATFORM_VENDOR, sizeof(vendor), vendor, NULL) != CL_SUCCESS)
vendor[0] = '\0';
clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_ALL, numDevices, devices, &num); clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_ALL, numDevices, devices, &num);
for (j = 0; j < num; j++, next++) for (j = 0; j < num; j++, next++)
{ {
...@@ -157,6 +162,8 @@ inline ds_status initDSProfile(ds_profile** p, const char* version) ...@@ -157,6 +162,8 @@ inline ds_status initDSProfile(ds_profile** p, const char* version)
profile->devices[next].type = DS_DEVICE_OPENCL_DEVICE; profile->devices[next].type = DS_DEVICE_OPENCL_DEVICE;
profile->devices[next].oclDeviceID = devices[j]; profile->devices[next].oclDeviceID = devices[j];
profile->devices[next].oclPlatformVendor = strdup(vendor);
clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_NAME clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_NAME
, DS_DEVICE_NAME_LENGTH, &buffer, NULL); , DS_DEVICE_NAME_LENGTH, &buffer, NULL);
length = strlen(buffer); length = strlen(buffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment