summaryrefslogtreecommitdiff
path: root/utests/utest_helper.cpp
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2017-03-08 23:00:37 +0800
committerYang Rong <rong.r.yang@intel.com>2017-03-13 16:59:37 +0800
commit9360073d15ec545cd40beef90f863dd28a3a14c9 (patch)
treeb2dbdc5b227eb0d0d631f3fbce8fa9e5eb8be42e /utests/utest_helper.cpp
parent1ac3088ca716c7f8606e841dab2a24ce4c2127ec (diff)
downloadbeignet-9360073d15ec545cd40beef90f863dd28a3a14c9.tar.gz
add extension cl_intel_media_block_io READ related function
v2: add #define intel_media_block_io in libocl; move extension check code to this patch; Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
Diffstat (limited to 'utests/utest_helper.cpp')
-rw-r--r--utests/utest_helper.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index 7052a149..f4487c13 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -939,6 +939,26 @@ int cl_check_subgroups_short(void)
return 1;
}
+int cl_check_media_block_io(void)
+{
+ if (!cl_check_subgroups())
+ return 0;
+ std::string extStr;
+ size_t param_value_size;
+ OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_EXTENSIONS, 0, 0, &param_value_size);
+ std::vector<char> param_value(param_value_size);
+ OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_EXTENSIONS, param_value_size,
+ param_value.empty() ? NULL : &param_value.front(), &param_value_size);
+ if (!param_value.empty())
+ extStr = std::string(&param_value.front(), param_value_size-1);
+
+ if (std::strstr(extStr.c_str(), "cl_intel_media_block_io") == NULL) {
+ printf("No cl_intel_media_block_io, Skip!");
+ return 0;
+ }
+ return 1;
+}
+
int cl_check_ocl20(bool or_beignet)
{
size_t param_value_size;