diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2016-04-21 18:50:41 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-04-22 18:13:17 +0800 |
commit | 6e62f6eca7f4abed71728b92d9d9aee9799c8cb7 (patch) | |
tree | a7f7f519865028ec49a54b5eb92e6bcf5dc50760 /utests/utest_helper.cpp | |
parent | 830d3c32d00669f7eec5d80a083b3a0a88b39d11 (diff) | |
download | beignet-6e62f6eca7f4abed71728b92d9d9aee9799c8cb7.tar.gz |
add functions cl_check_beignet.
__gen_ocl_get_timestamp functions is beignet builtin.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/utest_helper.cpp')
-rw-r--r-- | utests/utest_helper.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index 77a19268..9696dac7 100644 --- a/utests/utest_helper.cpp +++ b/utests/utest_helper.cpp @@ -831,3 +831,25 @@ int cl_check_double(void) return 1; } + +int cl_check_beignet(void) +{ + size_t param_value_size; + size_t ret_sz; + OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_VERSION, 0, 0, ¶m_value_size); + if(param_value_size == 0) { + printf("Not beignet device , Skip!"); + return 0; + } + char* device_version_str = (char* )malloc(param_value_size * sizeof(char) ); + OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_VERSION, param_value_size, (void*)device_version_str, &ret_sz); + OCL_ASSERT(ret_sz == param_value_size); + + if(!strstr(device_version_str, "beignet")) { + free(device_version_str); + printf("Not beignet device , Skip!"); + return 0; + } + free(device_version_str); + return 1; +} |