|
14 | 14 | // limitations under the License. |
15 | 15 | // |
16 | 16 | #include "harness/compat.h" |
17 | | - |
18 | | -#if !defined(_WIN32) |
19 | | -#include <unistd.h> |
20 | | -#endif |
21 | | - |
22 | | -#include <stdio.h> |
23 | | -#include <stdlib.h> |
24 | | -#include <string.h> |
25 | | - |
26 | | -#include <CL/cl_half.h> |
27 | | - |
| 17 | +#include "harness/deviceInfo.h" |
| 18 | +#include "harness/kernelHelpers.h" |
28 | 19 | #include "harness/testHarness.h" |
29 | | -#include "procs.h" |
30 | | - |
31 | | -test_definition test_list[] = { |
32 | | - ADD_TEST(hostptr), |
33 | | - ADD_TEST(fpmath), |
34 | | - ADD_TEST(intmath_int), |
35 | | - ADD_TEST(intmath_int2), |
36 | | - ADD_TEST(intmath_int4), |
37 | | - ADD_TEST(intmath_long), |
38 | | - ADD_TEST(intmath_long2), |
39 | | - ADD_TEST(intmath_long4), |
40 | | - ADD_TEST(hiloeo), |
41 | | - ADD_TEST(if), |
42 | | - ADD_TEST(sizeof), |
43 | | - ADD_TEST(loop), |
44 | | - ADD_TEST(pointer_cast), |
45 | | - ADD_TEST(local_arg_def), |
46 | | - ADD_TEST(local_kernel_def), |
47 | | - ADD_TEST(local_kernel_scope), |
48 | | - ADD_TEST(constant), |
49 | | - ADD_TEST(constant_source), |
50 | | - ADD_TEST(readimage), |
51 | | - ADD_TEST(readimage_int16), |
52 | | - ADD_TEST(readimage_fp32), |
53 | | - ADD_TEST(writeimage), |
54 | | - ADD_TEST(writeimage_int16), |
55 | | - ADD_TEST(writeimage_fp32), |
56 | | - ADD_TEST(mri_one), |
57 | | - |
58 | | - ADD_TEST(mri_multiple), |
59 | | - ADD_TEST(image_r8), |
60 | | - ADD_TEST(barrier), |
61 | | - ADD_TEST_VERSION(wg_barrier, Version(2, 0)), |
62 | | - ADD_TEST(int2fp), |
63 | | - ADD_TEST(fp2int), |
64 | | - ADD_TEST(imagereadwrite), |
65 | | - ADD_TEST(imagereadwrite3d), |
66 | | - ADD_TEST(readimage3d), |
67 | | - ADD_TEST(readimage3d_int16), |
68 | | - ADD_TEST(readimage3d_fp32), |
69 | | - ADD_TEST(bufferreadwriterect), |
70 | | - ADD_TEST(arrayreadwrite), |
71 | | - ADD_TEST(arraycopy), |
72 | | - ADD_TEST(imagearraycopy), |
73 | | - ADD_TEST(imagearraycopy3d), |
74 | | - ADD_TEST(imagecopy), |
75 | | - ADD_TEST(imagecopy3d), |
76 | | - ADD_TEST(imagerandomcopy), |
77 | | - ADD_TEST(arrayimagecopy), |
78 | | - ADD_TEST(arrayimagecopy3d), |
79 | | - ADD_TEST(imagenpot), |
80 | | - |
81 | | - ADD_TEST(vload_global), |
82 | | - ADD_TEST(vload_local), |
83 | | - ADD_TEST(vload_constant), |
84 | | - ADD_TEST(vload_private), |
85 | | - ADD_TEST(vstore_global), |
86 | | - ADD_TEST(vstore_local), |
87 | | - ADD_TEST(vstore_private), |
88 | | - |
89 | | - ADD_TEST(createkernelsinprogram), |
90 | | - ADD_TEST(imagedim_pow2), |
91 | | - ADD_TEST(imagedim_non_pow2), |
92 | | - ADD_TEST(image_param), |
93 | | - ADD_TEST(image_multipass_integer_coord), |
94 | | - ADD_TEST(image_multipass_float_coord), |
95 | | - |
96 | | - ADD_TEST(explicit_s2v), |
97 | | - |
98 | | - ADD_TEST(enqueue_map_buffer), |
99 | | - ADD_TEST(enqueue_map_image), |
100 | 20 |
|
101 | | - ADD_TEST(work_item_functions), |
102 | | - ADD_TEST(work_item_functions_out_of_range), |
103 | | - ADD_TEST(work_item_functions_out_of_range_hardcoded), |
104 | | - |
105 | | - ADD_TEST(astype), |
106 | | - |
107 | | - ADD_TEST(async_copy_global_to_local), |
108 | | - ADD_TEST(async_copy_local_to_global), |
109 | | - ADD_TEST(async_strided_copy_global_to_local), |
110 | | - ADD_TEST(async_strided_copy_local_to_global), |
111 | | - ADD_TEST(async_copy_global_to_local2D), |
112 | | - ADD_TEST(async_copy_local_to_global2D), |
113 | | - ADD_TEST(async_copy_global_to_local3D), |
114 | | - ADD_TEST(async_copy_local_to_global3D), |
115 | | - ADD_TEST(async_work_group_copy_fence_import_after_export_aliased_local), |
116 | | - ADD_TEST(async_work_group_copy_fence_import_after_export_aliased_global), |
117 | | - ADD_TEST( |
118 | | - async_work_group_copy_fence_import_after_export_aliased_global_and_local), |
119 | | - ADD_TEST(async_work_group_copy_fence_export_after_import_aliased_local), |
120 | | - ADD_TEST(async_work_group_copy_fence_export_after_import_aliased_global), |
121 | | - ADD_TEST( |
122 | | - async_work_group_copy_fence_export_after_import_aliased_global_and_local), |
123 | | - ADD_TEST(prefetch), |
124 | | - ADD_TEST(kernel_call_kernel_function), |
125 | | - ADD_TEST(host_numeric_constants), |
126 | | - ADD_TEST(kernel_numeric_constants), |
127 | | - ADD_TEST(kernel_limit_constants), |
128 | | - ADD_TEST(kernel_preprocessor_macros), |
129 | | - ADD_TEST(parameter_types), |
130 | | - ADD_TEST(vector_creation), |
131 | | - ADD_TEST(vector_swizzle), |
132 | | - ADD_TEST(vec_type_hint), |
133 | | - ADD_TEST(kernel_memory_alignment_local), |
134 | | - ADD_TEST(kernel_memory_alignment_global), |
135 | | - ADD_TEST(kernel_memory_alignment_constant), |
136 | | - ADD_TEST(kernel_memory_alignment_private), |
137 | | - |
138 | | - ADD_TEST_VERSION(progvar_prog_scope_misc, Version(2, 0)), |
139 | | - ADD_TEST_VERSION(progvar_prog_scope_uninit, Version(2, 0)), |
140 | | - ADD_TEST_VERSION(progvar_prog_scope_init, Version(2, 0)), |
141 | | - ADD_TEST_VERSION(progvar_func_scope, Version(2, 0)), |
142 | | - |
143 | | - ADD_TEST(global_work_offsets), |
144 | | - ADD_TEST(get_global_offset), |
145 | | - |
146 | | - ADD_TEST_VERSION(global_linear_id, Version(2, 0)), |
147 | | - ADD_TEST_VERSION(local_linear_id, Version(2, 0)), |
148 | | - ADD_TEST_VERSION(enqueued_local_size, Version(2, 0)), |
149 | | - |
150 | | - ADD_TEST(simple_read_image_pitch), |
151 | | - ADD_TEST(simple_write_image_pitch), |
152 | | - |
153 | | -#if defined(__APPLE__) |
154 | | - ADD_TEST(queue_priority), |
155 | | -#endif |
156 | | - |
157 | | - ADD_TEST_VERSION(get_linear_ids, Version(2, 0)), |
158 | | - ADD_TEST_VERSION(rw_image_access_qualifier, Version(2, 0)), |
159 | | -}; |
| 21 | +#include <CL/cl_half.h> |
160 | 22 |
|
161 | | -const int test_num = ARRAY_SIZE( test_list ); |
162 | 23 | cl_half_rounding_mode halfRoundingMode = CL_HALF_RTE; |
163 | 24 |
|
164 | 25 | test_status InitCL(cl_device_id device) |
@@ -187,7 +48,7 @@ test_status InitCL(cl_device_id device) |
187 | 48 |
|
188 | 49 | int main(int argc, const char *argv[]) |
189 | 50 | { |
190 | | - return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, 0, |
191 | | - InitCL); |
| 51 | + return runTestHarnessWithCheck( |
| 52 | + argc, argv, test_registry::getInstance().num_tests(), |
| 53 | + test_registry::getInstance().definitions(), false, 0, InitCL); |
192 | 54 | } |
193 | | - |
0 commit comments