DPC++ Runtime
Runtime libraries for oneAPI DPC++
imf_fp_conversions.hpp
Go to the documentation of this file.
1 //==--------- imf_fp_conversions.hpp - floating point conversions ----------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // APIs for floating point conversions
9 //===----------------------------------------------------------------------===//
10 
11 #pragma once
13 #include <sycl/half_type.hpp>
14 
15 extern "C" {
16 int __imf_float2int_rd(float);
17 int __imf_float2int_rn(float);
18 int __imf_float2int_ru(float);
19 int __imf_float2int_rz(float);
20 unsigned int __imf_float2uint_rd(float);
21 unsigned int __imf_float2uint_rn(float);
22 unsigned int __imf_float2uint_ru(float);
23 unsigned int __imf_float2uint_rz(float);
24 long long int __imf_float2ll_rd(float);
25 long long int __imf_float2ll_rn(float);
26 long long int __imf_float2ll_ru(float);
27 long long int __imf_float2ll_rz(float);
28 unsigned long long int __imf_float2ull_rd(float);
29 unsigned long long int __imf_float2ull_rn(float);
30 unsigned long long int __imf_float2ull_ru(float);
31 unsigned long long int __imf_float2ull_rz(float);
32 int __imf_float_as_int(float);
33 unsigned int __imf_float_as_uint(float);
34 float __imf_int2float_rd(int);
35 float __imf_int2float_rn(int);
36 float __imf_int2float_ru(int);
37 float __imf_int2float_rz(int);
38 float __imf_int_as_float(int);
39 float __imf_ll2float_rd(long long int);
40 float __imf_ll2float_rn(long long int);
41 float __imf_ll2float_ru(long long int);
42 float __imf_ll2float_rz(long long int);
43 float __imf_uint2float_rd(unsigned int);
44 float __imf_uint2float_rn(unsigned int);
45 float __imf_uint2float_ru(unsigned int);
46 float __imf_uint2float_rz(unsigned int);
47 float __imf_uint_as_float(unsigned int);
48 float __imf_ull2float_rd(unsigned long long int);
49 float __imf_ull2float_rn(unsigned long long int);
50 float __imf_ull2float_ru(unsigned long long int);
51 float __imf_ull2float_rz(unsigned long long int);
110 unsigned short __imf_bfloat162ushort_rd(uint16_t);
111 unsigned short __imf_bfloat162ushort_rn(uint16_t);
112 unsigned short __imf_bfloat162ushort_ru(uint16_t);
113 unsigned short __imf_bfloat162ushort_rz(uint16_t);
114 short __imf_bfloat162short_rd(uint16_t);
115 short __imf_bfloat162short_rn(uint16_t);
116 short __imf_bfloat162short_ru(uint16_t);
117 short __imf_bfloat162short_rz(uint16_t);
118 unsigned int __imf_bfloat162uint_rd(uint16_t);
119 unsigned int __imf_bfloat162uint_rn(uint16_t);
120 unsigned int __imf_bfloat162uint_ru(uint16_t);
121 unsigned int __imf_bfloat162uint_rz(uint16_t);
122 int __imf_bfloat162int_rd(uint16_t);
123 int __imf_bfloat162int_rn(uint16_t);
124 int __imf_bfloat162int_ru(uint16_t);
125 int __imf_bfloat162int_rz(uint16_t);
126 unsigned long long __imf_bfloat162ull_rd(uint16_t);
127 unsigned long long __imf_bfloat162ull_rn(uint16_t);
128 unsigned long long __imf_bfloat162ull_ru(uint16_t);
129 unsigned long long __imf_bfloat162ull_rz(uint16_t);
130 long long __imf_bfloat162ll_rd(uint16_t);
131 long long __imf_bfloat162ll_rn(uint16_t);
132 long long __imf_bfloat162ll_ru(uint16_t);
133 long long __imf_bfloat162ll_rz(uint16_t);
134 float __imf_bfloat162float(uint16_t);
135 uint16_t __imf_float2bfloat16(float);
136 uint16_t __imf_float2bfloat16_rd(float);
137 uint16_t __imf_float2bfloat16_rn(float);
138 uint16_t __imf_float2bfloat16_ru(float);
139 uint16_t __imf_float2bfloat16_rz(float);
140 uint16_t __imf_ushort2bfloat16_rd(unsigned short);
141 uint16_t __imf_ushort2bfloat16_rn(unsigned short);
142 uint16_t __imf_ushort2bfloat16_ru(unsigned short);
143 uint16_t __imf_ushort2bfloat16_rz(unsigned short);
144 uint16_t __imf_uint2bfloat16_rd(unsigned int);
145 uint16_t __imf_uint2bfloat16_rn(unsigned int);
146 uint16_t __imf_uint2bfloat16_ru(unsigned int);
147 uint16_t __imf_uint2bfloat16_rz(unsigned int);
148 uint16_t __imf_ull2bfloat16_rd(unsigned long long);
149 uint16_t __imf_ull2bfloat16_rn(unsigned long long);
150 uint16_t __imf_ull2bfloat16_ru(unsigned long long);
151 uint16_t __imf_ull2bfloat16_rz(unsigned long long);
152 uint16_t __imf_short2bfloat16_rd(short);
153 uint16_t __imf_short2bfloat16_rn(short);
154 uint16_t __imf_short2bfloat16_ru(short);
155 uint16_t __imf_short2bfloat16_rz(short);
156 uint16_t __imf_int2bfloat16_rd(int);
157 uint16_t __imf_int2bfloat16_rn(int);
158 uint16_t __imf_int2bfloat16_ru(int);
159 uint16_t __imf_int2bfloat16_rz(int);
160 uint16_t __imf_ll2bfloat16_rd(long long);
161 uint16_t __imf_ll2bfloat16_rn(long long);
162 uint16_t __imf_ll2bfloat16_ru(long long);
163 uint16_t __imf_ll2bfloat16_rz(long long);
164 uint16_t __imf_double2bfloat16(double);
165 short __imf_bfloat16_as_short(uint16_t);
166 unsigned short __imf_bfloat16_as_ushort(uint16_t);
167 uint16_t __imf_short_as_bfloat16(short);
168 uint16_t __imf_ushort_as_bfloat16(unsigned short);
169 };
170 
171 namespace sycl {
172 inline namespace _V1 {
173 namespace ext::intel::math {
174 
175 template <typename To = int, typename From = float> To float2int_rd(From x) {
176  return __imf_float2int_rd(x);
177 }
178 
179 template <typename To = int, typename From = float> To float2int_rn(From x) {
180  return __imf_float2int_rn(x);
181 }
182 
183 template <typename To = int, typename From = float> To float2int_ru(From x) {
184  return __imf_float2int_ru(x);
185 }
186 
187 template <typename To = int, typename From = float> To float2int_rz(From x) {
188  return __imf_float2int_rz(x);
189 }
190 
191 template <typename To = unsigned int, typename From = float>
192 To float2uint_rd(From x) {
193  return __imf_float2uint_rd(x);
194 }
195 
196 template <typename To = unsigned int, typename From = float>
197 To float2uint_rn(From x) {
198  return __imf_float2uint_rn(x);
199 }
200 
201 template <typename To = unsigned int, typename From = float>
202 To float2uint_ru(From x) {
203  return __imf_float2uint_ru(x);
204 }
205 
206 template <typename To = unsigned int, typename From = float>
207 To float2uint_rz(From x) {
208  return __imf_float2uint_rz(x);
209 }
210 
211 template <typename To = long long, typename From = float>
212 To float2ll_rd(From x) {
213  return __imf_float2ll_rd(x);
214 }
215 
216 template <typename To = long long, typename From = float>
217 To float2ll_rn(From x) {
218  return __imf_float2ll_rn(x);
219 }
220 
221 template <typename To = long long, typename From = float>
222 To float2ll_ru(From x) {
223  return __imf_float2ll_ru(x);
224 }
225 
226 template <typename To = long long, typename From = float>
227 To float2ll_rz(From x) {
228  return __imf_float2ll_rz(x);
229 }
230 
231 template <typename To = unsigned long long, typename From = float>
232 To float2ull_rd(From x) {
233  return __imf_float2ull_rd(x);
234 }
235 
236 template <typename To = unsigned long long, typename From = float>
237 To float2ull_rn(From x) {
238  return __imf_float2ull_rn(x);
239 }
240 
241 template <typename To = unsigned long long, typename From = float>
242 To float2ull_ru(From x) {
243  return __imf_float2ull_ru(x);
244 }
245 
246 template <typename To = unsigned long long, typename From = float>
247 To float2ull_rz(From x) {
248  return __imf_float2ull_rz(x);
249 }
250 
251 template <typename To = float, typename From = long long>
252 To ll2float_rd(From x) {
253  return __imf_ll2float_rd(x);
254 }
255 
256 template <typename To = float, typename From = long long>
257 To ll2float_rn(From x) {
258  return __imf_ll2float_rn(x);
259 }
260 
261 template <typename To = float, typename From = long long>
262 To ll2float_ru(From x) {
263  return __imf_ll2float_ru(x);
264 }
265 
266 template <typename To = float, typename From = long long>
267 To ll2float_rz(From x) {
268  return __imf_ll2float_rz(x);
269 }
270 
271 template <typename To = float, typename From = unsigned long long>
272 To ull2float_rd(From x) {
273  return __imf_ull2float_rd(x);
274 }
275 
276 template <typename To = float, typename From = unsigned long long>
277 To ull2float_rn(From x) {
278  return __imf_ull2float_rn(x);
279 }
280 
281 template <typename To = float, typename From = unsigned long long>
282 To ull2float_ru(From x) {
283  return __imf_ull2float_ru(x);
284 }
285 
286 template <typename To = float, typename From = unsigned long long>
287 To ull2float_rz(From x) {
288  return __imf_ull2float_rz(x);
289 }
290 
291 template <typename To = float, typename From = int> To int2float_rd(From x) {
292  return __imf_int2float_rd(x);
293 }
294 
295 template <typename To = float, typename From = int> To int2float_rn(From x) {
296  return __imf_int2float_rn(x);
297 }
298 
299 template <typename To = float, typename From = int> To int2float_ru(From x) {
300  return __imf_int2float_ru(x);
301 }
302 
303 template <typename To = float, typename From = int> To int2float_rz(From x) {
304  return __imf_int2float_rz(x);
305 }
306 
307 template <typename To = float, typename From = unsigned int>
308 To uint2float_rd(From x) {
309  return __imf_uint2float_rd(x);
310 }
311 
312 template <typename To = float, typename From = unsigned int>
313 To uint2float_rn(From x) {
314  return __imf_uint2float_rn(x);
315 }
316 
317 template <typename To = float, typename From = unsigned int>
318 To uint2float_ru(From x) {
319  return __imf_uint2float_ru(x);
320 }
321 
322 template <typename To = float, typename From = unsigned int>
323 To uint2float_rz(From x) {
324  return __imf_uint2float_rz(x);
325 }
326 
327 template <typename To = int, typename From = float> To float_as_int(From x) {
328  return __imf_float_as_int(x);
329 }
330 
331 template <typename To = unsigned int, typename From = float>
332 To float_as_uint(From x) {
333  return __imf_float_as_uint(x);
334 }
335 
336 template <typename To = float, typename From = int> To int_as_float(From x) {
337  return __imf_int_as_float(x);
338 }
339 
340 template <typename To = float, typename From = unsigned int>
341 To uint_as_float(From x) {
342  return __imf_uint_as_float(x);
343 }
344 
345 template <typename To = float, typename From = sycl::half>
346 To half2float(From x) {
347  return __imf_half2float(__builtin_bit_cast(_iml_half_internal, x));
348 }
349 
350 template <typename To = sycl::half, typename From = float>
351 To float2half_rn(From x) {
352  return __builtin_bit_cast(sycl::half, __imf_float2half_rn(x));
353 }
354 
355 template <typename To = sycl::half, typename From = float>
356 To float2half_rd(From x) {
357  return __builtin_bit_cast(sycl::half, __imf_float2half_rd(x));
358 }
359 
360 template <typename To = sycl::half, typename From = float>
361 To float2half_ru(From x) {
362  return __builtin_bit_cast(sycl::half, __imf_float2half_ru(x));
363 }
364 
365 template <typename To = sycl::half, typename From = float>
366 To float2half_rz(From x) {
367  return __builtin_bit_cast(sycl::half, __imf_float2half_rz(x));
368 }
369 
370 template <typename To = int, typename From = sycl::half>
371 To half2int_rn(From x) {
372  return __imf_half2int_rn(__builtin_bit_cast(_iml_half_internal, x));
373 }
374 
375 template <typename To = int, typename From = sycl::half>
376 To half2int_rd(From x) {
377  return __imf_half2int_rd(__builtin_bit_cast(_iml_half_internal, x));
378 }
379 
380 template <typename To = int, typename From = sycl::half>
381 To half2int_ru(From x) {
382  return __imf_half2int_ru(__builtin_bit_cast(_iml_half_internal, x));
383 }
384 
385 template <typename To = int, typename From = sycl::half>
386 To half2int_rz(From x) {
387  return __imf_half2int_rz(__builtin_bit_cast(_iml_half_internal, x));
388 }
389 
390 template <typename To = long long, typename From = sycl::half>
391 To half2ll_rn(From x) {
392  return __imf_half2ll_rn(__builtin_bit_cast(_iml_half_internal, x));
393 }
394 
395 template <typename To = long long, typename From = sycl::half>
396 To half2ll_rd(From x) {
397  return __imf_half2ll_rd(__builtin_bit_cast(_iml_half_internal, x));
398 }
399 
400 template <typename To = long long, typename From = sycl::half>
401 To half2ll_ru(From x) {
402  return __imf_half2ll_ru(__builtin_bit_cast(_iml_half_internal, x));
403 }
404 
405 template <typename To = long long, typename From = sycl::half>
406 To half2ll_rz(From x) {
407  return __imf_half2ll_rz(__builtin_bit_cast(_iml_half_internal, x));
408 }
409 
410 template <typename To = short, typename From = sycl::half>
411 To half2short_rn(From x) {
412  return __imf_half2short_rn(__builtin_bit_cast(_iml_half_internal, x));
413 }
414 
415 template <typename To = short, typename From = sycl::half>
416 To half2short_rd(From x) {
417  return __imf_half2short_rd(__builtin_bit_cast(_iml_half_internal, x));
418 }
419 
420 template <typename To = short, typename From = sycl::half>
421 To half2short_ru(From x) {
422  return __imf_half2short_ru(__builtin_bit_cast(_iml_half_internal, x));
423 }
424 
425 template <typename To = short, typename From = sycl::half>
426 To half2short_rz(From x) {
427  return __imf_half2short_rz(__builtin_bit_cast(_iml_half_internal, x));
428 }
429 
430 template <typename To = unsigned short, typename From = sycl::half>
431 To half2ushort_rn(From x) {
432  return __imf_half2ushort_rn(__builtin_bit_cast(_iml_half_internal, x));
433 }
434 
435 template <typename To = unsigned short, typename From = sycl::half>
436 To half2ushort_rd(From x) {
437  return __imf_half2ushort_rd(__builtin_bit_cast(_iml_half_internal, x));
438 }
439 
440 template <typename To = unsigned short, typename From = sycl::half>
441 To half2ushort_ru(From x) {
442  return __imf_half2ushort_ru(__builtin_bit_cast(_iml_half_internal, x));
443 }
444 
445 template <typename To = unsigned short, typename From = sycl::half>
446 To half2ushort_rz(From x) {
447  return __imf_half2ushort_rz(__builtin_bit_cast(_iml_half_internal, x));
448 }
449 
450 template <typename To = unsigned int, typename From = sycl::half>
451 To half2uint_rn(From x) {
452  return __imf_half2uint_rn(__builtin_bit_cast(_iml_half_internal, x));
453 }
454 
455 template <typename To = unsigned int, typename From = sycl::half>
456 To half2uint_rd(From x) {
457  return __imf_half2uint_rd(__builtin_bit_cast(_iml_half_internal, x));
458 }
459 
460 template <typename To = unsigned int, typename From = sycl::half>
461 To half2uint_ru(From x) {
462  return __imf_half2uint_ru(__builtin_bit_cast(_iml_half_internal, x));
463 }
464 
465 template <typename To = unsigned int, typename From = sycl::half>
466 To half2uint_rz(From x) {
467  return __imf_half2uint_rz(__builtin_bit_cast(_iml_half_internal, x));
468 }
469 
470 template <typename To = unsigned long long, typename From = sycl::half>
471 To half2ull_rn(From x) {
472  return __imf_half2ull_rn(__builtin_bit_cast(_iml_half_internal, x));
473 }
474 
475 template <typename To = unsigned long long, typename From = sycl::half>
476 To half2ull_rd(From x) {
477  return __imf_half2ull_rd(__builtin_bit_cast(_iml_half_internal, x));
478 }
479 
480 template <typename To = unsigned long long, typename From = sycl::half>
481 To half2ull_ru(From x) {
482  return __imf_half2ull_ru(__builtin_bit_cast(_iml_half_internal, x));
483 }
484 
485 template <typename To = unsigned long long, typename From = sycl::half>
486 To half2ull_rz(From x) {
487  return __imf_half2ull_rz(__builtin_bit_cast(_iml_half_internal, x));
488 }
489 
490 template <typename To = sycl::half, typename From = int>
491 To int2half_rn(From x) {
492  return __builtin_bit_cast(sycl::half, __imf_int2half_rn(x));
493 }
494 
495 template <typename To = sycl::half, typename From = int>
496 To int2half_rd(From x) {
497  return __builtin_bit_cast(sycl::half, __imf_int2half_rd(x));
498 }
499 
500 template <typename To = sycl::half, typename From = int>
501 To int2half_ru(From x) {
502  return __builtin_bit_cast(sycl::half, __imf_int2half_ru(x));
503 }
504 
505 template <typename To = sycl::half, typename From = int>
506 To int2half_rz(From x) {
507  return __builtin_bit_cast(sycl::half, __imf_int2half_rz(x));
508 }
509 
510 template <typename To = sycl::half, typename From = short>
511 To short2half_rn(From x) {
512  return __builtin_bit_cast(sycl::half, __imf_short2half_rn(x));
513 }
514 
515 template <typename To = sycl::half, typename From = short>
516 To short2half_rd(From x) {
517  return __builtin_bit_cast(sycl::half, __imf_short2half_rd(x));
518 }
519 
520 template <typename To = sycl::half, typename From = short>
521 To short2half_ru(From x) {
522  return __builtin_bit_cast(sycl::half, __imf_short2half_ru(x));
523 }
524 
525 template <typename To = sycl::half, typename From = short>
526 To short2half_rz(From x) {
527  return __builtin_bit_cast(sycl::half, __imf_short2half_rz(x));
528 }
529 
530 template <typename To = sycl::half, typename From = long long>
531 To ll2half_rn(From x) {
532  return __builtin_bit_cast(sycl::half, __imf_ll2half_rn(x));
533 }
534 
535 template <typename To = sycl::half, typename From = long long>
536 To ll2half_rd(From x) {
537  return __builtin_bit_cast(sycl::half, __imf_ll2half_rd(x));
538 }
539 
540 template <typename To = sycl::half, typename From = long long>
541 To ll2half_ru(From x) {
542  return __builtin_bit_cast(sycl::half, __imf_ll2half_ru(x));
543 }
544 
545 template <typename To = sycl::half, typename From = long long>
546 To ll2half_rz(From x) {
547  return __builtin_bit_cast(sycl::half, __imf_ll2half_rz(x));
548 }
549 
550 template <typename To = sycl::half, typename From = unsigned short>
551 To ushort2half_rn(From x) {
552  return __builtin_bit_cast(sycl::half, __imf_ushort2half_rn(x));
553 }
554 
555 template <typename To = sycl::half, typename From = unsigned short>
556 To ushort2half_rd(From x) {
557  return __builtin_bit_cast(sycl::half, __imf_ushort2half_rd(x));
558 }
559 
560 template <typename To = sycl::half, typename From = unsigned short>
561 To ushort2half_ru(From x) {
562  return __builtin_bit_cast(sycl::half, __imf_ushort2half_ru(x));
563 }
564 
565 template <typename To = sycl::half, typename From = unsigned short>
566 To ushort2half_rz(From x) {
567  return __builtin_bit_cast(sycl::half, __imf_ushort2half_rz(x));
568 }
569 
570 template <typename To = sycl::half, typename From = unsigned int>
571 To uint2half_rn(From x) {
572  return __builtin_bit_cast(sycl::half, __imf_uint2half_rn(x));
573 }
574 
575 template <typename To = sycl::half, typename From = unsigned int>
576 To uint2half_rd(From x) {
577  return __builtin_bit_cast(sycl::half, __imf_uint2half_rd(x));
578 }
579 
580 template <typename To = sycl::half, typename From = unsigned int>
581 To uint2half_ru(From x) {
582  return __builtin_bit_cast(sycl::half, __imf_uint2half_ru(x));
583 }
584 
585 template <typename To = sycl::half, typename From = unsigned int>
586 To uint2half_rz(From x) {
587  return __builtin_bit_cast(sycl::half, __imf_uint2half_rz(x));
588 }
589 
590 template <typename To = sycl::half, typename From = unsigned long long>
591 To ull2half_rn(From x) {
592  return __builtin_bit_cast(sycl::half, __imf_ull2half_rn(x));
593 }
594 
595 template <typename To = sycl::half, typename From = unsigned long long>
596 To ull2half_rd(From x) {
597  return __builtin_bit_cast(sycl::half, __imf_ull2half_rd(x));
598 }
599 
600 template <typename To = sycl::half, typename From = unsigned long long>
601 To ull2half_ru(From x) {
602  return __builtin_bit_cast(sycl::half, __imf_ull2half_ru(x));
603 }
604 
605 template <typename To = sycl::half, typename From = unsigned long long>
606 To ull2half_rz(From x) {
607  return __builtin_bit_cast(sycl::half, __imf_ull2half_rz(x));
608 }
609 
610 template <typename To = unsigned short,
611  typename From = sycl::ext::oneapi::bfloat16>
612 To bfloat16_as_ushort(From x) {
613  return __imf_bfloat16_as_ushort(__builtin_bit_cast(uint16_t, x));
614 }
615 
616 template <typename To = short, typename From = sycl::ext::oneapi::bfloat16>
617 To bfloat16_as_short(From x) {
618  return __imf_bfloat16_as_short(__builtin_bit_cast(uint16_t, x));
619 }
620 
621 template <typename To = sycl::ext::oneapi::bfloat16,
622  typename From = unsigned short>
623 To ushort_as_bfloat16(From x) {
624  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
626 }
627 
628 template <typename To = sycl::ext::oneapi::bfloat16, typename From = short>
629 To short_as_bfloat16(From x) {
630  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
632 }
633 
634 template <typename To = float, typename From = sycl::ext::oneapi::bfloat16>
635 To bfloat162float(From x) {
636  return __imf_bfloat162float(__builtin_bit_cast(uint16_t, x));
637 }
638 
639 template <typename To = sycl::ext::oneapi::bfloat16, typename From = float>
640 To float2bfloat16(From x) {
641  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
643 }
644 
645 template <typename To = sycl::ext::oneapi::bfloat16, typename From = float>
646 To float2bfloat16_rd(From x) {
647  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
649 }
650 
651 template <typename To = sycl::ext::oneapi::bfloat16, typename From = float>
652 To float2bfloat16_rn(From x) {
653  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
655 }
656 
657 template <typename To = sycl::ext::oneapi::bfloat16, typename From = float>
658 To float2bfloat16_ru(From x) {
659  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
661 }
662 
663 template <typename To = sycl::ext::oneapi::bfloat16, typename From = float>
664 To float2bfloat16_rz(From x) {
665  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
667 }
668 
669 template <typename To = sycl::ext::oneapi::bfloat16,
670  typename From = unsigned short>
671 To ushort2bfloat16_rd(From x) {
672  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
674 }
675 
676 template <typename To = sycl::ext::oneapi::bfloat16,
677  typename From = unsigned short>
678 To ushort2bfloat16_rn(From x) {
679  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
681 }
682 
683 template <typename To = sycl::ext::oneapi::bfloat16,
684  typename From = unsigned short>
685 To ushort2bfloat16_ru(From x) {
686  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
688 }
689 
690 template <typename To = sycl::ext::oneapi::bfloat16,
691  typename From = unsigned short>
692 To ushort2bfloat16_rz(From x) {
693  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
695 }
696 
697 template <typename To = sycl::ext::oneapi::bfloat16,
698  typename From = unsigned int>
699 To uint2bfloat16_rd(From x) {
700  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
702 }
703 
704 template <typename To = sycl::ext::oneapi::bfloat16,
705  typename From = unsigned int>
706 To uint2bfloat16_rn(From x) {
707  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
709 }
710 
711 template <typename To = sycl::ext::oneapi::bfloat16,
712  typename From = unsigned int>
713 To uint2bfloat16_ru(From x) {
714  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
716 }
717 
718 template <typename To = sycl::ext::oneapi::bfloat16,
719  typename From = unsigned int>
720 To uint2bfloat16_rz(From x) {
721  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
723 }
724 
725 template <typename To = sycl::ext::oneapi::bfloat16,
726  typename From = unsigned long long>
727 To ull2bfloat16_rd(From x) {
728  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
730 }
731 
732 template <typename To = sycl::ext::oneapi::bfloat16,
733  typename From = unsigned long long>
734 To ull2bfloat16_rn(From x) {
735  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
737 }
738 
739 template <typename To = sycl::ext::oneapi::bfloat16,
740  typename From = unsigned long long>
741 To ull2bfloat16_ru(From x) {
742  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
744 }
745 
746 template <typename To = sycl::ext::oneapi::bfloat16,
747  typename From = unsigned long long>
748 To ull2bfloat16_rz(From x) {
749  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
751 }
752 
753 template <typename To = sycl::ext::oneapi::bfloat16, typename From = short>
754 To short2bfloat16_rd(From x) {
755  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
757 }
758 
759 template <typename To = sycl::ext::oneapi::bfloat16, typename From = short>
760 To short2bfloat16_rn(From x) {
761  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
763 }
764 
765 template <typename To = sycl::ext::oneapi::bfloat16, typename From = short>
766 To short2bfloat16_ru(From x) {
767  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
769 }
770 
771 template <typename To = sycl::ext::oneapi::bfloat16, typename From = short>
772 To short2bfloat16_rz(From x) {
773  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
775 }
776 
777 template <typename To = sycl::ext::oneapi::bfloat16, typename From = int>
778 To int2bfloat16_rd(From x) {
779  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
781 }
782 
783 template <typename To = sycl::ext::oneapi::bfloat16, typename From = int>
784 To int2bfloat16_rn(From x) {
785  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
787 }
788 
789 template <typename To = sycl::ext::oneapi::bfloat16, typename From = int>
790 To int2bfloat16_ru(From x) {
791  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
793 }
794 
795 template <typename To = sycl::ext::oneapi::bfloat16, typename From = int>
796 To int2bfloat16_rz(From x) {
797  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
799 }
800 
801 template <typename To = sycl::ext::oneapi::bfloat16, typename From = long long>
802 To ll2bfloat16_rd(From x) {
803  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
805 }
806 
807 template <typename To = sycl::ext::oneapi::bfloat16, typename From = long long>
808 To ll2bfloat16_rn(From x) {
809  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
811 }
812 
813 template <typename To = sycl::ext::oneapi::bfloat16, typename From = long long>
814 To ll2bfloat16_ru(From x) {
815  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
817 }
818 
819 template <typename To = sycl::ext::oneapi::bfloat16, typename From = long long>
820 To ll2bfloat16_rz(From x) {
821  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
823 }
824 
825 template <typename To = sycl::ext::oneapi::bfloat16, typename From = double>
826 To double2bfloat16(From x) {
827  return __builtin_bit_cast(sycl::ext::oneapi::bfloat16,
829 }
830 
831 template <typename To = unsigned int,
832  typename From = sycl::ext::oneapi::bfloat16>
833 To bfloat162uint_rd(From x) {
834  return __imf_bfloat162uint_rd(__builtin_bit_cast(uint16_t, x));
835 }
836 
837 template <typename To = unsigned int,
838  typename From = sycl::ext::oneapi::bfloat16>
839 To bfloat162uint_rn(From x) {
840  return __imf_bfloat162uint_rn(__builtin_bit_cast(uint16_t, x));
841 }
842 
843 template <typename To = unsigned int,
844  typename From = sycl::ext::oneapi::bfloat16>
845 To bfloat162uint_ru(From x) {
846  return __imf_bfloat162uint_ru(__builtin_bit_cast(uint16_t, x));
847 }
848 
849 template <typename To = unsigned int,
850  typename From = sycl::ext::oneapi::bfloat16>
851 To bfloat162uint_rz(From x) {
852  return __imf_bfloat162uint_rz(__builtin_bit_cast(uint16_t, x));
853 }
854 
855 template <typename To = int, typename From = sycl::ext::oneapi::bfloat16>
856 To bfloat162int_rd(From x) {
857  return __imf_bfloat162int_rd(__builtin_bit_cast(uint16_t, x));
858 }
859 
860 template <typename To = int, typename From = sycl::ext::oneapi::bfloat16>
861 To bfloat162int_rn(From x) {
862  return __imf_bfloat162int_rn(__builtin_bit_cast(uint16_t, x));
863 }
864 
865 template <typename To = int, typename From = sycl::ext::oneapi::bfloat16>
866 To bfloat162int_ru(From x) {
867  return __imf_bfloat162int_ru(__builtin_bit_cast(uint16_t, x));
868 }
869 
870 template <typename To = int, typename From = sycl::ext::oneapi::bfloat16>
871 To bfloat162int_rz(From x) {
872  return __imf_bfloat162int_rz(__builtin_bit_cast(uint16_t, x));
873 }
874 
875 template <typename To = unsigned short,
876  typename From = sycl::ext::oneapi::bfloat16>
877 To bfloat162ushort_rd(From x) {
878  return __imf_bfloat162ushort_rd(__builtin_bit_cast(uint16_t, x));
879 }
880 
881 template <typename To = unsigned short,
882  typename From = sycl::ext::oneapi::bfloat16>
883 To bfloat162ushort_rn(From x) {
884  return __imf_bfloat162ushort_rn(__builtin_bit_cast(uint16_t, x));
885 }
886 
887 template <typename To = unsigned short,
888  typename From = sycl::ext::oneapi::bfloat16>
889 To bfloat162ushort_ru(From x) {
890  return __imf_bfloat162ushort_ru(__builtin_bit_cast(uint16_t, x));
891 }
892 
893 template <typename To = unsigned short,
894  typename From = sycl::ext::oneapi::bfloat16>
895 To bfloat162ushort_rz(From x) {
896  return __imf_bfloat162ushort_rz(__builtin_bit_cast(uint16_t, x));
897 }
898 
899 template <typename To = short, typename From = sycl::ext::oneapi::bfloat16>
900 To bfloat162short_rd(From x) {
901  return __imf_bfloat162short_rd(__builtin_bit_cast(uint16_t, x));
902 }
903 
904 template <typename To = short, typename From = sycl::ext::oneapi::bfloat16>
905 To bfloat162short_rn(From x) {
906  return __imf_bfloat162short_rn(__builtin_bit_cast(uint16_t, x));
907 }
908 
909 template <typename To = short, typename From = sycl::ext::oneapi::bfloat16>
910 To bfloat162short_ru(From x) {
911  return __imf_bfloat162short_ru(__builtin_bit_cast(uint16_t, x));
912 }
913 
914 template <typename To = short, typename From = sycl::ext::oneapi::bfloat16>
915 To bfloat162short_rz(From x) {
916  return __imf_bfloat162short_rz(__builtin_bit_cast(uint16_t, x));
917 }
918 
919 template <typename To = long long, typename From = sycl::ext::oneapi::bfloat16>
920 To bfloat162ll_rd(From x) {
921  return __imf_bfloat162ll_rd(__builtin_bit_cast(uint16_t, x));
922 }
923 
924 template <typename To = long long, typename From = sycl::ext::oneapi::bfloat16>
925 To bfloat162ll_rn(From x) {
926  return __imf_bfloat162ll_rn(__builtin_bit_cast(uint16_t, x));
927 }
928 
929 template <typename To = long long, typename From = sycl::ext::oneapi::bfloat16>
930 To bfloat162ll_ru(From x) {
931  return __imf_bfloat162ll_ru(__builtin_bit_cast(uint16_t, x));
932 }
933 
934 template <typename To = long long, typename From = sycl::ext::oneapi::bfloat16>
935 To bfloat162ll_rz(From x) {
936  return __imf_bfloat162ll_rz(__builtin_bit_cast(uint16_t, x));
937 }
938 
939 template <typename To = unsigned long long,
940  typename From = sycl::ext::oneapi::bfloat16>
941 To bfloat162ull_rd(From x) {
942  return __imf_bfloat162ull_rd(__builtin_bit_cast(uint16_t, x));
943 }
944 
945 template <typename To = unsigned long long,
946  typename From = sycl::ext::oneapi::bfloat16>
947 To bfloat162ull_rn(From x) {
948  return __imf_bfloat162ull_rn(__builtin_bit_cast(uint16_t, x));
949 }
950 
951 template <typename To = unsigned long long,
952  typename From = sycl::ext::oneapi::bfloat16>
953 To bfloat162ull_ru(From x) {
954  return __imf_bfloat162ull_ru(__builtin_bit_cast(uint16_t, x));
955 }
956 
957 template <typename To = unsigned long long,
958  typename From = sycl::ext::oneapi::bfloat16>
959 To bfloat162ull_rz(From x) {
960  return __imf_bfloat162ull_rz(__builtin_bit_cast(uint16_t, x));
961 }
962 
963 } // namespace ext::intel::math
964 } // namespace _V1
965 } // namespace sycl
uint16_t _iml_half_internal
Definition: math.hpp:19
_iml_half_internal __imf_int2half_rn(int)
_iml_half_internal __imf_double2half(double)
float __imf_uint_as_float(unsigned int)
_iml_half_internal __imf_float2half_rd(float)
uint16_t __imf_short_as_bfloat16(short)
_iml_half_internal __imf_ull2half_ru(unsigned long long)
float __imf_ull2float_rn(unsigned long long int)
unsigned long long __imf_bfloat162ull_rz(uint16_t)
float __imf_ll2float_ru(long long int)
unsigned int __imf_half2uint_rz(_iml_half_internal)
float __imf_ull2float_rd(unsigned long long int)
unsigned short __imf_bfloat162ushort_rz(uint16_t)
uint16_t __imf_float2bfloat16_rd(float)
_iml_half_internal __imf_ushort_as_half(unsigned short)
_iml_half_internal __imf_ushort2half_rn(unsigned short)
unsigned short __imf_half2ushort_rn(_iml_half_internal)
uint16_t __imf_ull2bfloat16_rz(unsigned long long)
uint16_t __imf_ushort2bfloat16_rz(unsigned short)
short __imf_bfloat162short_rn(uint16_t)
uint16_t __imf_int2bfloat16_ru(int)
float __imf_int_as_float(int)
int __imf_float2int_rd(float)
uint16_t __imf_ushort2bfloat16_rn(unsigned short)
_iml_half_internal __imf_ushort2half_ru(unsigned short)
uint16_t __imf_ll2bfloat16_rd(long long)
unsigned int __imf_bfloat162uint_ru(uint16_t)
uint16_t __imf_float2bfloat16(float)
uint16_t __imf_short2bfloat16_rd(short)
unsigned long long __imf_bfloat162ull_rn(uint16_t)
float __imf_int2float_ru(int)
_iml_half_internal __imf_int2half_rz(int)
long long __imf_bfloat162ll_rz(uint16_t)
uint16_t __imf_int2bfloat16_rd(int)
uint16_t __imf_uint2bfloat16_rd(unsigned int)
long long __imf_half2ll_ru(_iml_half_internal)
uint16_t __imf_float2bfloat16_ru(float)
unsigned int __imf_half2uint_ru(_iml_half_internal)
int __imf_bfloat162int_ru(uint16_t)
short __imf_half2short_rn(_iml_half_internal)
_iml_half_internal __imf_uint2half_ru(unsigned int)
short __imf_half2short_ru(_iml_half_internal)
long long __imf_half2ll_rz(_iml_half_internal)
unsigned long long __imf_half2ull_ru(_iml_half_internal)
unsigned int __imf_bfloat162uint_rn(uint16_t)
_iml_half_internal __imf_ull2half_rn(unsigned long long)
unsigned int __imf_float2uint_rd(float)
unsigned short __imf_half2ushort_rd(_iml_half_internal)
long long __imf_bfloat162ll_rn(uint16_t)
float __imf_int2float_rz(int)
uint16_t __imf_ushort2bfloat16_ru(unsigned short)
int __imf_bfloat162int_rz(uint16_t)
unsigned long long __imf_bfloat162ull_ru(uint16_t)
float __imf_ll2float_rd(long long int)
_iml_half_internal __imf_ll2half_ru(long long)
long long __imf_half2ll_rn(_iml_half_internal)
unsigned short __imf_bfloat162ushort_rn(uint16_t)
short __imf_half_as_short(_iml_half_internal)
_iml_half_internal __imf_ushort2half_rd(unsigned short)
long long int __imf_float2ll_rn(float)
_iml_half_internal __imf_ull2half_rd(unsigned long long)
uint16_t __imf_float2bfloat16_rn(float)
uint16_t __imf_ll2bfloat16_rn(long long)
unsigned int __imf_float2uint_rn(float)
uint16_t __imf_ll2bfloat16_rz(long long)
int __imf_float2int_rn(float)
int __imf_bfloat162int_rd(uint16_t)
long long int __imf_float2ll_rz(float)
float __imf_ull2float_ru(unsigned long long int)
unsigned int __imf_float_as_uint(float)
unsigned short __imf_bfloat162ushort_ru(uint16_t)
unsigned int __imf_bfloat162uint_rd(uint16_t)
uint16_t __imf_int2bfloat16_rn(int)
int __imf_float_as_int(float)
uint16_t __imf_float2bfloat16_rz(float)
uint16_t __imf_ull2bfloat16_rd(unsigned long long)
_iml_half_internal __imf_float2half_rz(float)
short __imf_bfloat162short_ru(uint16_t)
_iml_half_internal __imf_ll2half_rz(long long)
uint16_t __imf_short2bfloat16_ru(short)
short __imf_half2short_rd(_iml_half_internal)
uint16_t __imf_int2bfloat16_rz(int)
float __imf_uint2float_ru(unsigned int)
uint16_t __imf_ull2bfloat16_ru(unsigned long long)
_iml_half_internal __imf_short2half_ru(short)
int __imf_float2int_ru(float)
_iml_half_internal __imf_int2half_rd(int)
float __imf_int2float_rd(int)
float __imf_bfloat162float(uint16_t)
_iml_half_internal __imf_short2half_rz(short)
float __imf_half2float(_iml_half_internal)
int __imf_bfloat162int_rn(uint16_t)
unsigned int __imf_half2uint_rn(_iml_half_internal)
uint16_t __imf_ull2bfloat16_rn(unsigned long long)
unsigned long long int __imf_float2ull_rd(float)
unsigned long long int __imf_float2ull_ru(float)
float __imf_int2float_rn(int)
float __imf_ll2float_rz(long long int)
_iml_half_internal __imf_uint2half_rd(unsigned int)
_iml_half_internal __imf_ull2half_rz(unsigned long long)
_iml_half_internal __imf_short2half_rd(short)
_iml_half_internal __imf_ll2half_rn(long long)
unsigned long long __imf_half2ull_rn(_iml_half_internal)
float __imf_uint2float_rn(unsigned int)
int __imf_float2int_rz(float)
_iml_half_internal __imf_uint2half_rn(unsigned int)
_iml_half_internal __imf_float2half_rn(float)
uint16_t __imf_double2bfloat16(double)
uint16_t __imf_ushort_as_bfloat16(unsigned short)
_iml_half_internal __imf_short2half_rn(short)
uint16_t __imf_uint2bfloat16_ru(unsigned int)
uint16_t __imf_short2bfloat16_rn(short)
long long __imf_bfloat162ll_ru(uint16_t)
_iml_half_internal __imf_uint2half_rz(unsigned int)
uint16_t __imf_ll2bfloat16_ru(long long)
float __imf_uint2float_rz(unsigned int)
short __imf_half2short_rz(_iml_half_internal)
float __imf_uint2float_rd(unsigned int)
unsigned int __imf_float2uint_ru(float)
short __imf_bfloat162short_rd(uint16_t)
int __imf_half2int_rd(_iml_half_internal)
unsigned int __imf_bfloat162uint_rz(uint16_t)
float __imf_ull2float_rz(unsigned long long int)
long long int __imf_float2ll_rd(float)
short __imf_bfloat16_as_short(uint16_t)
unsigned int __imf_half2uint_rd(_iml_half_internal)
long long __imf_half2ll_rd(_iml_half_internal)
unsigned short __imf_bfloat16_as_ushort(uint16_t)
unsigned long long __imf_half2ull_rz(_iml_half_internal)
unsigned long long __imf_half2ull_rd(_iml_half_internal)
float __imf_ll2float_rn(long long int)
int __imf_half2int_ru(_iml_half_internal)
unsigned long long int __imf_float2ull_rn(float)
unsigned long long int __imf_float2ull_rz(float)
long long __imf_bfloat162ll_rd(uint16_t)
uint16_t __imf_uint2bfloat16_rn(unsigned int)
unsigned short __imf_half2ushort_ru(_iml_half_internal)
int __imf_half2int_rz(_iml_half_internal)
_iml_half_internal __imf_int2half_ru(int)
_iml_half_internal __imf_short_as_half(short)
unsigned short __imf_half_as_ushort(_iml_half_internal)
long long int __imf_float2ll_ru(float)
unsigned short __imf_bfloat162ushort_rd(uint16_t)
unsigned short __imf_half2ushort_rz(_iml_half_internal)
uint16_t __imf_uint2bfloat16_rz(unsigned int)
uint16_t __imf_ushort2bfloat16_rd(unsigned short)
_iml_half_internal __imf_float2half_ru(float)
int __imf_half2int_rn(_iml_half_internal)
_iml_half_internal __imf_ll2half_rd(long long)
uint16_t __imf_short2bfloat16_rz(short)
_iml_half_internal __imf_ushort2half_rz(unsigned short)
unsigned int __imf_float2uint_rz(float)
short __imf_bfloat162short_rz(uint16_t)
unsigned long long __imf_bfloat162ull_rd(uint16_t)
autodecltype(x) x
Definition: access.hpp:18