diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2017-06-15 16:44:50 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2017-06-16 16:34:32 +0800 |
commit | 79b8dd9ac8af9edaf65659d8ee95ba09a34fcd51 (patch) | |
tree | 159c4729b9157508e1f56e9fa8aaff395d47a15c /utests/utest_helper.cpp | |
parent | 521ac708db7f6b679aa32c7fced3ee953ae61867 (diff) | |
download | beignet-79b8dd9ac8af9edaf65659d8ee95ba09a34fcd51.tar.gz |
Utset: Add test case for cl_intel_required_subgroup_size extension
Check the device supported subgroup sizes, and use
intel_reqd_sub_group_size to build kernels in these size. Then check if
there is spill for each kernel.
V2: Fix memory leak
Signed-off-by: Pan Xiuli <xiuli.pan@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 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index f4487c13..2e826bc6 100644 --- a/utests/utest_helper.cpp +++ b/utests/utest_helper.cpp @@ -1139,3 +1139,23 @@ float as_float(uint32_t i) _tmp._uint = i; return _tmp._float; } + +int cl_check_reqd_subgroup(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_required_subgroup_size") == NULL) { + printf("No cl_intel_required_subgroup_size, Skip!"); + return 0; + } + return 1; +} |