1 //
2 // Copyright (c) 2017 The Khronos Group Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
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 #include "harness/testHarness.h"
26 #include "procs.h"
27
28 test_definition test_list[] = {
29 ADD_TEST( hostptr ),
30 ADD_TEST( fpmath_float ),
31 ADD_TEST( fpmath_float2 ),
32 ADD_TEST( fpmath_float4 ),
33 ADD_TEST( intmath_int ),
34 ADD_TEST( intmath_int2 ),
35 ADD_TEST( intmath_int4 ),
36 ADD_TEST( intmath_long ),
37 ADD_TEST( intmath_long2 ),
38 ADD_TEST( intmath_long4 ),
39 ADD_TEST( hiloeo ),
40 ADD_TEST( if ),
41 ADD_TEST( sizeof ),
42 ADD_TEST( loop ),
43 ADD_TEST( pointer_cast ),
44 ADD_TEST( local_arg_def ),
45 ADD_TEST( local_kernel_def ),
46 ADD_TEST( local_kernel_scope ),
47 ADD_TEST( constant ),
48 ADD_TEST( constant_source ),
49 ADD_TEST( readimage ),
50 ADD_TEST( readimage_int16 ),
51 ADD_TEST( readimage_fp32 ),
52 ADD_TEST( writeimage ),
53 ADD_TEST( writeimage_int16 ),
54 ADD_TEST( writeimage_fp32 ),
55 ADD_TEST( mri_one ),
56
57 ADD_TEST( mri_multiple ),
58 ADD_TEST( image_r8 ),
59 ADD_TEST( barrier ),
60 ADD_TEST_VERSION( wg_barrier, Version(2, 0) ),
61 ADD_TEST( int2float ),
62 ADD_TEST( float2int ),
63 ADD_TEST( imagereadwrite ),
64 ADD_TEST( imagereadwrite3d ),
65 ADD_TEST( readimage3d ),
66 ADD_TEST( readimage3d_int16 ),
67 ADD_TEST( readimage3d_fp32 ),
68 ADD_TEST( bufferreadwriterect ),
69 ADD_TEST( arrayreadwrite ),
70 ADD_TEST( arraycopy ),
71 ADD_TEST( imagearraycopy ),
72 ADD_TEST( imagearraycopy3d ),
73 ADD_TEST( imagecopy ),
74 ADD_TEST( imagecopy3d ),
75 ADD_TEST( imagerandomcopy ),
76 ADD_TEST( arrayimagecopy ),
77 ADD_TEST( arrayimagecopy3d ),
78 ADD_TEST( imagenpot ),
79
80 ADD_TEST( vload_global ),
81 ADD_TEST( vload_local ),
82 ADD_TEST( vload_constant ),
83 ADD_TEST( vload_private ),
84 ADD_TEST( vstore_global ),
85 ADD_TEST( vstore_local ),
86 ADD_TEST( vstore_private ),
87
88 ADD_TEST( createkernelsinprogram ),
89 ADD_TEST( imagedim_pow2 ),
90 ADD_TEST( imagedim_non_pow2 ),
91 ADD_TEST( image_param ),
92 ADD_TEST( image_multipass_integer_coord ),
93 ADD_TEST( image_multipass_float_coord ),
94 ADD_TEST( explicit_s2v_char ),
95 ADD_TEST( explicit_s2v_uchar ),
96 ADD_TEST( explicit_s2v_short ),
97 ADD_TEST( explicit_s2v_ushort ),
98 ADD_TEST( explicit_s2v_int ),
99 ADD_TEST( explicit_s2v_uint ),
100 ADD_TEST( explicit_s2v_long ),
101 ADD_TEST( explicit_s2v_ulong ),
102 ADD_TEST( explicit_s2v_float ),
103 ADD_TEST( explicit_s2v_double ),
104
105 ADD_TEST( enqueue_map_buffer ),
106 ADD_TEST( enqueue_map_image ),
107
108 ADD_TEST( work_item_functions ),
109
110 ADD_TEST( astype ),
111
112 ADD_TEST( async_copy_global_to_local ),
113 ADD_TEST( async_copy_local_to_global ),
114 ADD_TEST( async_strided_copy_global_to_local ),
115 ADD_TEST( async_strided_copy_local_to_global ),
116 ADD_TEST( prefetch ),
117
118 ADD_TEST( kernel_call_kernel_function ),
119 ADD_TEST( host_numeric_constants ),
120 ADD_TEST( kernel_numeric_constants ),
121 ADD_TEST( kernel_limit_constants ),
122 ADD_TEST( kernel_preprocessor_macros ),
123
124 ADD_TEST( parameter_types ),
125 ADD_TEST( vector_creation ),
126 ADD_TEST( vec_type_hint ),
127 ADD_TEST( kernel_memory_alignment_local ),
128 ADD_TEST( kernel_memory_alignment_global ),
129 ADD_TEST( kernel_memory_alignment_constant ),
130 ADD_TEST( kernel_memory_alignment_private ),
131
132 ADD_TEST_VERSION( progvar_prog_scope_misc, Version(2, 0) ),
133 ADD_TEST_VERSION( progvar_prog_scope_uninit, Version(2, 0) ),
134 ADD_TEST_VERSION( progvar_prog_scope_init, Version(2, 0) ),
135 ADD_TEST_VERSION( progvar_func_scope, Version(2, 0) ),
136
137 ADD_TEST( global_work_offsets ),
138 ADD_TEST( get_global_offset ),
139
140 ADD_TEST_VERSION( global_linear_id, Version(2, 0) ),
141 ADD_TEST_VERSION( local_linear_id, Version(2, 0) ),
142 ADD_TEST_VERSION( enqueued_local_size, Version(2, 0) ),
143
144 ADD_TEST( simple_read_image_pitch ),
145 ADD_TEST( simple_write_image_pitch ),
146
147 #if defined( __APPLE__ )
148 ADD_TEST( queue_priority ),
149 #endif
150
151 ADD_TEST_VERSION( get_linear_ids, Version(2, 0) ),
152 ADD_TEST_VERSION( rw_image_access_qualifier, Version(2, 0) ),
153 };
154
155 const int test_num = ARRAY_SIZE( test_list );
156
main(int argc,const char * argv[])157 int main(int argc, const char *argv[])
158 {
159 return runTestHarness( argc, argv, test_num, test_list, false, false, 0 );
160 }
161
162