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