Kaydet (Commit) 3be59e38 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

store the platform and device id for later look-up

Change-Id: If95858d3812c913a3695f04bcfac76325171d102
üst 783179c1
...@@ -20,7 +20,7 @@ namespace sc { ...@@ -20,7 +20,7 @@ namespace sc {
struct SC_DLLPUBLIC OpenclDeviceInfo struct SC_DLLPUBLIC OpenclDeviceInfo
{ {
size_t mnId; void* device;
OUString maName; OUString maName;
OUString maVendor; OUString maVendor;
size_t mnMemory; size_t mnMemory;
...@@ -30,7 +30,7 @@ struct SC_DLLPUBLIC OpenclDeviceInfo ...@@ -30,7 +30,7 @@ struct SC_DLLPUBLIC OpenclDeviceInfo
struct SC_DLLPUBLIC OpenclPlatformInfo struct SC_DLLPUBLIC OpenclPlatformInfo
{ {
void* mnId; void* platform;
OUString maVendor; OUString maVendor;
OUString maName; OUString maName;
std::vector<OpenclDeviceInfo> maDevices; std::vector<OpenclDeviceInfo> maDevices;
......
...@@ -2640,6 +2640,8 @@ namespace { ...@@ -2640,6 +2640,8 @@ namespace {
void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo)
{ {
OpenclDeviceInfo aDeviceInfo; OpenclDeviceInfo aDeviceInfo;
aDeviceInfo.device = aDeviceId;
char pName[64]; char pName[64];
cl_int nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_NAME, 64, pName, NULL); cl_int nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_NAME, 64, pName, NULL);
if(nState != CL_SUCCESS) if(nState != CL_SUCCESS)
...@@ -2680,7 +2682,7 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) ...@@ -2680,7 +2682,7 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo)
bool createPlatformInfo(cl_platform_id nPlatformId, OpenclPlatformInfo& rPlatformInfo) bool createPlatformInfo(cl_platform_id nPlatformId, OpenclPlatformInfo& rPlatformInfo)
{ {
rPlatformInfo.mnId = nPlatformId; rPlatformInfo.platform = nPlatformId;
char pName[64]; char pName[64];
cl_int nState = clGetPlatformInfo(nPlatformId, CL_PLATFORM_NAME, 64, cl_int nState = clGetPlatformInfo(nPlatformId, CL_PLATFORM_NAME, 64,
pName, NULL); pName, NULL);
......
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