summaryrefslogtreecommitdiff
path: root/utests/utest_helper.cpp
diff options
context:
space:
mode:
authorPan Xiuli <xiuli.pan@intel.com>2016-10-19 14:37:15 +0800
committerYang Rong <rong.r.yang@intel.com>2016-11-03 12:23:49 +0800
commit49a25aef893da9d03bfa1154f916755aa638d729 (patch)
tree286138c2f5f6dcb8dd8191a771ef4dddb15fe3cb /utests/utest_helper.cpp
parentd4f06bd0ecd05b7b27f9bcd89aa3d1325e60940d (diff)
downloadbeignet-49a25aef893da9d03bfa1154f916755aa638d729.tar.gz
Utest: Add check subgroup short helper function
Check if the device support intel_subgroups_short extension, also check if the device support intel_subgroups extension first. 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 e87d2309..65c97bb8 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -917,6 +917,26 @@ int cl_check_subgroups(void)
return 1;
}
+int cl_check_subgroups_short(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_subgroups_short") == NULL) {
+ printf("No cl_intel_subgroups_short, Skip!");
+ return 0;
+ }
+ return 1;
+}
+
int cl_check_ocl20(void)
{
size_t param_value_size;