summaryrefslogtreecommitdiff
path: root/utests/utest_helper.cpp
diff options
context:
space:
mode:
authorPan Xiuli <xiuli.pan@intel.com>2017-06-15 16:44:50 +0800
committerYang Rong <rong.r.yang@intel.com>2017-06-16 16:34:32 +0800
commit79b8dd9ac8af9edaf65659d8ee95ba09a34fcd51 (patch)
tree159c4729b9157508e1f56e9fa8aaff395d47a15c /utests/utest_helper.cpp
parent521ac708db7f6b679aa32c7fced3ee953ae61867 (diff)
downloadbeignet-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.cpp20
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, &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_required_subgroup_size") == NULL) {
+ printf("No cl_intel_required_subgroup_size, Skip!");
+ return 0;
+ }
+ return 1;
+}