diff options
author | Pan Xiuli <xiuli.pan@intel.com> | 2016-10-19 14:37:19 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-11-03 12:24:01 +0800 |
commit | 2fc7c5249e09242802cb11b2d68eed9f59fb4b5c (patch) | |
tree | 20e810a1951e1ba46a321f66ec40e85146153489 /utests | |
parent | f31ffa8e284c6fdd2a3ea478e932b7a6d80928ce (diff) |
Utest: Add test case for sub group short builtin functions
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests')
-rw-r--r-- | utests/compiler_subgroup_reduce.cpp | 66 | ||||
-rw-r--r-- | utests/compiler_subgroup_scan_exclusive.cpp | 66 | ||||
-rw-r--r-- | utests/compiler_subgroup_scan_inclusive.cpp | 66 |
3 files changed, 198 insertions, 0 deletions
diff --git a/utests/compiler_subgroup_reduce.cpp b/utests/compiler_subgroup_reduce.cpp index ff545c6e..157086aa 100644 --- a/utests/compiler_subgroup_reduce.cpp +++ b/utests/compiler_subgroup_reduce.cpp @@ -357,6 +357,28 @@ void compiler_subgroup_reduce_add_half(void) subgroup_generic(WG_REDUCE_ADD, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_add_half); +void compiler_subgroup_reduce_add_short(void) +{ + if(!cl_check_subgroups_short()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_reduce", + "compiler_subgroup_reduce_add_short"); + subgroup_generic(WG_REDUCE_ADD, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_add_short); +void compiler_subgroup_reduce_add_ushort(void) +{ + if(!cl_check_subgroups_short()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_reduce", + "compiler_subgroup_reduce_add_ushort"); + subgroup_generic(WG_REDUCE_ADD, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_add_ushort); /* * Workgroup reduce max utest functions @@ -430,6 +452,28 @@ void compiler_subgroup_reduce_max_half(void) subgroup_generic(WG_REDUCE_MAX, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_max_half); +void compiler_subgroup_reduce_max_short(void) +{ + if(!cl_check_subgroups_short()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_reduce", + "compiler_subgroup_reduce_max_short"); + subgroup_generic(WG_REDUCE_MAX, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_max_short); +void compiler_subgroup_reduce_max_ushort(void) +{ + if(!cl_check_subgroups_short()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_reduce", + "compiler_subgroup_reduce_max_ushort"); + subgroup_generic(WG_REDUCE_MAX, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_max_ushort); /* * Workgroup reduce min utest functions @@ -503,3 +547,25 @@ void compiler_subgroup_reduce_min_half(void) subgroup_generic(WG_REDUCE_MIN, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_min_half); +void compiler_subgroup_reduce_min_short(void) +{ + if(!cl_check_subgroups_short()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_reduce", + "compiler_subgroup_reduce_min_short"); + subgroup_generic(WG_REDUCE_MIN, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_min_short); +void compiler_subgroup_reduce_min_ushort(void) +{ + if(!cl_check_subgroups_short()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_reduce", + "compiler_subgroup_reduce_min_ushort"); + subgroup_generic(WG_REDUCE_MIN, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_reduce_min_ushort); diff --git a/utests/compiler_subgroup_scan_exclusive.cpp b/utests/compiler_subgroup_scan_exclusive.cpp index e51b78df..4f3e5ea5 100644 --- a/utests/compiler_subgroup_scan_exclusive.cpp +++ b/utests/compiler_subgroup_scan_exclusive.cpp @@ -312,6 +312,28 @@ void compiler_subgroup_scan_exclusive_add_half(void) subgroup_generic(WG_SCAN_EXCLUSIVE_ADD, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_add_half); +void compiler_subgroup_scan_exclusive_add_short(void) +{ + if(!cl_check_subgroups()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_exclusive", + "compiler_subgroup_scan_exclusive_add_short"); + subgroup_generic(WG_SCAN_EXCLUSIVE_ADD, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_add_short); +void compiler_subgroup_scan_exclusive_add_ushort(void) +{ + if(!cl_check_subgroups()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_exclusive", + "compiler_subgroup_scan_exclusive_add_ushort"); + subgroup_generic(WG_SCAN_EXCLUSIVE_ADD, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_add_ushort); /* * Workgroup scan_exclusive max utest functions @@ -385,6 +407,28 @@ void compiler_subgroup_scan_exclusive_max_half(void) subgroup_generic(WG_SCAN_EXCLUSIVE_MAX, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_max_half); +void compiler_subgroup_scan_exclusive_max_short(void) +{ + if(!cl_check_subgroups()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_exclusive", + "compiler_subgroup_scan_exclusive_max_short"); + subgroup_generic(WG_SCAN_EXCLUSIVE_MAX, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_max_short); +void compiler_subgroup_scan_exclusive_max_ushort(void) +{ + if(!cl_check_subgroups()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_exclusive", + "compiler_subgroup_scan_exclusive_max_ushort"); + subgroup_generic(WG_SCAN_EXCLUSIVE_MAX, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_max_ushort); /* * Workgroup scan_exclusive min utest functions @@ -458,3 +502,25 @@ void compiler_subgroup_scan_exclusive_min_half(void) subgroup_generic(WG_SCAN_EXCLUSIVE_MIN, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_min_half); +void compiler_subgroup_scan_exclusive_min_short(void) +{ + if(!cl_check_subgroups()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_exclusive", + "compiler_subgroup_scan_exclusive_min_short"); + subgroup_generic(WG_SCAN_EXCLUSIVE_MIN, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_min_short); +void compiler_subgroup_scan_exclusive_min_ushort(void) +{ + if(!cl_check_subgroups()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_exclusive", + "compiler_subgroup_scan_exclusive_min_ushort"); + subgroup_generic(WG_SCAN_EXCLUSIVE_MIN, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_exclusive_min_ushort); diff --git a/utests/compiler_subgroup_scan_inclusive.cpp b/utests/compiler_subgroup_scan_inclusive.cpp index 0f0df1c8..8f8c2641 100644 --- a/utests/compiler_subgroup_scan_inclusive.cpp +++ b/utests/compiler_subgroup_scan_inclusive.cpp @@ -298,6 +298,28 @@ void compiler_subgroup_scan_inclusive_add_half(void) subgroup_generic(WG_SCAN_INCLUSIVE_ADD, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_add_half); +void compiler_subgroup_scan_inclusive_add_short(void) +{ + if(!cl_check_subgroups()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_inclusive", + "compiler_subgroup_scan_inclusive_add_short"); + subgroup_generic(WG_SCAN_INCLUSIVE_ADD, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_add_short); +void compiler_subgroup_scan_inclusive_add_ushort(void) +{ + if(!cl_check_subgroups()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_inclusive", + "compiler_subgroup_scan_inclusive_add_ushort"); + subgroup_generic(WG_SCAN_INCLUSIVE_ADD, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_add_ushort); /* * Workgroup scan_inclusive max utest functions @@ -371,6 +393,28 @@ void compiler_subgroup_scan_inclusive_max_half(void) subgroup_generic(WG_SCAN_INCLUSIVE_MAX, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_max_half); +void compiler_subgroup_scan_inclusive_max_short(void) +{ + if(!cl_check_subgroups()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_inclusive", + "compiler_subgroup_scan_inclusive_max_short"); + subgroup_generic(WG_SCAN_INCLUSIVE_MAX, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_max_short); +void compiler_subgroup_scan_inclusive_max_ushort(void) +{ + if(!cl_check_subgroups()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_inclusive", + "compiler_subgroup_scan_inclusive_max_ushort"); + subgroup_generic(WG_SCAN_INCLUSIVE_MAX, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_max_ushort); /* * Workgroup scan_inclusive min utest functions @@ -444,3 +488,25 @@ void compiler_subgroup_scan_inclusive_min_half(void) subgroup_generic(WG_SCAN_INCLUSIVE_MIN, input, expected, true); } MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_min_half); +void compiler_subgroup_scan_inclusive_min_short(void) +{ + if(!cl_check_subgroups()) + return; + cl_short *input = NULL; + cl_short *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_inclusive", + "compiler_subgroup_scan_inclusive_min_short"); + subgroup_generic(WG_SCAN_INCLUSIVE_MIN, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_min_short); +void compiler_subgroup_scan_inclusive_min_ushort(void) +{ + if(!cl_check_subgroups()) + return; + cl_ushort *input = NULL; + cl_ushort *expected = NULL; + OCL_CREATE_KERNEL_FROM_FILE("compiler_subgroup_scan_inclusive", + "compiler_subgroup_scan_inclusive_min_ushort"); + subgroup_generic(WG_SCAN_INCLUSIVE_MIN, input, expected); +} +MAKE_UTEST_FROM_FUNCTION(compiler_subgroup_scan_inclusive_min_ushort); |