summaryrefslogtreecommitdiff
path: root/opencl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-11-15 01:58:47 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-11-15 02:02:29 +0100
commitcf5589d20f660cb76248b19eff746f33025d4e76 (patch)
tree00830b570a12e535886a1afcbc934db55cc612cc /opencl
parent251933c6163b9d323f521275907dd08f54a997ce (diff)
sma improvements + windows fixes
Diffstat (limited to 'opencl')
-rw-r--r--opencl/opencl-info.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/opencl/opencl-info.cxx b/opencl/opencl-info.cxx
index fc3fbd0..c0f0659 100644
--- a/opencl/opencl-info.cxx
+++ b/opencl/opencl-info.cxx
@@ -9,7 +9,7 @@
#include "clew.h"
-#ifdef WIN32
+#if defined(WIN32) | defined(_WIN32) || defined(__WIN32)
#include <Windows.h>
#define OPENCL_DLL_NAME "OpenCL.dll"
#elif defined(MACOSX)
@@ -20,6 +20,8 @@
#include <iostream>
#include <fstream>
+#include <string>
+#include <vector>
const size_t PLATFORM_INFO_SIZE = 512;
const size_t DEVICE_INFO_SIZE = 512;
@@ -48,6 +50,13 @@ void log_device(std::ofstream& file, cl_device_id id)
file << " Vendor: " << vendor << std::endl;
+ cl_uint compute_units;
+ state = clGetDeviceInfo(id, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(compute_units), &compute_units, NULL);
+ if(state != CL_SUCCESS)
+ return;
+
+ file << " Compute Units: " << compute_units << std::endl;
+
char driver[DEVICE_INFO_SIZE];
state = clGetDeviceInfo(id, CL_DRIVER_VERSION, DEVICE_INFO_SIZE, driver, NULL);
if(state != CL_SUCCESS)
@@ -96,8 +105,8 @@ void log_platform(std::ofstream& file, cl_platform_id id)
if(state != CL_SUCCESS)
return;
- cl_device_id deviceIDs[devices];
- state = clGetDeviceIDs(id, CL_DEVICE_TYPE_ALL, devices, deviceIDs, NULL);
+ std::vector<cl_device_id> deviceIDs(devices);
+ state = clGetDeviceIDs(id, CL_DEVICE_TYPE_ALL, devices, &deviceIDs[0], NULL);
if(state != CL_SUCCESS)
return;
@@ -116,8 +125,8 @@ void list_platforms(std::ofstream& file)
if(state != CL_SUCCESS)
return;
- cl_platform_id platformIDs[platforms];
- state = clGetPlatformIDs(platforms, platformIDs, NULL);
+ std::vector<cl_platform_id> platformIDs(platforms);
+ state = clGetPlatformIDs(platforms, &platformIDs[0], NULL);
if(state != CL_SUCCESS)
return;