-
Notifications
You must be signed in to change notification settings - Fork 845
Expand file tree
/
Copy pathspirv_ops.hpp
More file actions
979 lines (855 loc) · 47.2 KB
/
Copy pathspirv_ops.hpp
File metadata and controls
979 lines (855 loc) · 47.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
//==----------- spirv_ops.hpp --- SPIRV operations -------------------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#pragma once
#include <CL/__spirv/spirv_types.hpp>
#include <cstddef>
#include <cstdint>
#include <sycl/detail/defines.hpp>
#include <sycl/detail/export.hpp>
#include <sycl/detail/stl_type_traits.hpp>
// Convergent attribute
#ifdef __SYCL_DEVICE_ONLY__
#define __SYCL_CONVERGENT__ __attribute__((convergent))
#else
#define __SYCL_CONVERGENT__
#endif
#ifdef __SYCL_DEVICE_ONLY__
#if (SYCL_EXT_ONEAPI_MATRIX_VERSION > 1)
#define JOINT_MATRIX_INTEL(T, R, C, L, S, U) \
__spv::__spirv_JointMatrixINTEL<T, R, C, L, S, U>
#else
#define JOINT_MATRIX_INTEL(T, R, C, L, S, U) \
__spv::__spirv_JointMatrixINTEL<T, R, C, L, S>
#endif // SYCL_EXT_ONEAPI_MATRIX_VERSION
template <typename T, std::size_t R, std::size_t C,
__spv::MatrixUse U = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL JOINT_MATRIX_INTEL(T, R, C, L, S, U) *
__spirv_JointMatrixLoadINTEL(T *Ptr, std::size_t Stride,
__spv::MatrixLayout Layout = L,
__spv::Scope::Flag Sc = S, int MemOperand = 0);
template <typename T, std::size_t R, std::size_t C,
__spv::MatrixUse U = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL void __spirv_JointMatrixStoreINTEL(
T *Ptr, JOINT_MATRIX_INTEL(T, R, C, L, S, U) *Object,
std::size_t Stride, __spv::MatrixLayout Layout = L,
__spv::Scope::Flag Sc = S, int MemOperand = 0);
template <typename T1, typename T2, std::size_t M, std::size_t K, std::size_t N,
__spv::MatrixUse UA = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UB = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UC = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout LA = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LB = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LC = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL JOINT_MATRIX_INTEL(T2, M, N, LC, S, UC) *
__spirv_JointMatrixMadINTEL(
JOINT_MATRIX_INTEL(T1, M, K, LA, S, UA) *A,
JOINT_MATRIX_INTEL(T1, K, N, LB, S, UB) *B,
JOINT_MATRIX_INTEL(T2, M, N, LC, S, UC) *C,
__spv::Scope::Flag Sc = __spv::Scope::Flag::Subgroup);
template <typename T1, typename T2, typename T3, std::size_t M, std::size_t K,
std::size_t N, __spv::MatrixUse UA = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UB = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UC = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout LA = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LB = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LC = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL JOINT_MATRIX_INTEL(T2, M, N, LC, S, UC) *
__spirv_JointMatrixUUMadINTEL(
JOINT_MATRIX_INTEL(T1, M, K, LA, S, UA) *A,
JOINT_MATRIX_INTEL(T2, K, N, LB, S, UB) *B,
JOINT_MATRIX_INTEL(T3, M, N, LC, S, UC) *C,
__spv::Scope::Flag Sc = __spv::Scope::Flag::Subgroup);
template <typename T1, typename T2, typename T3, std::size_t M, std::size_t K,
std::size_t N, __spv::MatrixUse UA = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UB = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UC = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout LA = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LB = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LC = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL JOINT_MATRIX_INTEL(T3, M, N, LC, S, UC) *
__spirv_JointMatrixUSMadINTEL(
JOINT_MATRIX_INTEL(T1, M, K, LA, S, UA) *A,
JOINT_MATRIX_INTEL(T2, K, N, LB, S, UB) *B,
JOINT_MATRIX_INTEL(T3, M, N, LC, S, UC) *C,
__spv::Scope::Flag Sc = __spv::Scope::Flag::Subgroup);
template <typename T1, typename T2, typename T3, std::size_t M, std::size_t K,
std::size_t N, __spv::MatrixUse UA = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UB = __spv::MatrixUse::Unnecessary,
__spv::MatrixUse UC = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout LA = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LB = __spv::MatrixLayout::RowMajor,
__spv::MatrixLayout LC = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL JOINT_MATRIX_INTEL(T3, M, N, LC, S, UC) *
__spirv_JointMatrixSUMadINTEL(
JOINT_MATRIX_INTEL(T1, M, K, LA, S, UA) *A,
JOINT_MATRIX_INTEL(T2, K, N, LB, S, UB) *B,
JOINT_MATRIX_INTEL(T3, M, N, LC, S, UC) *C,
__spv::Scope::Flag Sc = __spv::Scope::Flag::Subgroup);
template <typename T, std::size_t R, std::size_t C,
__spv::MatrixUse U = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL JOINT_MATRIX_INTEL(T, R, C, L, S, U) *
__spirv_CompositeConstruct(const T v);
template <typename T, std::size_t R, std::size_t C,
__spv::MatrixUse U = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL size_t __spirv_JointMatrixWorkItemLengthINTEL(
JOINT_MATRIX_INTEL(T, R, C, L, S, U) *);
template <typename T, std::size_t R, std::size_t C,
__spv::MatrixUse U = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL __ocl_vec_t<int32_t, 2>
__spirv_JointMatrixWorkItemElemCoord(JOINT_MATRIX_INTEL(T, R, C, L, S, U) *,
size_t i);
template <typename T, std::size_t R, std::size_t C,
__spv::MatrixUse U = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL T __spirv_VectorExtractDynamic(
JOINT_MATRIX_INTEL(T, R, C, L, S, U) *, size_t i);
template <typename T, std::size_t R, std::size_t C,
__spv::MatrixUse U = __spv::MatrixUse::Unnecessary,
__spv::MatrixLayout L = __spv::MatrixLayout::RowMajor,
__spv::Scope::Flag S = __spv::Scope::Flag::Subgroup>
extern SYCL_EXTERNAL JOINT_MATRIX_INTEL(T, R, C, L, S, U) *
__spirv_VectorInsertDynamic(JOINT_MATRIX_INTEL(T, R, C, L, S, U) *,
T val, size_t i);
#undef JOINT_MATRIX_INTEL
#ifndef __SPIRV_BUILTIN_DECLARATIONS__
#error \
"SPIR-V built-ins are not available. Please set -fdeclare-spirv-builtins flag."
#endif
template <typename RetT, typename ImageT>
extern SYCL_EXTERNAL RetT __spirv_ImageQueryFormat(ImageT);
template <typename RetT, typename ImageT>
extern SYCL_EXTERNAL RetT __spirv_ImageQueryOrder(ImageT);
template <typename RetT, typename ImageT>
extern SYCL_EXTERNAL RetT __spirv_ImageQuerySize(ImageT);
template <typename ImageT, typename CoordT, typename ValT>
extern SYCL_EXTERNAL void __spirv_ImageWrite(ImageT, CoordT, ValT);
template <class RetT, typename ImageT, typename TempArgT>
extern SYCL_EXTERNAL RetT __spirv_ImageRead(ImageT, TempArgT);
template <typename ImageT, typename SampledType>
extern SYCL_EXTERNAL SampledType __spirv_SampledImage(ImageT, __ocl_sampler_t);
template <typename SampledType, typename TempRetT, typename TempArgT>
extern SYCL_EXTERNAL TempRetT __spirv_ImageSampleExplicitLod(SampledType,
TempArgT, int,
float);
#define __SYCL_OpGroupAsyncCopyGlobalToLocal __spirv_GroupAsyncCopy
#define __SYCL_OpGroupAsyncCopyLocalToGlobal __spirv_GroupAsyncCopy
// Atomic SPIR-V builtins
#define __SPIRV_ATOMIC_LOAD(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicLoad( \
AS const Type *P, __spv::Scope::Flag S, \
__spv::MemorySemanticsMask::Flag O);
#define __SPIRV_ATOMIC_STORE(AS, Type) \
extern SYCL_EXTERNAL void __spirv_AtomicStore( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_EXCHANGE(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicExchange( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_CMP_EXCHANGE(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicCompareExchange( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag E, \
__spv::MemorySemanticsMask::Flag U, Type V, Type C);
#define __SPIRV_ATOMIC_IADD(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicIAdd( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_ISUB(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicISub( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_FADD(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicFAddEXT( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_SMIN(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicSMin( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_UMIN(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicUMin( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_FMIN(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicFMinEXT( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_SMAX(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicSMax( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_UMAX(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicUMax( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_FMAX(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicFMaxEXT( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_AND(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicAnd( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_OR(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicOr( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_XOR(AS, Type) \
extern SYCL_EXTERNAL Type __spirv_AtomicXor( \
AS Type *P, __spv::Scope::Flag S, __spv::MemorySemanticsMask::Flag O, \
Type V);
#define __SPIRV_ATOMIC_FLOAT(AS, Type) \
__SPIRV_ATOMIC_FADD(AS, Type) \
__SPIRV_ATOMIC_FMIN(AS, Type) \
__SPIRV_ATOMIC_FMAX(AS, Type) \
__SPIRV_ATOMIC_LOAD(AS, Type) \
__SPIRV_ATOMIC_STORE(AS, Type) \
__SPIRV_ATOMIC_EXCHANGE(AS, Type)
#define __SPIRV_ATOMIC_BASE(AS, Type) \
__SPIRV_ATOMIC_FLOAT(AS, Type) \
__SPIRV_ATOMIC_CMP_EXCHANGE(AS, Type) \
__SPIRV_ATOMIC_IADD(AS, Type) \
__SPIRV_ATOMIC_ISUB(AS, Type) \
__SPIRV_ATOMIC_AND(AS, Type) \
__SPIRV_ATOMIC_OR(AS, Type) \
__SPIRV_ATOMIC_XOR(AS, Type)
#define __SPIRV_ATOMIC_SIGNED(AS, Type) \
__SPIRV_ATOMIC_BASE(AS, Type) \
__SPIRV_ATOMIC_SMIN(AS, Type) \
__SPIRV_ATOMIC_SMAX(AS, Type)
#define __SPIRV_ATOMIC_UNSIGNED(AS, Type) \
__SPIRV_ATOMIC_BASE(AS, Type) \
__SPIRV_ATOMIC_UMIN(AS, Type) \
__SPIRV_ATOMIC_UMAX(AS, Type)
// Helper atomic operations which select correct signed/unsigned version
// of atomic min/max based on the type
#define __SPIRV_ATOMIC_MINMAX(AS, Op) \
template <typename T> \
typename sycl::detail::enable_if_t< \
std::is_integral<T>::value && std::is_signed<T>::value, T> \
__spirv_Atomic##Op(AS T *Ptr, __spv::Scope::Flag Memory, \
__spv::MemorySemanticsMask::Flag Semantics, \
T Value) { \
return __spirv_AtomicS##Op(Ptr, Memory, Semantics, Value); \
} \
template <typename T> \
typename sycl::detail::enable_if_t< \
std::is_integral<T>::value && !std::is_signed<T>::value, T> \
__spirv_Atomic##Op(AS T *Ptr, __spv::Scope::Flag Memory, \
__spv::MemorySemanticsMask::Flag Semantics, \
T Value) { \
return __spirv_AtomicU##Op(Ptr, Memory, Semantics, Value); \
} \
template <typename T> \
typename sycl::detail::enable_if_t<std::is_floating_point<T>::value, T> \
__spirv_Atomic##Op(AS T *Ptr, __spv::Scope::Flag Memory, \
__spv::MemorySemanticsMask::Flag Semantics, \
T Value) { \
return __spirv_AtomicF##Op##EXT(Ptr, Memory, Semantics, Value); \
}
#define __SPIRV_ATOMICS(macro, Arg) \
macro(__attribute__((opencl_global)), Arg) \
macro(__attribute__((opencl_local)), Arg) macro(, Arg)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_FLOAT, float)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_FLOAT, double)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_SIGNED, int)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_SIGNED, long)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_SIGNED, long long)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_UNSIGNED, unsigned int)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_UNSIGNED, unsigned long)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_UNSIGNED, unsigned long long)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_MINMAX, Min)
__SPIRV_ATOMICS(__SPIRV_ATOMIC_MINMAX, Max)
#undef __SPIRV_ATOMICS
#undef __SPIRV_ATOMIC_AND
#undef __SPIRV_ATOMIC_BASE
#undef __SPIRV_ATOMIC_CMP_EXCHANGE
#undef __SPIRV_ATOMIC_EXCHANGE
#undef __SPIRV_ATOMIC_FADD
#undef __SPIRV_ATOMIC_FLOAT
#undef __SPIRV_ATOMIC_FMAX
#undef __SPIRV_ATOMIC_FMIN
#undef __SPIRV_ATOMIC_IADD
#undef __SPIRV_ATOMIC_ISUB
#undef __SPIRV_ATOMIC_LOAD
#undef __SPIRV_ATOMIC_MINMAX
#undef __SPIRV_ATOMIC_OR
#undef __SPIRV_ATOMIC_SIGNED
#undef __SPIRV_ATOMIC_SMAX
#undef __SPIRV_ATOMIC_SMIN
#undef __SPIRV_ATOMIC_STORE
#undef __SPIRV_ATOMIC_UMAX
#undef __SPIRV_ATOMIC_UMIN
#undef __SPIRV_ATOMIC_UNSIGNED
#undef __SPIRV_ATOMIC_XOR
template <typename dataT>
extern __attribute__((opencl_global)) dataT *
__SYCL_GenericCastToPtrExplicit_ToGlobal(void *Ptr) noexcept {
return (__attribute__((opencl_global)) dataT *)
__spirv_GenericCastToPtrExplicit_ToGlobal(
Ptr, __spv::StorageClass::CrossWorkgroup);
}
template <typename dataT>
extern const __attribute__((opencl_global)) dataT *
__SYCL_GenericCastToPtrExplicit_ToGlobal(const void *Ptr) noexcept {
return (const __attribute__((opencl_global)) dataT *)
__spirv_GenericCastToPtrExplicit_ToGlobal(
Ptr, __spv::StorageClass::CrossWorkgroup);
}
template <typename dataT>
extern const volatile __attribute__((opencl_global)) dataT *
__SYCL_GenericCastToPtrExplicit_ToGlobal(const volatile void *Ptr) noexcept {
return (const volatile __attribute__((opencl_global)) dataT *)
__spirv_GenericCastToPtrExplicit_ToGlobal(
Ptr, __spv::StorageClass::CrossWorkgroup);
}
template <typename dataT>
extern __attribute__((opencl_local)) dataT *
__SYCL_GenericCastToPtrExplicit_ToLocal(void *Ptr) noexcept {
return (__attribute__((opencl_local)) dataT *)
__spirv_GenericCastToPtrExplicit_ToLocal(Ptr,
__spv::StorageClass::Workgroup);
}
template <typename dataT>
extern const __attribute__((opencl_local)) dataT *
__SYCL_GenericCastToPtrExplicit_ToLocal(const void *Ptr) noexcept {
return (const __attribute__((opencl_local)) dataT *)
__spirv_GenericCastToPtrExplicit_ToLocal(Ptr,
__spv::StorageClass::Workgroup);
}
template <typename dataT>
extern const volatile __attribute__((opencl_local)) dataT *
__SYCL_GenericCastToPtrExplicit_ToLocal(const volatile void *Ptr) noexcept {
return (const volatile __attribute__((opencl_local)) dataT *)
__spirv_GenericCastToPtrExplicit_ToLocal(Ptr,
__spv::StorageClass::Workgroup);
}
template <typename dataT>
extern __attribute__((opencl_private)) dataT *
__SYCL_GenericCastToPtrExplicit_ToPrivate(void *Ptr) noexcept {
return (__attribute__((opencl_private)) dataT *)
__spirv_GenericCastToPtrExplicit_ToPrivate(Ptr,
__spv::StorageClass::Function);
}
template <typename dataT>
extern const __attribute__((opencl_private)) dataT *
__SYCL_GenericCastToPtrExplicit_ToPrivate(const void *Ptr) noexcept {
return (const __attribute__((opencl_private)) dataT *)
__spirv_GenericCastToPtrExplicit_ToPrivate(Ptr,
__spv::StorageClass::Function);
}
template <typename dataT>
extern const volatile __attribute__((opencl_private)) dataT *
__SYCL_GenericCastToPtrExplicit_ToPrivate(const volatile void *Ptr) noexcept {
return (const volatile __attribute__((opencl_private)) dataT *)
__spirv_GenericCastToPtrExplicit_ToPrivate(Ptr,
__spv::StorageClass::Function);
}
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT
__spirv_SubgroupShuffleINTEL(dataT Data, uint32_t InvocationId) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT __spirv_SubgroupShuffleDownINTEL(
dataT Current, dataT Next, uint32_t Delta) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT __spirv_SubgroupShuffleUpINTEL(
dataT Previous, dataT Current, uint32_t Delta) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT
__spirv_SubgroupShuffleXorINTEL(dataT Data, uint32_t Value) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT __spirv_SubgroupBlockReadINTEL(
const __attribute__((opencl_global)) uint8_t *Ptr) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL void
__spirv_SubgroupBlockWriteINTEL(__attribute__((opencl_global)) uint8_t *Ptr,
dataT Data) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT __spirv_SubgroupBlockReadINTEL(
const __attribute__((opencl_global)) uint16_t *Ptr) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL void
__spirv_SubgroupBlockWriteINTEL(__attribute__((opencl_global)) uint16_t *Ptr,
dataT Data) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT __spirv_SubgroupBlockReadINTEL(
const __attribute__((opencl_global)) uint32_t *Ptr) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL void
__spirv_SubgroupBlockWriteINTEL(__attribute__((opencl_global)) uint32_t *Ptr,
dataT Data) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL dataT __spirv_SubgroupBlockReadINTEL(
const __attribute__((opencl_global)) uint64_t *Ptr) noexcept;
template <typename dataT>
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL void
__spirv_SubgroupBlockWriteINTEL(__attribute__((opencl_global)) uint64_t *Ptr,
dataT Data) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedSqrtINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I, int32_t rI,
int32_t Quantization = 0, int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedRecipINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I,
int32_t rI, int32_t Quantization = 0,
int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedRsqrtINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I,
int32_t rI, int32_t Quantization = 0,
int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedSinINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I, int32_t rI,
int32_t Quantization = 0, int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedCosINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I, int32_t rI,
int32_t Quantization = 0, int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<2 * rW>
__spirv_FixedSinCosINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I,
int32_t rI, int32_t Quantization = 0,
int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedSinPiINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I,
int32_t rI, int32_t Quantization = 0,
int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedCosPiINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I,
int32_t rI, int32_t Quantization = 0,
int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<2 * rW>
__spirv_FixedSinCosPiINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I,
int32_t rI, int32_t Quantization = 0,
int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedLogINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I, int32_t rI,
int32_t Quantization = 0, int32_t Overflow = 0) noexcept;
template <int W, int rW>
extern SYCL_EXTERNAL sycl::detail::ap_int<rW>
__spirv_FixedExpINTEL(sycl::detail::ap_int<W> a, bool S, int32_t I, int32_t rI,
int32_t Quantization = 0, int32_t Overflow = 0) noexcept;
// In the following built-ins width of arbitrary precision integer type for
// a floating point variable should be equal to sum of corresponding
// exponent width E, mantissa width M and 1 for sign bit. I.e. WA = EA + MA + 1.
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatCastINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatCastFromIntINTEL(sycl::detail::ap_int<WA> A, int32_t Mout,
bool FromSign = false,
int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatCastToIntINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
bool ToSign = false,
int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout> __spirv_ArbitraryFloatAddINTEL(
sycl::detail::ap_int<WA> A, int32_t MA, sycl::detail::ap_int<WB> B,
int32_t MB, int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0, int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout> __spirv_ArbitraryFloatSubINTEL(
sycl::detail::ap_int<WA> A, int32_t MA, sycl::detail::ap_int<WB> B,
int32_t MB, int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0, int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout> __spirv_ArbitraryFloatMulINTEL(
sycl::detail::ap_int<WA> A, int32_t MA, sycl::detail::ap_int<WB> B,
int32_t MB, int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0, int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout> __spirv_ArbitraryFloatDivINTEL(
sycl::detail::ap_int<WA> A, int32_t MA, sycl::detail::ap_int<WB> B,
int32_t MB, int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0, int32_t RoundingAccuracy = 0) noexcept;
// Comparison built-ins don't use Subnormal Support, Rounding Mode and
// Rounding Accuracy.
template <int WA, int WB>
extern SYCL_EXTERNAL bool
__spirv_ArbitraryFloatGTINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
sycl::detail::ap_int<WB> B, int32_t MB) noexcept;
template <int WA, int WB>
extern SYCL_EXTERNAL bool
__spirv_ArbitraryFloatGEINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
sycl::detail::ap_int<WB> B, int32_t MB) noexcept;
template <int WA, int WB>
extern SYCL_EXTERNAL bool
__spirv_ArbitraryFloatLTINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
sycl::detail::ap_int<WB> B, int32_t MB) noexcept;
template <int WA, int WB>
extern SYCL_EXTERNAL bool
__spirv_ArbitraryFloatLEINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
sycl::detail::ap_int<WB> B, int32_t MB) noexcept;
template <int WA, int WB>
extern SYCL_EXTERNAL bool
__spirv_ArbitraryFloatEQINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
sycl::detail::ap_int<WB> B, int32_t MB) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatRecipINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatRSqrtINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatCbrtINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatHypotINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
sycl::detail::ap_int<WB> B, int32_t MB,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatSqrtINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatLogINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatLog2INTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatLog10INTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatLog1pINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatExpINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatExp2INTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatExp10INTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatExpm1INTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatSinINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatCosINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
// Result value contains both values of sine and cosine and so has the size of
// 2 * Wout where Wout is equal to (1 + Eout + Mout).
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<2 * Wout>
__spirv_ArbitraryFloatSinCosINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatSinPiINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatCosPiINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
// Result value contains both values of sine(A*pi) and cosine(A*pi) and so has
// the size of 2 * Wout where Wout is equal to (1 + Eout + Mout).
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<2 * Wout>
__spirv_ArbitraryFloatSinCosPiINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatASinINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatASinPiINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatACosINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatACosPiINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatATanINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatATanPiINTEL(sycl::detail::ap_int<WA> A, int32_t MA,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout>
__spirv_ArbitraryFloatATan2INTEL(sycl::detail::ap_int<WA> A, int32_t MA,
sycl::detail::ap_int<WB> B, int32_t MB,
int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0,
int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout> __spirv_ArbitraryFloatPowINTEL(
sycl::detail::ap_int<WA> A, int32_t MA, sycl::detail::ap_int<WB> B,
int32_t MB, int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0, int32_t RoundingAccuracy = 0) noexcept;
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout> __spirv_ArbitraryFloatPowRINTEL(
sycl::detail::ap_int<WA> A, int32_t MA, sycl::detail::ap_int<WB> B,
int32_t MB, int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0, int32_t RoundingAccuracy = 0) noexcept;
// PowN built-in calculates `A^B` where `A` is arbitrary precision floating
// point number and `B` is signed or unsigned arbitrary precision integer,
// i.e. its width doesn't depend on sum of exponent and mantissa.
template <int WA, int WB, int Wout>
extern SYCL_EXTERNAL sycl::detail::ap_int<Wout> __spirv_ArbitraryFloatPowNINTEL(
sycl::detail::ap_int<WA> A, int32_t MA, sycl::detail::ap_int<WB> B,
bool SignOfB, int32_t Mout, int32_t EnableSubnormals = 0,
int32_t RoundingMode = 0, int32_t RoundingAccuracy = 0) noexcept;
template <typename dataT>
extern SYCL_EXTERNAL int32_t __spirv_ReadPipe(__ocl_RPipeTy<dataT> Pipe,
dataT *Data, int32_t Size,
int32_t Alignment) noexcept;
template <typename dataT>
extern SYCL_EXTERNAL int32_t __spirv_WritePipe(__ocl_WPipeTy<dataT> Pipe,
const dataT *Data, int32_t Size,
int32_t Alignment) noexcept;
template <typename dataT>
extern SYCL_EXTERNAL void
__spirv_ReadPipeBlockingINTEL(__ocl_RPipeTy<dataT> Pipe, dataT *Data,
int32_t Size, int32_t Alignment) noexcept;
template <typename dataT>
extern SYCL_EXTERNAL void
__spirv_WritePipeBlockingINTEL(__ocl_WPipeTy<dataT> Pipe, const dataT *Data,
int32_t Size, int32_t Alignment) noexcept;
template <typename dataT>
extern SYCL_EXTERNAL __ocl_RPipeTy<dataT>
__spirv_CreatePipeFromPipeStorage_read(
const ConstantPipeStorage *Storage) noexcept;
template <typename dataT>
extern SYCL_EXTERNAL __ocl_WPipeTy<dataT>
__spirv_CreatePipeFromPipeStorage_write(
const ConstantPipeStorage *Storage) noexcept;
extern SYCL_EXTERNAL void
__spirv_ocl_prefetch(const __attribute__((opencl_global)) char *Ptr,
size_t NumBytes) noexcept;
extern SYCL_EXTERNAL uint16_t __spirv_ConvertFToBF16INTEL(float) noexcept;
extern SYCL_EXTERNAL float __spirv_ConvertBF16ToFINTEL(uint16_t) noexcept;
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL __SYCL_EXPORT __ocl_vec_t<uint32_t, 4>
__spirv_GroupNonUniformBallot(uint32_t Execution, bool Predicate) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT void
__clc_BarrierInitialize(int64_t *state, int32_t expected_count) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT void
__clc_BarrierInvalidate(int64_t *state) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT int64_t
__clc_BarrierArrive(int64_t *state) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT int64_t
__clc_BarrierArriveAndDrop(int64_t *state) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT int64_t
__clc_BarrierArriveNoComplete(int64_t *state, int32_t count) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT int64_t
__clc_BarrierArriveAndDropNoComplete(int64_t *state, int32_t count) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT void
__clc_BarrierCopyAsyncArrive(int64_t *state) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT void
__clc_BarrierCopyAsyncArriveNoInc(int64_t *state) noexcept;
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL __SYCL_EXPORT void
__clc_BarrierWait(int64_t *state, int64_t arrival) noexcept;
extern SYCL_EXTERNAL __SYCL_EXPORT bool
__clc_BarrierTestWait(int64_t *state, int64_t arrival) noexcept;
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL __SYCL_EXPORT void
__clc_BarrierArriveAndWait(int64_t *state) noexcept;
#ifdef __SYCL_USE_NON_VARIADIC_SPIRV_OCL_PRINTF__
template <typename... Args>
extern SYCL_EXTERNAL int
__spirv_ocl_printf(const __attribute__((opencl_constant)) char *Format,
Args... args);
template <typename... Args>
extern SYCL_EXTERNAL int __spirv_ocl_printf(const char *Format, Args... args);
#else
extern SYCL_EXTERNAL int
__spirv_ocl_printf(const __attribute__((opencl_constant)) char *Format, ...);
extern SYCL_EXTERNAL int __spirv_ocl_printf(const char *Format, ...);
#endif
// Native builtin extension
extern SYCL_EXTERNAL float __clc_native_tanh(float);
extern SYCL_EXTERNAL __ocl_vec_t<float, 2>
__clc_native_tanh(__ocl_vec_t<float, 2>);
extern SYCL_EXTERNAL __ocl_vec_t<float, 3>
__clc_native_tanh(__ocl_vec_t<float, 3>);
extern SYCL_EXTERNAL __ocl_vec_t<float, 4>
__clc_native_tanh(__ocl_vec_t<float, 4>);
extern SYCL_EXTERNAL __ocl_vec_t<float, 8>
__clc_native_tanh(__ocl_vec_t<float, 8>);
extern SYCL_EXTERNAL __ocl_vec_t<float, 16>
__clc_native_tanh(__ocl_vec_t<float, 16>);
extern SYCL_EXTERNAL _Float16 __clc_native_tanh(_Float16);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 2>
__clc_native_tanh(__ocl_vec_t<_Float16, 2>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 3>
__clc_native_tanh(__ocl_vec_t<_Float16, 3>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 4>
__clc_native_tanh(__ocl_vec_t<_Float16, 4>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 8>
__clc_native_tanh(__ocl_vec_t<_Float16, 8>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 16>
__clc_native_tanh(__ocl_vec_t<_Float16, 16>);
extern SYCL_EXTERNAL _Float16 __clc_native_exp2(_Float16);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 2>
__clc_native_exp2(__ocl_vec_t<_Float16, 2>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 3>
__clc_native_exp2(__ocl_vec_t<_Float16, 3>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 4>
__clc_native_exp2(__ocl_vec_t<_Float16, 4>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 8>
__clc_native_exp2(__ocl_vec_t<_Float16, 8>);
extern SYCL_EXTERNAL __ocl_vec_t<_Float16, 16>
__clc_native_exp2(__ocl_vec_t<_Float16, 16>);
#define __CLC_BF16(...) \
extern SYCL_EXTERNAL __SYCL_EXPORT __VA_ARGS__ __clc_fabs( \
__VA_ARGS__) noexcept; \
extern SYCL_EXTERNAL __SYCL_EXPORT __VA_ARGS__ __clc_fmin( \
__VA_ARGS__, __VA_ARGS__) noexcept; \
extern SYCL_EXTERNAL __SYCL_EXPORT __VA_ARGS__ __clc_fmax( \
__VA_ARGS__, __VA_ARGS__) noexcept; \
extern SYCL_EXTERNAL __SYCL_EXPORT __VA_ARGS__ __clc_fma( \
__VA_ARGS__, __VA_ARGS__, __VA_ARGS__) noexcept;
#define __CLC_BF16_SCAL_VEC(TYPE) \
__CLC_BF16(TYPE) \
__CLC_BF16(__ocl_vec_t<TYPE, 2>) \
__CLC_BF16(__ocl_vec_t<TYPE, 3>) \
__CLC_BF16(__ocl_vec_t<TYPE, 4>) \
__CLC_BF16(__ocl_vec_t<TYPE, 8>) \
__CLC_BF16(__ocl_vec_t<TYPE, 16>)
__CLC_BF16_SCAL_VEC(uint16_t)
__CLC_BF16_SCAL_VEC(uint32_t)
#undef __CLC_BF16_SCAL_VEC
#undef __CLC_BF16
#else // if !__SYCL_DEVICE_ONLY__
template <typename dataT>
__SYCL_CONVERGENT__ extern __ocl_event_t
__SYCL_OpGroupAsyncCopyGlobalToLocal(__spv::Scope::Flag, dataT *Dest,
dataT *Src, size_t NumElements,
size_t Stride, __ocl_event_t) noexcept {
for (size_t i = 0; i < NumElements; i++) {
Dest[i] = Src[i * Stride];
}
// A real instance of the class is not needed, return dummy pointer.
return nullptr;
}
template <typename dataT>
__SYCL_CONVERGENT__ extern __ocl_event_t
__SYCL_OpGroupAsyncCopyLocalToGlobal(__spv::Scope::Flag, dataT *Dest,
dataT *Src, size_t NumElements,
size_t Stride, __ocl_event_t) noexcept {
for (size_t i = 0; i < NumElements; i++) {
Dest[i * Stride] = Src[i];
}
// A real instance of the class is not needed, return dummy pointer.
return nullptr;
}
extern __SYCL_EXPORT void __spirv_ocl_prefetch(const char *Ptr,
size_t NumBytes) noexcept;
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL __SYCL_EXPORT void
__spirv_ControlBarrier(__spv::Scope Execution, __spv::Scope Memory,
uint32_t Semantics) noexcept;
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL __SYCL_EXPORT void
__spirv_MemoryBarrier(__spv::Scope Memory, uint32_t Semantics) noexcept;
__SYCL_CONVERGENT__ extern SYCL_EXTERNAL __SYCL_EXPORT void
__spirv_GroupWaitEvents(__spv::Scope Execution, uint32_t NumEvents,
__ocl_event_t *WaitEvents) noexcept;
#endif // !__SYCL_DEVICE_ONLY__