From 6e62f6eca7f4abed71728b92d9d9aee9799c8cb7 Mon Sep 17 00:00:00 2001 From: Luo Xionghu Date: Thu, 21 Apr 2016 18:50:41 +0800 Subject: add functions cl_check_beignet. __gen_ocl_get_timestamp functions is beignet builtin. Signed-off-by: Luo Xionghu Reviewed-by: Yang Rong --- utests/utest_helper.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'utests/utest_helper.cpp') 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; +} -- cgit v1.2.1