summaryrefslogtreecommitdiff
path: root/sc/source/core/opencl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-12 13:29:37 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-12 21:50:00 +0200
commit559478530b41e60528f2026c2f81872b0096dc94 (patch)
treeedcd266b63f4f6f62a438451454bd0ebee304f5f /sc/source/core/opencl
parent372bef8902a16d48b53e284b6777ddfa10aa0bdb (diff)
Keep also the platform vendor in ds_device
Change-Id: Id195cf9d079b24108b1fb9abeb1f0bf1529d2f72
Diffstat (limited to 'sc/source/core/opencl')
-rw-r--r--sc/source/core/opencl/opencl_device_selection.h7
1 files changed, 7 insertions, 0 deletions
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);