diff options
author | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-07-08 17:36:46 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-07-12 09:43:05 +0800 |
commit | 90f51271e1c8ba7a123f580c27d7351a884c8adf (patch) | |
tree | 674a24ae4f3e99c902fd5cbaa3aba9b319c3f115 /utests/utest_helper.cpp | |
parent | 46fadccdb12a6bb092f4c335325aba5d083727f7 (diff) | |
download | beignet-90f51271e1c8ba7a123f580c27d7351a884c8adf.tar.gz |
utest: Query the device driver version and the open cl c version.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Song, Ruiling <ruiling.song@intel.com>
Diffstat (limited to 'utests/utest_helper.cpp')
-rw-r--r-- | utests/utest_helper.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index 504f80f4..9069db21 100644 --- a/utests/utest_helper.cpp +++ b/utests/utest_helper.cpp @@ -294,10 +294,10 @@ error: #include <cstring> #define GET_DEVICE_STR_INFO(LOWER_NAME, NAME) \ std::string LOWER_NAME ##Str; \ - OCL_CALL (clGetDeviceInfo, device, CL_DEVICE_##NAME, 0, 0, ¶m_value_size); \ + OCL_CALL (clGetDeviceInfo, device, NAME, 0, 0, ¶m_value_size); \ { \ std::vector<char> param_value(param_value_size); \ - OCL_CALL (clGetDeviceInfo, device, CL_DEVICE_##NAME, \ + OCL_CALL (clGetDeviceInfo, device, NAME, \ param_value_size, param_value.empty() ? NULL : ¶m_value.front(), \ ¶m_value_size); \ if (!param_value.empty()) \ @@ -305,7 +305,6 @@ error: } \ printf("device_" #LOWER_NAME " \"%s\"\n", LOWER_NAME ##Str.c_str()); - int cl_ocl_init(void) { @@ -332,11 +331,13 @@ cl_ocl_init(void) OCL_CALL (clGetDeviceIDs, platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL); { size_t param_value_size; - GET_DEVICE_STR_INFO(profile, PROFILE); - GET_DEVICE_STR_INFO(name, NAME); - GET_DEVICE_STR_INFO(vendor, VENDOR); - GET_DEVICE_STR_INFO(version, VERSION); - GET_DEVICE_STR_INFO(extensions, EXTENSIONS); + GET_DEVICE_STR_INFO(profile, CL_DEVICE_PROFILE); + GET_DEVICE_STR_INFO(name, CL_DEVICE_NAME); + GET_DEVICE_STR_INFO(vendor, CL_DEVICE_VENDOR); + GET_DEVICE_STR_INFO(version, CL_DEVICE_VERSION); + GET_DEVICE_STR_INFO(opencl_c_version, CL_DEVICE_OPENCL_C_VERSION); + GET_DEVICE_STR_INFO(driver_version, CL_DRIVER_VERSION); + GET_DEVICE_STR_INFO(extensions, CL_DEVICE_EXTENSIONS); if (std::strstr(extensionsStr.c_str(), "cl_khr_gl_sharing")) { hasGLExt = true; } |