]>
Commit | Line | Data |
---|---|---|
1 | # Copyright 2010-2020 Free Software Foundation, Inc. | |
2 | ||
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
15 | # | |
16 | # Contributed by Ken Werner <ken.werner@de.ibm.com>. | |
17 | # | |
18 | # Tests OpenCL data types. | |
19 | ||
20 | load_lib opencl.exp | |
21 | ||
22 | if { [skip_opencl_tests] } { | |
23 | return 0 | |
24 | } | |
25 | ||
26 | set testfile "datatypes" | |
27 | set clprogram [remote_download target ${srcdir}/${subdir}/${testfile}.cl] | |
28 | ||
29 | # Compile the generic OpenCL host app | |
30 | if { [gdb_compile_opencl_hostapp "${clprogram}" "${testfile}" "" ] != "" } { | |
31 | untested "failed to compile" | |
32 | return -1 | |
33 | } | |
34 | ||
35 | gdb_exit | |
36 | gdb_start | |
37 | ||
38 | # Manually switch the language to opencl | |
39 | gdb_test_no_output "set language opencl" "no prompt when setting the language to opencl" | |
40 | ||
41 | # Check OpenCL data types (GDB) | |
42 | gdb_test "whatis bool" "type = bool" | |
43 | gdb_test "p sizeof(bool)" " = 1" | |
44 | ||
45 | gdb_test "whatis char" "type = char" | |
46 | gdb_test "p sizeof(char)" " = 1" | |
47 | gdb_test "whatis char2" "type = char2" | |
48 | gdb_test "p sizeof(char2)" " = 2" | |
49 | gdb_test "whatis char3" "type = char3" | |
50 | gdb_test "p sizeof(char3)" " = 4" | |
51 | gdb_test "whatis char4" "type = char4" | |
52 | gdb_test "p sizeof(char4)" " = 4" | |
53 | gdb_test "whatis char8" "type = char8" | |
54 | gdb_test "p sizeof(char8)" " = 8" | |
55 | gdb_test "whatis char16" "type = char16" | |
56 | gdb_test "p sizeof(char16)" " = 16" | |
57 | ||
58 | gdb_test "whatis unsigned char" "type = unsigned char" | |
59 | gdb_test "p sizeof(unsigned char)" " = 1" | |
60 | gdb_test "whatis uchar" "type = uchar" | |
61 | gdb_test "p sizeof(uchar)" " = 1" | |
62 | gdb_test "whatis uchar2" "type = uchar2" | |
63 | gdb_test "p sizeof(uchar2)" " = 2" | |
64 | gdb_test "whatis uchar3" "type = uchar3" | |
65 | gdb_test "p sizeof(uchar3)" " = 4" | |
66 | gdb_test "whatis uchar4" "type = uchar4" | |
67 | gdb_test "p sizeof(uchar4)" " = 4" | |
68 | gdb_test "whatis uchar8" "type = uchar8" | |
69 | gdb_test "p sizeof(uchar8)" " = 8" | |
70 | gdb_test "whatis uchar16" "type = uchar16" | |
71 | gdb_test "p sizeof(uchar16)" " = 16" | |
72 | ||
73 | gdb_test "whatis short" "type = short" | |
74 | gdb_test "p sizeof(short)" " = 2" | |
75 | gdb_test "whatis short2" "type = short2" | |
76 | gdb_test "p sizeof(short2)" " = 4" | |
77 | gdb_test "whatis short3" "type = short3" | |
78 | gdb_test "p sizeof(short3)" " = 8" | |
79 | gdb_test "whatis short4" "type = short4" | |
80 | gdb_test "p sizeof(short4)" " = 8" | |
81 | gdb_test "whatis short8" "type = short8" | |
82 | gdb_test "p sizeof(short8)" " = 16" | |
83 | gdb_test "whatis short16" "type = short16" | |
84 | gdb_test "p sizeof(short16)" " = 32" | |
85 | ||
86 | gdb_test "whatis unsigned short" "type = unsigned short" | |
87 | gdb_test "p sizeof(unsigned short)" " = 2" | |
88 | gdb_test "whatis ushort" "type = ushort" | |
89 | gdb_test "p sizeof(ushort)" " = 2" | |
90 | gdb_test "whatis ushort2" "type = ushort2" | |
91 | gdb_test "p sizeof(ushort2)" " = 4" | |
92 | gdb_test "whatis ushort3" "type = ushort3" | |
93 | gdb_test "p sizeof(ushort3)" " = 8" | |
94 | gdb_test "whatis ushort4" "type = ushort4" | |
95 | gdb_test "p sizeof(ushort4)" " = 8" | |
96 | gdb_test "whatis ushort8" "type = ushort8" | |
97 | gdb_test "p sizeof(ushort8)" " = 16" | |
98 | gdb_test "whatis ushort16" "type = ushort16" | |
99 | gdb_test "p sizeof(ushort16)" " = 32" | |
100 | ||
101 | gdb_test "whatis int" "type = int" | |
102 | gdb_test "p sizeof(int)" " = 4" | |
103 | gdb_test "whatis int2" "type = int2" | |
104 | gdb_test "p sizeof(int2)" " = 8" | |
105 | gdb_test "whatis int3" "type = int3" | |
106 | gdb_test "p sizeof(int3)" " = 16" | |
107 | gdb_test "whatis int4" "type = int4" | |
108 | gdb_test "p sizeof(int4)" " = 16" | |
109 | gdb_test "whatis int8" "type = int8" | |
110 | gdb_test "p sizeof(int8)" " = 32" | |
111 | gdb_test "whatis int16" "type = int16" | |
112 | gdb_test "p sizeof(int16)" " = 64" | |
113 | ||
114 | gdb_test "whatis unsigned int" "type = unsigned int" | |
115 | gdb_test "p sizeof(unsigned int)" " = 4" | |
116 | gdb_test "whatis uint" "type = uint" | |
117 | gdb_test "p sizeof(uint)" " = 4" | |
118 | gdb_test "whatis uint2" "type = uint2" | |
119 | gdb_test "p sizeof(uint2)" " = 8" | |
120 | gdb_test "whatis uint3" "type = uint3" | |
121 | gdb_test "p sizeof(uint3)" " = 16" | |
122 | gdb_test "whatis uint4" "type = uint4" | |
123 | gdb_test "p sizeof(uint4)" " = 16" | |
124 | gdb_test "whatis uint8" "type = uint8" | |
125 | gdb_test "p sizeof(uint8)" " = 32" | |
126 | gdb_test "whatis uint16" "type = uint16" | |
127 | gdb_test "p sizeof(uint16)" " = 64" | |
128 | ||
129 | gdb_test "whatis long" "type = long" | |
130 | gdb_test "p sizeof(long)" " = 8" | |
131 | gdb_test "whatis long2" "type = long2" | |
132 | gdb_test "p sizeof(long2)" " = 16" | |
133 | gdb_test "whatis long3" "type = long3" | |
134 | gdb_test "p sizeof(long3)" " = 32" | |
135 | gdb_test "whatis long4" "type = long4" | |
136 | gdb_test "p sizeof(long4)" " = 32" | |
137 | gdb_test "whatis long8" "type = long8" | |
138 | gdb_test "p sizeof(long8)" " = 64" | |
139 | gdb_test "whatis long16" "type = long16" | |
140 | gdb_test "p sizeof(long16)" " = 128" | |
141 | ||
142 | gdb_test "whatis unsigned long" "type = unsigned long" | |
143 | gdb_test "p sizeof(unsigned long)" " = 8" | |
144 | gdb_test "whatis ulong" "type = ulong" | |
145 | gdb_test "p sizeof(ulong)" " = 8" | |
146 | gdb_test "whatis ulong2" "type = ulong2" | |
147 | gdb_test "p sizeof(ulong2)" " = 16" | |
148 | gdb_test "whatis ulong3" "type = ulong3" | |
149 | gdb_test "p sizeof(ulong3)" " = 32" | |
150 | gdb_test "whatis ulong4" "type = ulong4" | |
151 | gdb_test "p sizeof(ulong4)" " = 32" | |
152 | gdb_test "whatis ulong8" "type = ulong8" | |
153 | gdb_test "p sizeof(ulong8)" " = 64" | |
154 | gdb_test "whatis ulong16" "type = ulong16" | |
155 | gdb_test "p sizeof(ulong16)" " = 128" | |
156 | ||
157 | gdb_test "whatis half" "type = half" | |
158 | gdb_test "p sizeof(half)" " = 2" | |
159 | gdb_test "whatis half2" "type = half2" | |
160 | gdb_test "p sizeof(half2)" " = 4" | |
161 | gdb_test "whatis half3" "type = half3" | |
162 | gdb_test "p sizeof(half3)" " = 8" | |
163 | gdb_test "whatis half4" "type = half4" | |
164 | gdb_test "p sizeof(half4)" " = 8" | |
165 | gdb_test "whatis half8" "type = half8" | |
166 | gdb_test "p sizeof(half8)" " = 16" | |
167 | gdb_test "whatis half16" "type = half16" | |
168 | gdb_test "p sizeof(half16)" " = 32" | |
169 | ||
170 | gdb_test "whatis float" "type = float" | |
171 | gdb_test "p sizeof(float)" " = 4" | |
172 | gdb_test "whatis float2" "type = float2" | |
173 | gdb_test "p sizeof(float2)" " = 8" | |
174 | gdb_test "whatis float3" "type = float3" | |
175 | gdb_test "p sizeof(float3)" " = 16" | |
176 | gdb_test "whatis float4" "type = float4" | |
177 | gdb_test "p sizeof(float4)" " = 16" | |
178 | gdb_test "whatis float8" "type = float8" | |
179 | gdb_test "p sizeof(float8)" " = 32" | |
180 | gdb_test "whatis float16" "type = float16" | |
181 | gdb_test "p sizeof(float16)" " = 64" | |
182 | ||
183 | gdb_test "whatis double" "type = double" | |
184 | gdb_test "p sizeof(double)" " = 8" | |
185 | gdb_test "whatis double2" "type = double2" | |
186 | gdb_test "p sizeof(double2)" " = 16" | |
187 | gdb_test "whatis double3" "type = double3" | |
188 | gdb_test "p sizeof(double3)" " = 32" | |
189 | gdb_test "whatis double4" "type = double4" | |
190 | gdb_test "p sizeof(double4)" " = 32" | |
191 | gdb_test "whatis double8" "type = double8" | |
192 | gdb_test "p sizeof(double8)" " = 64" | |
193 | gdb_test "whatis double16" "type = double16" | |
194 | gdb_test "p sizeof(double16)" " = 128" | |
195 | ||
196 | # Set the language back to the default: "auto; currently c" | |
197 | gdb_test_no_output "set language c" "no prompt when setting the language to c" | |
198 | gdb_test_no_output "set language auto" "no prompt when setting the language to auto" | |
199 | ||
200 | # Load the OpenCL app | |
201 | gdb_reinitialize_dir $srcdir/$subdir | |
202 | gdb_load ${objdir}/${subdir}/${testfile} | |
203 | ||
204 | # Set breakpoint at the OpenCL kernel | |
205 | gdb_test "tbreak testkernel" \ | |
206 | "" \ | |
207 | "Set pending breakpoint" \ | |
208 | ".*Function \"testkernel\" not defined.*Make breakpoint pending.*y or \\\[n\\\]. $" \ | |
209 | "y" | |
210 | ||
211 | gdb_run_cmd | |
212 | gdb_test "" ".*reakpoint.*1.*testkernel.*" "run" | |
213 | ||
214 | # Continue to the marker | |
215 | gdb_breakpoint [gdb_get_line_number "marker" "${clprogram}"] | |
216 | gdb_continue_to_breakpoint "marker" | |
217 | ||
218 | # Check if the language was switched to opencl | |
219 | gdb_test "show language" "The current source language is \"auto; currently opencl\"\." | |
220 | ||
221 | # Retrieve some information about the OpenCL version and the availability of extensions | |
222 | set opencl_version [get_integer_valueof "opencl_version" 0] | |
223 | set have_cl_khr_fp64 [get_integer_valueof "have_cl_khr_fp64" 0] | |
224 | set have_cl_khr_fp16 [get_integer_valueof "have_cl_khr_fp16" 0] | |
225 | ||
226 | # Check OpenCL data types (DWARF) | |
227 | gdb_test "whatis b" "type = bool" | |
228 | gdb_test "p sizeof(b)" " = 1" | |
229 | gdb_test "print b" " = (false|0)" | |
230 | ||
231 | gdb_test "whatis c" "type = char" | |
232 | gdb_test "p sizeof(c)" " = 1" | |
233 | gdb_test "print/d c" " = 1" | |
234 | gdb_test "whatis c2" "type = char2" | |
235 | gdb_test "p sizeof(c2)" " = 2" | |
236 | gdb_test "print c2" " = \\{1, 2\\}" | |
237 | if { ${opencl_version} >= 110 } { | |
238 | gdb_test "whatis c3" "type = char3" | |
239 | gdb_test "p sizeof(c3)" " = 4" | |
240 | gdb_test "print c3" " = \\{1, 2, 3\\}" | |
241 | } | |
242 | gdb_test "whatis c4" "type = char4" | |
243 | gdb_test "p sizeof(c4)" " = 4" | |
244 | gdb_test "print c4" " = \\{1, 2, 3, 4\\}" | |
245 | gdb_test "whatis c8" "type = char8" | |
246 | gdb_test "p sizeof(c8)" " = 8" | |
247 | gdb_test "print c8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
248 | gdb_test "whatis c16" "type = char16" | |
249 | gdb_test "p sizeof(c16)" " = 16" | |
250 | gdb_test "print c16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
251 | ||
252 | gdb_test "whatis uc" "type = uchar" | |
253 | gdb_test "p sizeof(uc)" " = 1" | |
254 | gdb_test "print/d uc" " = 1" | |
255 | gdb_test "whatis uc2" "type = uchar2" | |
256 | gdb_test "p sizeof(uc2)" " = 2" | |
257 | gdb_test "print uc2" " = \\{1, 2\\}" | |
258 | if { ${opencl_version} >= 110 } { | |
259 | gdb_test "whatis uc3" "type = uchar3" | |
260 | gdb_test "p sizeof(uc3)" " = 4" | |
261 | gdb_test "print uc3" " = \\{1, 2, 3\\}" | |
262 | } | |
263 | gdb_test "whatis uc4" "type = uchar4" | |
264 | gdb_test "p sizeof(uc4)" " = 4" | |
265 | gdb_test "print uc4" " = \\{1, 2, 3, 4\\}" | |
266 | gdb_test "whatis uc8" "type = uchar8" | |
267 | gdb_test "p sizeof(uc8)" " = 8" | |
268 | gdb_test "print uc8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
269 | gdb_test "whatis uc16" "type = uchar16" | |
270 | gdb_test "p sizeof(uc16)" " = 16" | |
271 | gdb_test "print uc16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
272 | ||
273 | gdb_test "whatis s" "type = short" | |
274 | gdb_test "p sizeof(s)" " = 2" | |
275 | gdb_test "print s" " = -1" | |
276 | gdb_test "whatis s2" "type = short2" | |
277 | gdb_test "p sizeof(s2)" " = 4" | |
278 | gdb_test "print s2" " = \\{-1, -2\\}" | |
279 | if { ${opencl_version} >= 110 } { | |
280 | gdb_test "whatis s3" "type = short3" | |
281 | gdb_test "p sizeof(s3)" " = 8" | |
282 | gdb_test "print s3" " = \\{-1, -2, -3\\}" | |
283 | } | |
284 | gdb_test "whatis s4" "type = short4" | |
285 | gdb_test "p sizeof(s4)" " = 8" | |
286 | gdb_test "print s4" " = \\{-1, -2, -3, -4\\}" | |
287 | gdb_test "whatis s8" "type = short8" | |
288 | gdb_test "p sizeof(s8)" " = 16" | |
289 | gdb_test "print s8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}" | |
290 | gdb_test "whatis s16" "type = short16" | |
291 | gdb_test "p sizeof(s16)" " = 32" | |
292 | gdb_test "print s16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}" | |
293 | ||
294 | gdb_test "whatis us" "type = ushort" | |
295 | gdb_test "p sizeof(us)" " = 2" | |
296 | gdb_test "print us" " = 1" | |
297 | gdb_test "whatis us2" "type = ushort2" | |
298 | gdb_test "p sizeof(us2)" " = 4" | |
299 | gdb_test "print us2" " = \\{1, 2\\}" | |
300 | if { ${opencl_version} >= 110 } { | |
301 | gdb_test "whatis us3" "type = ushort3" | |
302 | gdb_test "p sizeof(us3)" " = 8" | |
303 | gdb_test "print us3" " = \\{1, 2, 3\\}" | |
304 | } | |
305 | gdb_test "whatis us4" "type = ushort4" | |
306 | gdb_test "p sizeof(us4)" " = 8" | |
307 | gdb_test "print us4" " = \\{1, 2, 3, 4\\}" | |
308 | gdb_test "whatis us8" "type = ushort8" | |
309 | gdb_test "p sizeof(us8)" " = 16" | |
310 | gdb_test "print us8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
311 | gdb_test "whatis us16" "type = ushort16" | |
312 | gdb_test "p sizeof(us16)" " = 32" | |
313 | gdb_test "print us16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
314 | ||
315 | gdb_test "whatis i" "type = int" | |
316 | gdb_test "p sizeof(i)" " = 4" | |
317 | gdb_test "print i" " = -1" | |
318 | gdb_test "whatis i2" "type = int2" | |
319 | gdb_test "p sizeof(i2)" " = 8" | |
320 | gdb_test "print i2" " = \\{-1, -2\\}" | |
321 | if { ${opencl_version} >= 110 } { | |
322 | gdb_test "whatis i3" "type = int3" | |
323 | gdb_test "p sizeof(i3)" " = 16" | |
324 | gdb_test "print i3" " = \\{-1, -2, -3\\}" | |
325 | } | |
326 | gdb_test "whatis i4" "type = int4" | |
327 | gdb_test "p sizeof(i4)" " = 16" | |
328 | gdb_test "print i4" " = \\{-1, -2, -3, -4\\}" | |
329 | gdb_test "whatis i8" "type = int8" | |
330 | gdb_test "p sizeof(i8)" " = 32" | |
331 | gdb_test "print i8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}" | |
332 | gdb_test "whatis i16" "type = int16" | |
333 | gdb_test "p sizeof(i16)" " = 64" | |
334 | gdb_test "print i16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}" | |
335 | ||
336 | gdb_test "whatis ui" "type = uint" | |
337 | gdb_test "p sizeof(ui)" " = 4" | |
338 | gdb_test "print ui" " = 1" | |
339 | gdb_test "whatis ui2" "type = uint2" | |
340 | gdb_test "p sizeof(ui2)" " = 8" | |
341 | gdb_test "print ui2" " = \\{1, 2\\}" | |
342 | if { ${opencl_version} >= 110 } { | |
343 | gdb_test "whatis ui3" "type = uint3" | |
344 | gdb_test "p sizeof(ui3)" " = 16" | |
345 | gdb_test "print ui3" " = \\{1, 2, 3\\}" | |
346 | } | |
347 | gdb_test "whatis ui4" "type = uint4" | |
348 | gdb_test "p sizeof(ui4)" " = 16" | |
349 | gdb_test "print ui4" " = \\{1, 2, 3, 4\\}" | |
350 | gdb_test "whatis ui8" "type = uint8" | |
351 | gdb_test "p sizeof(ui8)" " = 32" | |
352 | gdb_test "print ui8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
353 | gdb_test "whatis ui16" "type = uint16" | |
354 | gdb_test "p sizeof(ui16)" " = 64" | |
355 | gdb_test "print ui16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
356 | ||
357 | gdb_test "whatis l" "type = long" | |
358 | gdb_test "p sizeof(l)" " = 8" | |
359 | gdb_test "print l" " = -1" | |
360 | gdb_test "whatis l2" "type = long2" | |
361 | gdb_test "p sizeof(l2)" " = 16" | |
362 | gdb_test "print l2" " = \\{-1, -2\\}" | |
363 | if { ${opencl_version} >= 110 } { | |
364 | gdb_test "whatis l3" "type = long3" | |
365 | gdb_test "p sizeof(l3)" " = 32" | |
366 | gdb_test "print l3" " = \\{-1, -2, -3\\}" | |
367 | } | |
368 | gdb_test "whatis l4" "type = long4" | |
369 | gdb_test "p sizeof(l4)" " = 32" | |
370 | gdb_test "print l4" " = \\{-1, -2, -3, -4\\}" | |
371 | gdb_test "whatis l8" "type = long8" | |
372 | gdb_test "p sizeof(l8)" " = 64" | |
373 | gdb_test "print l8" " = \\{-1, -2, -3, -4, -5, -6, -7, -8\\}" | |
374 | gdb_test "whatis l16" "type = long16" | |
375 | gdb_test "p sizeof(l16)" " = 128" | |
376 | gdb_test "print l16" " = \\{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16\\}" | |
377 | ||
378 | gdb_test "whatis ul" "type = ulong" | |
379 | gdb_test "p sizeof(ul)" " = 8" | |
380 | gdb_test "print ul" " = 1" | |
381 | gdb_test "whatis ul2" "type = ulong2" | |
382 | gdb_test "p sizeof(ul2)" " = 16" | |
383 | gdb_test "print ul2" " = \\{1, 2\\}" | |
384 | if { ${opencl_version} >= 110 } { | |
385 | gdb_test "whatis ul3" "type = ulong3" | |
386 | gdb_test "p sizeof(ul3)" " = 32" | |
387 | gdb_test "print ul3" " = \\{1, 2, 3\\}" | |
388 | } | |
389 | gdb_test "whatis ul4" "type = ulong4" | |
390 | gdb_test "p sizeof(ul4)" " = 32" | |
391 | gdb_test "print ul4" " = \\{1, 2, 3, 4\\}" | |
392 | gdb_test "whatis ul8" "type = ulong8" | |
393 | gdb_test "p sizeof(ul8)" " = 64" | |
394 | gdb_test "print ul8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
395 | gdb_test "whatis ul16" "type = ulong16" | |
396 | gdb_test "p sizeof(ul16)" " = 128" | |
397 | gdb_test "print ul16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
398 | ||
399 | gdb_test "whatis ph" "type = half \\*" | |
400 | gdb_test "whatis *ph" "type = half" | |
401 | gdb_test "p sizeof(*ph)" " = 2" | |
402 | ||
403 | if { ${have_cl_khr_fp16} } { | |
404 | gdb_test "whatis h" "type = half" | |
405 | gdb_test "p sizeof(h)" " = 2" | |
406 | gdb_test "print h" " = 1" | |
407 | gdb_test "whatis h2" "type = half2" | |
408 | gdb_test "p sizeof(h2)" " = 4" | |
409 | gdb_test "print h2" " = \\{1, 2\\}" | |
410 | if { ${opencl_version} >= 110 } { | |
411 | gdb_test "whatis h3" "type = half3" | |
412 | gdb_test "p sizeof(h3)" " = 8" | |
413 | gdb_test "print h3" " = \\{1, 2, 3\\}" | |
414 | } | |
415 | gdb_test "whatis h4" "type = half4" | |
416 | gdb_test "p sizeof(h4)" " = 8" | |
417 | gdb_test "print h4" " = \\{1, 2, 3, 4\\}" | |
418 | gdb_test "whatis h8" "type = half8" | |
419 | gdb_test "p sizeof(h8)" " = 16" | |
420 | gdb_test "print h8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
421 | gdb_test "whatis h16" "type = half16" | |
422 | gdb_test "p sizeof(h16)" " = 16" | |
423 | gdb_test "print h16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
424 | } | |
425 | ||
426 | gdb_test "whatis f" "type = float" | |
427 | gdb_test "p sizeof(f)" " = 4" | |
428 | gdb_test "print f" " = 1" | |
429 | gdb_test "whatis f2" "type = float2" | |
430 | gdb_test "p sizeof(f2)" " = 8" | |
431 | gdb_test "print f2" " = \\{1, 2\\}" | |
432 | if { ${opencl_version} >= 110 } { | |
433 | gdb_test "whatis f3" "type = float3" | |
434 | gdb_test "p sizeof(f3)" " = 16" | |
435 | gdb_test "print f3" " = \\{1, 2, 3\\}" | |
436 | } | |
437 | gdb_test "whatis f4" "type = float4" | |
438 | gdb_test "p sizeof(f4)" " = 16" | |
439 | gdb_test "print f4" " = \\{1, 2, 3, 4\\}" | |
440 | gdb_test "whatis f8" "type = float8" | |
441 | gdb_test "p sizeof(f8)" " = 32" | |
442 | gdb_test "print f8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
443 | gdb_test "whatis f16" "type = float16" | |
444 | gdb_test "p sizeof(f16)" " = 64" | |
445 | gdb_test "print f16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
446 | ||
447 | if { ${have_cl_khr_fp64} } { | |
448 | gdb_test "whatis d" "type = double" | |
449 | gdb_test "p sizeof(d)" " = 8" | |
450 | gdb_test "print d" " = 1" | |
451 | gdb_test "whatis d2" "type = double2" | |
452 | gdb_test "p sizeof(d2)" " = 16" | |
453 | gdb_test "print d2" " = \\{1, 2\\}" | |
454 | if { ${opencl_version} >= 110 } { | |
455 | gdb_test "whatis d3" "type = double3" | |
456 | gdb_test "p sizeof(d3)" " = 32" | |
457 | gdb_test "print d3" " = \\{1, 2, 3\\}" | |
458 | } | |
459 | gdb_test "whatis d4" "type = double4" | |
460 | gdb_test "p sizeof(d4)" " = 32" | |
461 | gdb_test "print d4" " = \\{1, 2, 3, 4\\}" | |
462 | gdb_test "whatis d8" "type = double8" | |
463 | gdb_test "p sizeof(d8)" " = 64" | |
464 | gdb_test "print d8" " = \\{1, 2, 3, 4, 5, 6, 7, 8\\}" | |
465 | gdb_test "whatis d16" "type = double16" | |
466 | gdb_test "p sizeof(d16)" " = 128" | |
467 | gdb_test "print d16" " = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16\\}" | |
468 | } | |
469 | ||
470 | # Delete the OpenCL program source | |
471 | remote_file target delete ${clprogram} |