diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2017-03-08 23:00:37 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2017-03-13 16:59:37 +0800 |
commit | 9360073d15ec545cd40beef90f863dd28a3a14c9 (patch) | |
tree | b2dbdc5b227eb0d0d631f3fbce8fa9e5eb8be42e /utests/utest_helper.cpp | |
parent | 1ac3088ca716c7f8606e841dab2a24ce4c2127ec (diff) | |
download | beignet-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.cpp | 20 |
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, ¶m_value_size); + std::vector<char> param_value(param_value_size); + OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_EXTENSIONS, param_value_size, + param_value.empty() ? NULL : ¶m_value.front(), ¶m_value_size); + if (!param_value.empty()) + extStr = std::string(¶m_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; |