From 559478530b41e60528f2026c2f81872b0096dc94 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 12 Nov 2014 13:29:37 +0200 Subject: Keep also the platform vendor in ds_device Change-Id: Id195cf9d079b24108b1fb9abeb1f0bf1529d2f72 --- sc/source/core/opencl/opencl_device_selection.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sc/source') diff --git a/sc/source/core/opencl/opencl_device_selection.h b/sc/source/core/opencl/opencl_device_selection.h index fcfa41a55bb2..43e0f4c77fad 100644 --- a/sc/source/core/opencl/opencl_device_selection.h +++ b/sc/source/core/opencl/opencl_device_selection.h @@ -49,6 +49,7 @@ struct ds_device { ds_device_type type; cl_device_id oclDeviceID; + char* oclPlatformVendor; char* oclDeviceName; char* oclDriverVersion; 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) unsigned int i; for (i = 0; i < profile->numDevices; i++) { + free(profile->devices[i].oclPlatformVendor); free(profile->devices[i].oclDeviceName); free(profile->devices[i].oclDriverVersion); status = sr(profile->devices[i].score); @@ -148,6 +150,9 @@ inline ds_status initDSProfile(ds_profile** p, const char* version) { cl_uint num; 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); for (j = 0; j < num; j++, next++) { @@ -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].oclDeviceID = devices[j]; + profile->devices[next].oclPlatformVendor = strdup(vendor); + clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_NAME , DS_DEVICE_NAME_LENGTH, &buffer, NULL); length = strlen(buffer); -- cgit