diff options
author | Zhenyu Wang <zhenyuw@linux.intel.com> | 2014-10-16 14:12:01 +0800 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2014-10-16 14:12:01 +0800 |
commit | ff347aa7a3ba959d15c977679c57442b51e5d029 (patch) | |
tree | de2c3007e82d0923eb8d78683b62be1cb6736119 /BealtoOpenCL | |
parent | 2af01368ccc10fea71cdb180f8a6fa4cf3718d3f (diff) |
Print more device info
e.g device name, vendor, version, etc.
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'BealtoOpenCL')
-rw-r--r-- | BealtoOpenCL/src/CLContext.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/BealtoOpenCL/src/CLContext.cpp b/BealtoOpenCL/src/CLContext.cpp index 7ca7848..526d30f 100644 --- a/BealtoOpenCL/src/CLContext.cpp +++ b/BealtoOpenCL/src/CLContext.cpp @@ -6,6 +6,7 @@ #include <vector> #include <sstream> #include <stdlib.h> +#include <stdio.h> #include "CLError.h" #include "CLContext.h" #include "CLCommandQueue.h" @@ -224,6 +225,22 @@ bool Context::getAllDeviceInfo(int d,std::string & info) if (!getDeviceInfo(d,CL_DEVICE_VENDOR_ID,ui)) return false; o << "- vendor id: " << ui << "\n"; + + char n[256]; + size_t s_ret; + + if (!getDeviceInfo(d,CL_DEVICE_VENDOR, sizeof(n), n, &s_ret)) return false; + o << "- vendor name: "<< n << "\n"; + + if (!getDeviceInfo(d,CL_DEVICE_NAME, sizeof(n), n, &s_ret)) return false; + o << "- device name: "<< n << "\n"; + + if (!getDeviceInfo(d,CL_DEVICE_VERSION, sizeof(n), n, &s_ret)) return false; + o << "- device version: "<< n << "\n"; + + if (!getDeviceInfo(d,CL_DRIVER_VERSION, sizeof(n), n, &s_ret)) return false; + o << "- driver version: "<< n << "\n"; + if (!getDeviceInfo(d,CL_DEVICE_MAX_COMPUTE_UNITS,ui)) return false; o << "- max compute units: " << ui << "\n"; if (!getDeviceInfo(d,CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS,ui)) return false; |