dtype_vector.hpp Source File

dtype_vector.hpp Source File#

Composable Kernel: dtype_vector.hpp Source File
dtype_vector.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// // // Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved.
3#pragma once
5
6namespace ck {
7
8// vector_type
9template <typename T, index_t N, typename Enable = void>
11
12// Caution: DO NOT REMOVE
13// intentionally have only declaration but no definition to cause compilation failure when trying to
14// instantiate this template. The purpose is to catch user's mistake when trying to make "vector of
15// vectors"
16template <typename T, index_t V, index_t N>
17struct vector_type<T __attribute__((ext_vector_type(V))), N>;
18
19// Caution: DO NOT REMOVE
20// intentionally have only declaration but no definition to cause compilation failure when trying to
21// instantiate this template. The purpose is to catch user's mistake when trying to make "vector of
22// vectors"
23template <typename T, index_t V, index_t N>
24struct vector_type<vector_type<T, V>, N>;
25
26// vector_type_maker
27// This is the right way to handle "vector of vectors": making a bigger vector instead
28template <typename T, index_t N>
33
34template <typename T, index_t N>
36{
37 using type = T;
38 static constexpr index_t vector_size = N;
39};
40
41template <typename T, index_t N0, index_t N1>
42struct vector_type_maker<T __attribute__((ext_vector_type(N1))), N0>
43{
45};
46
47template <typename T, index_t N0, index_t N1>
49{
51};
52
53template <typename T, index_t N>
55
56template <typename T, index_t N>
57__host__ __device__ constexpr auto make_vector_type(Number<N>)
58{
59 return typename vector_type_maker<T, N>::type{};
60}
61
62template <typename T>
63struct vector_type<T, 1, typename ck::enable_if_t<is_native_type<T>()>>
64{
65 using d1_t = T;
66 using type = d1_t;
67
68 union
69 {
70 T d1_;
72 } data_;
73
74 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
75
76 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
77
78 template <typename X>
79 __host__ __device__ constexpr const auto& AsType() const
80 {
81 static_assert(is_same<X, d1_t>::value,
82 "Something went wrong, please check src and dst types.");
83
84 return data_.d1x1_;
85 }
86
87 template <typename X>
88 __host__ __device__ constexpr auto& AsType()
89 {
90 static_assert(is_same<X, d1_t>::value,
91 "Something went wrong, please check src and dst types.");
92
93 return data_.d1x1_;
94 }
95};
96
97__device__ int static err = 0;
98template <typename T>
99struct vector_type<T, 2, typename ck::enable_if_t<is_native_type<T>()>>
100{
101 using d1_t = T;
102 typedef T d2_t __attribute__((ext_vector_type(2)));
103
104 using type = d2_t;
105
106 union
107 {
111 } data_;
112
113 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
114
115 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
116
117 template <typename X>
118 __host__ __device__ constexpr const auto& AsType() const
119 {
121 "Something went wrong, please check src and dst types.");
122
123 if constexpr(is_same<X, d1_t>::value)
124 {
125 return data_.d1x2_;
126 }
127 else if constexpr(is_same<X, d2_t>::value)
128 {
129 return data_.d2x1_;
130 }
131 else
132 {
133 return err;
134 }
135 }
136
137 template <typename X>
138 __host__ __device__ constexpr auto& AsType()
139 {
141 "Something went wrong, please check src and dst types.");
142
143 if constexpr(is_same<X, d1_t>::value)
144 {
145 return data_.d1x2_;
146 }
147 else if constexpr(is_same<X, d2_t>::value)
148 {
149 return data_.d2x1_;
150 }
151 else
152 {
153 return err;
154 }
155 }
156};
157
158template <typename T>
159struct vector_type<T, 3, typename ck::enable_if_t<is_native_type<T>()>>
160{
161 using d1_t = T;
162 typedef T d2_t __attribute__((ext_vector_type(2)));
163 typedef T d3_t __attribute__((ext_vector_type(3)));
164
165 using type = d3_t;
166
167 union
168 {
173 } data_;
174
175 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
176
177 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
178
179 template <typename X>
180 __host__ __device__ constexpr const auto& AsType() const
181 {
183 "Something went wrong, please check src and dst types.");
184
185 if constexpr(is_same<X, d1_t>::value)
186 {
187 return data_.d1x3_;
188 }
189 else if constexpr(is_same<X, d2_t>::value)
190 {
191 return data_.d2x1_;
192 }
193 else if constexpr(is_same<X, d3_t>::value)
194 {
195 return data_.d3x1_;
196 }
197 else
198 {
199 return err;
200 }
201 }
202
203 template <typename X>
204 __host__ __device__ constexpr auto& AsType()
205 {
207 "Something went wrong, please check src and dst types.");
208
209 if constexpr(is_same<X, d1_t>::value)
210 {
211 return data_.d1x3_;
212 }
213 else if constexpr(is_same<X, d2_t>::value)
214 {
215 return data_.d2x1_;
216 }
217 else if constexpr(is_same<X, d3_t>::value)
218 {
219 return data_.d3x1_;
220 }
221 else
222 {
223 return err;
224 }
225 }
226};
227
228template <typename T>
229struct vector_type<T, 4, typename ck::enable_if_t<is_native_type<T>()>>
230{
231 using d1_t = T;
232 typedef T d2_t __attribute__((ext_vector_type(2)));
233 typedef T d4_t __attribute__((ext_vector_type(4)));
234
235 using type = d4_t;
236
237 union
238 {
243 } data_;
244
245 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
246
247 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
248
249 template <typename X>
250 __host__ __device__ constexpr const auto& AsType() const
251 {
253 "Something went wrong, please check src and dst types.");
254
255 if constexpr(is_same<X, d1_t>::value)
256 {
257 return data_.d1x4_;
258 }
259 else if constexpr(is_same<X, d2_t>::value)
260 {
261 return data_.d2x2_;
262 }
263 else if constexpr(is_same<X, d4_t>::value)
264 {
265 return data_.d4x1_;
266 }
267 else
268 {
269 return err;
270 }
271 }
272
273 template <typename X>
274 __host__ __device__ constexpr auto& AsType()
275 {
277 "Something went wrong, please check src and dst types.");
278
279 if constexpr(is_same<X, d1_t>::value)
280 {
281 return data_.d1x4_;
282 }
283 else if constexpr(is_same<X, d2_t>::value)
284 {
285 return data_.d2x2_;
286 }
287 else if constexpr(is_same<X, d4_t>::value)
288 {
289 return data_.d4x1_;
290 }
291 else
292 {
293 return err;
294 }
295 }
296};
297
298template <typename T>
299struct vector_type<T, 5, typename ck::enable_if_t<is_native_type<T>()>>
300{
301 using d1_t = T;
302 typedef T d4_t __attribute__((ext_vector_type(4)));
303 typedef T d5_t __attribute__((ext_vector_type(5)));
304
305 using type = d5_t;
306
307 union
308 {
313 } data_;
314
315 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
316
317 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
318
319 template <typename X>
320 __host__ __device__ constexpr const auto& AsType() const
321 {
323 "Something went wrong, please check src and dst types.");
324
325 if constexpr(is_same<X, d1_t>::value)
326 {
327 return data_.d1x5_;
328 }
329 else if constexpr(is_same<X, d4_t>::value)
330 {
331 return data_.d4x1_;
332 }
333 else if constexpr(is_same<X, d5_t>::value)
334 {
335 return data_.d5x1_;
336 }
337 else
338 {
339 return err;
340 }
341 }
342
343 template <typename X>
344 __host__ __device__ constexpr auto& AsType()
345 {
347 "Something went wrong, please check src and dst types.");
348
349 if constexpr(is_same<X, d1_t>::value)
350 {
351 return data_.d1x5_;
352 }
353 else if constexpr(is_same<X, d4_t>::value)
354 {
355 return data_.d4x1_;
356 }
357 else if constexpr(is_same<X, d5_t>::value)
358 {
359 return data_.d5x1_;
360 }
361 else
362 {
363 return err;
364 }
365 }
366};
367
368template <typename T>
369struct vector_type<T, 6, typename ck::enable_if_t<is_native_type<T>()>>
370{
371 using d1_t = T;
372 typedef T d2_t __attribute__((ext_vector_type(2)));
373 typedef T d3_t __attribute__((ext_vector_type(3)));
374 typedef T d6_t __attribute__((ext_vector_type(6)));
375
376 using type = d6_t;
377
378 union
379 {
385 } data_;
386
387 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
388
389 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
390
391 template <typename X>
392 __host__ __device__ constexpr const auto& AsType() const
393 {
396 "Something went wrong, please check src and dst types.");
397
398 if constexpr(is_same<X, d1_t>::value)
399 {
400 return data_.d1x6_;
401 }
402 else if constexpr(is_same<X, d2_t>::value)
403 {
404 return data_.d2x3_;
405 }
406 else if constexpr(is_same<X, d3_t>::value)
407 {
408 return data_.d3x2_;
409 }
410 else if constexpr(is_same<X, d6_t>::value)
411 {
412 return data_.d6x1_;
413 }
414 else
415 {
416 return err;
417 }
418 }
419
420 template <typename X>
421 __host__ __device__ constexpr auto& AsType()
422 {
425 "Something went wrong, please check src and dst types.");
426
427 if constexpr(is_same<X, d1_t>::value)
428 {
429 return data_.d1x6_;
430 }
431 else if constexpr(is_same<X, d2_t>::value)
432 {
433 return data_.d2x3_;
434 }
435 else if constexpr(is_same<X, d3_t>::value)
436 {
437 return data_.d3x2_;
438 }
439 else if constexpr(is_same<X, d6_t>::value)
440 {
441 return data_.d6x1_;
442 }
443 else
444 {
445 return err;
446 }
447 }
448};
449
450template <typename T>
451struct vector_type<T, 7, typename ck::enable_if_t<is_native_type<T>()>>
452{
453 using d1_t = T;
454 typedef T d2_t __attribute__((ext_vector_type(2)));
455 typedef T d4_t __attribute__((ext_vector_type(4)));
456 typedef T d7_t __attribute__((ext_vector_type(7)));
457
458 using type = d7_t;
459
460 union
461 {
467 } data_;
468
469 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
470
471 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
472
473 template <typename X>
474 __host__ __device__ constexpr const auto& AsType() const
475 {
478 "Something went wrong, please check src and dst types.");
479
480 if constexpr(is_same<X, d1_t>::value)
481 {
482 return data_.d1x7_;
483 }
484 else if constexpr(is_same<X, d2_t>::value)
485 {
486 return data_.d2x3_;
487 }
488 else if constexpr(is_same<X, d4_t>::value)
489 {
490 return data_.d4x1_;
491 }
492 else if constexpr(is_same<X, d7_t>::value)
493 {
494 return data_.d7x1_;
495 }
496 else
497 {
498 return err;
499 }
500 }
501
502 template <typename X>
503 __host__ __device__ constexpr auto& AsType()
504 {
507 "Something went wrong, please check src and dst types.");
508
509 if constexpr(is_same<X, d1_t>::value)
510 {
511 return data_.d1x7_;
512 }
513 else if constexpr(is_same<X, d2_t>::value)
514 {
515 return data_.d2x3_;
516 }
517 else if constexpr(is_same<X, d4_t>::value)
518 {
519 return data_.d4x1_;
520 }
521 else if constexpr(is_same<X, d7_t>::value)
522 {
523 return data_.d7x1_;
524 }
525 else
526 {
527 return err;
528 }
529 }
530};
531
532template <typename T>
533struct vector_type<T, 8, typename ck::enable_if_t<is_native_type<T>()>>
534{
535 using d1_t = T;
536 typedef T d2_t __attribute__((ext_vector_type(2)));
537 typedef T d4_t __attribute__((ext_vector_type(4)));
538 typedef T d8_t __attribute__((ext_vector_type(8)));
539
540 using type = d8_t;
541
542 union
543 {
549 } data_;
550
551 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
552
553 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
554
555 template <typename X>
556 __host__ __device__ constexpr const auto& AsType() const
557 {
560 "Something went wrong, please check src and dst types.");
561
562 if constexpr(is_same<X, d1_t>::value)
563 {
564 return data_.d1x8_;
565 }
566 else if constexpr(is_same<X, d2_t>::value)
567 {
568 return data_.d2x4_;
569 }
570 else if constexpr(is_same<X, d4_t>::value)
571 {
572 return data_.d4x2_;
573 }
574 else if constexpr(is_same<X, d8_t>::value)
575 {
576 return data_.d8x1_;
577 }
578 else
579 {
580 return err;
581 }
582 }
583
584 template <typename X>
585 __host__ __device__ constexpr auto& AsType()
586 {
589 "Something went wrong, please check src and dst types.");
590
591 if constexpr(is_same<X, d1_t>::value)
592 {
593 return data_.d1x8_;
594 }
595 else if constexpr(is_same<X, d2_t>::value)
596 {
597 return data_.d2x4_;
598 }
599 else if constexpr(is_same<X, d4_t>::value)
600 {
601 return data_.d4x2_;
602 }
603 else if constexpr(is_same<X, d8_t>::value)
604 {
605 return data_.d8x1_;
606 }
607 else
608 {
609 return err;
610 }
611 }
612};
613
614template <typename T>
615struct vector_type<T, 13, typename ck::enable_if_t<is_native_type<T>()>>
616{
617 using d1_t = T;
618 typedef T d4_t __attribute__((ext_vector_type(4)));
619 typedef T d8_t __attribute__((ext_vector_type(8)));
620 typedef T d13_t __attribute__((ext_vector_type(13)));
621
622 using type = d13_t;
623
624 union
625 {
631 } data_;
632
633 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
634
635 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
636
637 template <typename X>
638 __host__ __device__ constexpr const auto& AsType() const
639 {
642 "Something went wrong, please check src and dst types.");
643
644 if constexpr(is_same<X, d1_t>::value)
645 {
646 return data_.d1x13_;
647 }
648 else if constexpr(is_same<X, d4_t>::value)
649 {
650 return data_.d4x3_;
651 }
652 else if constexpr(is_same<X, d8_t>::value)
653 {
654 return data_.d8x1_;
655 }
656 else if constexpr(is_same<X, d13_t>::value)
657 {
658 return data_.d13x1_;
659 }
660 else
661 {
662 return err;
663 }
664 }
665
666 template <typename X>
667 __host__ __device__ constexpr auto& AsType()
668 {
671 "Something went wrong, please check src and dst types.");
672
673 if constexpr(is_same<X, d1_t>::value)
674 {
675 return data_.d1x13_;
676 }
677 else if constexpr(is_same<X, d4_t>::value)
678 {
679 return data_.d4x3_;
680 }
681 else if constexpr(is_same<X, d8_t>::value)
682 {
683 return data_.d8x1_;
684 }
685 else if constexpr(is_same<X, d13_t>::value)
686 {
687 return data_.d13x1_;
688 }
689 else
690 {
691 return err;
692 }
693 }
694};
695
696template <typename T>
697struct vector_type<T, 16, typename ck::enable_if_t<is_native_type<T>()>>
698{
699 using d1_t = T;
700 typedef T d2_t __attribute__((ext_vector_type(2)));
701 typedef T d4_t __attribute__((ext_vector_type(4)));
702 typedef T d8_t __attribute__((ext_vector_type(8)));
703 typedef T d16_t __attribute__((ext_vector_type(16)));
704
705 using type = d16_t;
706
707 union
708 {
715 } data_;
716
717 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
718
719 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
720
721 template <typename X>
722 __host__ __device__ constexpr const auto& AsType() const
723 {
727 "Something went wrong, please check src and dst types.");
728
729 if constexpr(is_same<X, d1_t>::value)
730 {
731 return data_.d1x16_;
732 }
733 else if constexpr(is_same<X, d2_t>::value)
734 {
735 return data_.d2x8_;
736 }
737 else if constexpr(is_same<X, d4_t>::value)
738 {
739 return data_.d4x4_;
740 }
741 else if constexpr(is_same<X, d8_t>::value)
742 {
743 return data_.d8x2_;
744 }
745 else if constexpr(is_same<X, d16_t>::value)
746 {
747 return data_.d16x1_;
748 }
749 else
750 {
751 return err;
752 }
753 }
754
755 template <typename X>
756 __host__ __device__ constexpr auto& AsType()
757 {
761 "Something went wrong, please check src and dst types.");
762
763 if constexpr(is_same<X, d1_t>::value)
764 {
765 return data_.d1x16_;
766 }
767 else if constexpr(is_same<X, d2_t>::value)
768 {
769 return data_.d2x8_;
770 }
771 else if constexpr(is_same<X, d4_t>::value)
772 {
773 return data_.d4x4_;
774 }
775 else if constexpr(is_same<X, d8_t>::value)
776 {
777 return data_.d8x2_;
778 }
779 else if constexpr(is_same<X, d16_t>::value)
780 {
781 return data_.d16x1_;
782 }
783 else
784 {
785 return err;
786 }
787 }
788};
789
790template <typename T>
791struct vector_type<T, 32, typename ck::enable_if_t<is_native_type<T>()>>
792{
793 using d1_t = T;
794 typedef T d2_t __attribute__((ext_vector_type(2)));
795 typedef T d4_t __attribute__((ext_vector_type(4)));
796 typedef T d8_t __attribute__((ext_vector_type(8)));
797 typedef T d16_t __attribute__((ext_vector_type(16)));
798 typedef T d32_t __attribute__((ext_vector_type(32)));
799
800 using type = d32_t;
801
802 union
803 {
811 } data_ = {d32_t{0}};
812
813 __attribute__((host)) __attribute__((device)) constexpr vector_type() {}
814
815 __attribute__((host)) __attribute__((device)) constexpr vector_type(type v) { (void)v; }
816
817 // __host__ __device__ constexpr vector_type() : data_{type{0}} {}
818
819 // __host__ __device__ constexpr vector_type(type v) : data_{v} {}
820
821 template <typename X>
822 __host__ __device__ constexpr const auto& AsType() const
823 {
827 "Something went wrong, please check src and dst types.");
828
829 if constexpr(is_same<X, d1_t>::value)
830 {
831 return data_.d1x32_;
832 }
833 else if constexpr(is_same<X, d2_t>::value)
834 {
835 return data_.d2x16_;
836 }
837 else if constexpr(is_same<X, d4_t>::value)
838 {
839 return data_.d4x8_;
840 }
841 else if constexpr(is_same<X, d8_t>::value)
842 {
843 return data_.d8x4_;
844 }
845 else if constexpr(is_same<X, d16_t>::value)
846 {
847 return data_.d16x2_;
848 }
849 else if constexpr(is_same<X, d32_t>::value)
850 {
851 return data_.d32x1_;
852 }
853 else
854 {
855 return err;
856 }
857 }
858
859 template <typename X>
860 __host__ __device__ constexpr auto& AsType()
861 {
865 "Something went wrong, please check src and dst types.");
866
867 if constexpr(is_same<X, d1_t>::value)
868 {
869 return data_.d1x32_;
870 }
871 else if constexpr(is_same<X, d2_t>::value)
872 {
873 return data_.d2x16_;
874 }
875 else if constexpr(is_same<X, d4_t>::value)
876 {
877 return data_.d4x8_;
878 }
879 else if constexpr(is_same<X, d8_t>::value)
880 {
881 return data_.d8x4_;
882 }
883 else if constexpr(is_same<X, d16_t>::value)
884 {
885 return data_.d16x2_;
886 }
887 else if constexpr(is_same<X, d32_t>::value)
888 {
889 return data_.d32x1_;
890 }
891 else
892 {
893 return err;
894 }
895 }
896};
897
898template <typename T>
899struct vector_type<T, 64, typename ck::enable_if_t<is_native_type<T>()>>
900{
901 using d1_t = T;
902 typedef T d2_t __attribute__((ext_vector_type(2)));
903 typedef T d4_t __attribute__((ext_vector_type(4)));
904 typedef T d8_t __attribute__((ext_vector_type(8)));
905 typedef T d16_t __attribute__((ext_vector_type(16)));
906 typedef T d32_t __attribute__((ext_vector_type(32)));
907 typedef T d64_t __attribute__((ext_vector_type(64)));
908
909 using type = d64_t;
910
911 union
912 {
921 } data_;
922
923 __host__ __device__ constexpr vector_type() : data_{type{0}} {}
924
925 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
926
927 template <typename X>
928 __host__ __device__ constexpr const auto& AsType() const
929 {
934 "Something went wrong, please check src and dst types.");
935
936 if constexpr(is_same<X, d1_t>::value)
937 {
938 return data_.d1x64_;
939 }
940 else if constexpr(is_same<X, d2_t>::value)
941 {
942 return data_.d2x32_;
943 }
944 else if constexpr(is_same<X, d4_t>::value)
945 {
946 return data_.d4x16_;
947 }
948 else if constexpr(is_same<X, d8_t>::value)
949 {
950 return data_.d8x8_;
951 }
952 else if constexpr(is_same<X, d16_t>::value)
953 {
954 return data_.d16x4_;
955 }
956 else if constexpr(is_same<X, d32_t>::value)
957 {
958 return data_.d32x2_;
959 }
960 else if constexpr(is_same<X, d64_t>::value)
961 {
962 return data_.d64x1_;
963 }
964 else
965 {
966 return err;
967 }
968 }
969
970 template <typename X>
971 __host__ __device__ constexpr auto& AsType()
972 {
977 "Something went wrong, please check src and dst types.");
978
979 if constexpr(is_same<X, d1_t>::value)
980 {
981 return data_.d1x64_;
982 }
983 else if constexpr(is_same<X, d2_t>::value)
984 {
985 return data_.d2x32_;
986 }
987 else if constexpr(is_same<X, d4_t>::value)
988 {
989 return data_.d4x16_;
990 }
991 else if constexpr(is_same<X, d8_t>::value)
992 {
993 return data_.d8x8_;
994 }
995 else if constexpr(is_same<X, d16_t>::value)
996 {
997 return data_.d16x4_;
998 }
999 else if constexpr(is_same<X, d32_t>::value)
1000 {
1001 return data_.d32x2_;
1002 }
1003 else if constexpr(is_same<X, d64_t>::value)
1004 {
1005 return data_.d64x1_;
1006 }
1007 else
1008 {
1009 return err;
1010 }
1011 }
1012};
1013
1014template <typename T>
1015struct vector_type<T, 128, typename ck::enable_if_t<is_native_type<T>()>>
1016{
1017 using d1_t = T;
1018 typedef T d2_t __attribute__((ext_vector_type(2)));
1019 typedef T d4_t __attribute__((ext_vector_type(4)));
1020 typedef T d8_t __attribute__((ext_vector_type(8)));
1021 typedef T d16_t __attribute__((ext_vector_type(16)));
1022 typedef T d32_t __attribute__((ext_vector_type(32)));
1023 typedef T d64_t __attribute__((ext_vector_type(64)));
1024 typedef T d128_t __attribute__((ext_vector_type(128)));
1025
1026 using type = d128_t;
1027
1028 union
1029 {
1039 } data_ = {d128_t{0}};
1040
1041 __attribute__((host)) __attribute__((device)) constexpr vector_type() {}
1042
1043 __attribute__((host)) __attribute__((device)) constexpr vector_type(type v) { (void)v; }
1044
1045 template <typename X>
1046 __host__ __device__ constexpr const auto& AsType() const
1047 {
1052 "Something went wrong, please check src and dst types.");
1053
1054 if constexpr(is_same<X, d1_t>::value)
1055 {
1056 return data_.d1x128_;
1057 }
1058 else if constexpr(is_same<X, d2_t>::value)
1059 {
1060 return data_.d2x64_;
1061 }
1062 else if constexpr(is_same<X, d4_t>::value)
1063 {
1064 return data_.d4x32_;
1065 }
1066 else if constexpr(is_same<X, d8_t>::value)
1067 {
1068 return data_.d8x16_;
1069 }
1070 else if constexpr(is_same<X, d16_t>::value)
1071 {
1072 return data_.d16x8_;
1073 }
1074 else if constexpr(is_same<X, d32_t>::value)
1075 {
1076 return data_.d32x4_;
1077 }
1078 else if constexpr(is_same<X, d64_t>::value)
1079 {
1080 return data_.d64x2_;
1081 }
1082 else if constexpr(is_same<X, d128_t>::value)
1083 {
1084 return data_.d128x1_;
1085 }
1086 else
1087 {
1088 return err;
1089 }
1090 }
1091
1092 template <typename X>
1093 __host__ __device__ constexpr auto& AsType()
1094 {
1099 "Something went wrong, please check src and dst types.");
1100
1101 if constexpr(is_same<X, d1_t>::value)
1102 {
1103 return data_.d1x128_;
1104 }
1105 else if constexpr(is_same<X, d2_t>::value)
1106 {
1107 return data_.d2x64_;
1108 }
1109 else if constexpr(is_same<X, d4_t>::value)
1110 {
1111 return data_.d4x32_;
1112 }
1113 else if constexpr(is_same<X, d8_t>::value)
1114 {
1115 return data_.d8x16_;
1116 }
1117 else if constexpr(is_same<X, d16_t>::value)
1118 {
1119 return data_.d16x8_;
1120 }
1121 else if constexpr(is_same<X, d32_t>::value)
1122 {
1123 return data_.d32x4_;
1124 }
1125 else if constexpr(is_same<X, d64_t>::value)
1126 {
1127 return data_.d64x2_;
1128 }
1129 else if constexpr(is_same<X, d128_t>::value)
1130 {
1131 return data_.d128x1_;
1132 }
1133 else
1134 {
1135 return err;
1136 }
1137 }
1138};
1139
1140template <typename T>
1141struct vector_type<T, 256, typename ck::enable_if_t<is_native_type<T>()>>
1142{
1143 using d1_t = T;
1144 typedef T d2_t __attribute__((ext_vector_type(2)));
1145 typedef T d4_t __attribute__((ext_vector_type(4)));
1146 typedef T d8_t __attribute__((ext_vector_type(8)));
1147 typedef T d16_t __attribute__((ext_vector_type(16)));
1148 typedef T d32_t __attribute__((ext_vector_type(32)));
1149 typedef T d64_t __attribute__((ext_vector_type(64)));
1150 typedef T d128_t __attribute__((ext_vector_type(128)));
1151 typedef T d256_t __attribute__((ext_vector_type(256)));
1152
1153 using type = d256_t;
1154
1155 union
1156 {
1167 } data_ = {d256_t{0}};
1168
1169 __attribute__((host)) __attribute__((device)) constexpr vector_type() {}
1170
1171 __attribute__((host)) __attribute__((device)) constexpr vector_type(type v) { (void)v; }
1172
1173 template <typename X>
1174 __host__ __device__ constexpr const auto& AsType() const
1175 {
1176 static_assert(
1180 "Something went wrong, please check src and dst types.");
1181
1182 if constexpr(is_same<X, d1_t>::value)
1183 {
1184 return data_.d1x256_;
1185 }
1186 else if constexpr(is_same<X, d2_t>::value)
1187 {
1188 return data_.d2x128_;
1189 }
1190 else if constexpr(is_same<X, d4_t>::value)
1191 {
1192 return data_.d4x64_;
1193 }
1194 else if constexpr(is_same<X, d8_t>::value)
1195 {
1196 return data_.d8x32_;
1197 }
1198 else if constexpr(is_same<X, d16_t>::value)
1199 {
1200 return data_.d16x16_;
1201 }
1202 else if constexpr(is_same<X, d32_t>::value)
1203 {
1204 return data_.d32x8_;
1205 }
1206 else if constexpr(is_same<X, d64_t>::value)
1207 {
1208 return data_.d64x4_;
1209 }
1210 else if constexpr(is_same<X, d128_t>::value)
1211 {
1212 return data_.d128x2_;
1213 }
1214 else if constexpr(is_same<X, d256_t>::value)
1215 {
1216 return data_.d256x1_;
1217 }
1218 else
1219 {
1220 return err;
1221 }
1222 }
1223
1224 template <typename X>
1225 __host__ __device__ constexpr auto& AsType()
1226 {
1227 static_assert(
1231 "Something went wrong, please check src and dst types.");
1232
1233 if constexpr(is_same<X, d1_t>::value)
1234 {
1235 return data_.d1x256_;
1236 }
1237 else if constexpr(is_same<X, d2_t>::value)
1238 {
1239 return data_.d2x128_;
1240 }
1241 else if constexpr(is_same<X, d4_t>::value)
1242 {
1243 return data_.d4x64_;
1244 }
1245 else if constexpr(is_same<X, d8_t>::value)
1246 {
1247 return data_.d8x32_;
1248 }
1249 else if constexpr(is_same<X, d16_t>::value)
1250 {
1251 return data_.d16x16_;
1252 }
1253 else if constexpr(is_same<X, d32_t>::value)
1254 {
1255 return data_.d32x8_;
1256 }
1257 else if constexpr(is_same<X, d64_t>::value)
1258 {
1259 return data_.d64x4_;
1260 }
1261 else if constexpr(is_same<X, d128_t>::value)
1262 {
1263 return data_.d128x2_;
1264 }
1265 else if constexpr(is_same<X, d256_t>::value)
1266 {
1267 return data_.d256x1_;
1268 }
1269 else
1270 {
1271 return err;
1272 }
1273 }
1274};
1275
1276template <typename T, index_t N, typename Enable = void>
1278
1279template <typename T>
1281{
1282 using type = unsigned _BitInt(8 * sizeof(T));
1283};
1284
1285template <>
1290
1291template <>
1296
1297#ifndef CK_CODE_GEN_RTC
1298template <>
1303
1304template <>
1309
1310template <>
1315#endif
1316
1317template <>
1322
1323template <>
1328
1329template <>
1334
1335template <>
1340
1341template <>
1346
1347template <>
1352
1353template <typename T, index_t N>
1355 T,
1356 N,
1357 ck::enable_if_t<sizeof(T) == 1 || sizeof(T) == 2 || sizeof(T) == 4 || sizeof(T) == 8>>
1358{
1359 using data_t = typename nnvb_data_t_selector<T>::type; // select data_t based on the size of T
1360 static_assert(sizeof(T) == sizeof(data_t), "non_native_vector_base storage size mismatch");
1361 using data_v = data_t __attribute__((ext_vector_type(N)));
1363
1371
1372 __host__ __device__ constexpr non_native_vector_base(data_t a) : data_{data_v(a)} {}
1373 __host__ __device__ constexpr non_native_vector_base(T f)
1375 {
1376 }
1377 __host__ __device__ constexpr non_native_vector_base() : non_native_vector_base(T{}){};
1378 __host__ __device__ constexpr non_native_vector_base(data_v v) : data_{v} {}
1379
1380 __host__ __device__ constexpr operator data_v() const { return data_.dN; }
1381 __host__ __device__ constexpr operator data_t() const
1382 {
1383 if constexpr(N == 1)
1384 {
1385 return data_.dxN[Number<0>{}];
1386 }
1387 else
1388 {
1389 return data_.dxN; // XXX this should cause an error
1390 }
1391 }
1392 __host__ __device__ constexpr operator T() const
1393 {
1394 if constexpr(N == 1)
1395 {
1396 return data_.dTxN[Number<0>{}];
1397 }
1398 else
1399 {
1400 return data_.dTxN; // XXX this should cause an error
1401 }
1402 }
1403
1404 template <typename X>
1405 __host__ __device__ constexpr const auto& AsType() const
1406 {
1408 "Something went wrong, please check src and dst types.");
1409
1410 if constexpr(is_same_v<X, data_t>)
1411 {
1412 return data_.dxN;
1413 }
1414 else if constexpr(is_same_v<X, T>)
1415 {
1416 return data_.dTxN;
1417 }
1418 else if constexpr(is_same_v<X, data_v>)
1419 {
1420 return data_.dNx1;
1421 }
1422 else
1423 {
1424 return err;
1425 }
1426 }
1427
1428 template <typename X>
1429 __host__ __device__ constexpr auto& AsType()
1430 {
1432 "Something went wrong, please check src and dst types.");
1433
1434 if constexpr(is_same_v<X, data_t>)
1435 {
1436 return data_.dxN;
1437 }
1438 else if constexpr(is_same_v<X, T>)
1439 {
1440 return data_.dTxN;
1441 }
1442 else if constexpr(is_same_v<X, data_v>)
1443 {
1444 return data_.dNx1;
1445 }
1446 else
1447 {
1448 return err;
1449 }
1450 }
1451};
1452
1453// implementation for f6x16 and f6x32
1454template <typename T, index_t N>
1456 T,
1457 N,
1458 ck::enable_if_t<sizeof(T) == 12 || sizeof(T) == 16 || sizeof(T) == 24 || sizeof(T) == 32>>
1459{
1460 using data_t =
1461 typename nnvb_data_t_selector<T>::type; // select data_t based on declared base type
1462 using element_t = typename T::element_type; // select element_t based on declared element type
1463 static_assert(sizeof(T) == sizeof(data_t), "non_native_vector_base storage size mismatch");
1464 static constexpr size_t size_factor = sizeof(data_t) / sizeof(element_t);
1465 using data_v = element_t __attribute__((ext_vector_type(N * size_factor)));
1467
1475
1476 // Broadcast single value to vector
1477 __host__ __device__ constexpr non_native_vector_base(data_t a) : data_{}
1478 {
1479 // TODO: consider removing initialization similar to vector_type<T, 256>
1480
1481 ck::static_for<0, N, 1>{}([&](auto i) {
1482 data_.dxN(i) = a; // broadcast value to all elements
1483 });
1484 }
1485
1486 __host__ __device__ constexpr non_native_vector_base(T f)
1488 {
1489 }
1490
1491 __host__ __device__ constexpr non_native_vector_base() : non_native_vector_base(T{}){};
1492
1493 __host__ __device__ constexpr non_native_vector_base(data_v v) : data_{v} {}
1494
1495 __host__ __device__ constexpr non_native_vector_base(element_t v) : data_{data_v(v)} {}
1496
1497 __host__ __device__ constexpr operator data_v() const { return data_.dN; }
1498
1499 __host__ __device__ constexpr operator T() const
1500 {
1501 if constexpr(N == 1)
1502 {
1503 return data_.dTxN[Number<0>{}];
1504 }
1505 else
1506 {
1507 return err; // XXX this should cause an error
1508 }
1509 }
1510
1511 template <typename X>
1512 __host__ __device__ constexpr const auto& AsType() const
1513 {
1515 "Something went wrong, please check src and dst types.");
1516
1517 if constexpr(is_same_v<X, data_v>)
1518 {
1519 return data_.dNx1;
1520 }
1521 else if constexpr(is_same_v<X, data_t>)
1522 {
1523 return data_.dxN;
1524 }
1525 else if constexpr(is_same_v<X, T>)
1526 {
1527 return data_.dTxN;
1528 }
1529 else
1530 {
1531 return err;
1532 }
1533 }
1534};
1535
1536template <typename T, index_t N>
1538 T,
1539 N,
1540 ck::enable_if_t<sizeof(T) == 1 || sizeof(T) == 2 || sizeof(T) == 4 || sizeof(T) == 8>>>
1541{
1543 static constexpr index_t vector_size = N;
1544};
1545
1546template <typename T, index_t N>
1548 T,
1549 N,
1550 ck::enable_if_t<sizeof(T) == 12 || sizeof(T) == 16 || sizeof(T) == 24 || sizeof(T) == 32>>>
1551{
1554};
1555
1556// non-native vector_type implementation
1557template <typename T>
1558struct vector_type<T, 1, typename ck::enable_if_t<!is_native_type<T>()>>
1559{
1560 using d1_t = T;
1563
1564 union alignas(next_pow2(1 * sizeof(T)))
1565 {
1569 } data_;
1570
1571 __host__ __device__ constexpr vector_type() : data_{d1_t{}} {}
1572
1573 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
1574
1575 template <typename X>
1576 __host__ __device__ constexpr const auto& AsType() const
1577 {
1579 "Something went wrong, please check src and dst types.");
1580
1582 {
1583 return data_.d1x1_;
1584 }
1585 else
1586 {
1587 return err;
1588 }
1589 }
1590
1591 template <typename X>
1592 __host__ __device__ constexpr auto& AsType()
1593 {
1595 "Something went wrong, please check src and dst types.");
1596
1598 {
1599 return data_.d1x1_;
1600 }
1601 else
1602 {
1603 return err;
1604 }
1605 }
1606};
1607
1608template <typename T>
1609struct vector_type<T, 2, typename ck::enable_if_t<!is_native_type<T>()>>
1610{
1611 using d1_t = T;
1614
1615 using type = d2_t;
1616
1623
1624 __host__ __device__ constexpr vector_type() : data_{type{}} {}
1625
1626 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
1627
1628 template <typename X>
1629 __host__ __device__ constexpr const auto& AsType() const
1630 {
1633 "Something went wrong, please check src and dst types.");
1634
1636 {
1637 return data_.d1x2_;
1638 }
1639 else if constexpr(is_same<X, d2_t>::value)
1640 {
1641 return data_.d2x1_;
1642 }
1643 else
1644 {
1645 return err;
1646 }
1647 }
1648
1649 template <typename X>
1650 __host__ __device__ constexpr auto& AsType()
1651 {
1654 "Something went wrong, please check src and dst types.");
1655
1657 {
1658 return data_.d1x2_;
1659 }
1660 else if constexpr(is_same<X, d2_t>::value)
1661 {
1662 return data_.d2x1_;
1663 }
1664 else
1665 {
1666 return err;
1667 }
1668 }
1669};
1670
1671template <typename T>
1672struct vector_type<T, 4, typename ck::enable_if_t<!is_native_type<T>()>>
1673{
1674 using d1_t = T;
1678
1679 using type = d4_t;
1680
1688
1689 __host__ __device__ constexpr vector_type() : data_{type{}} {}
1690
1691 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
1692
1693 template <typename X>
1694 __host__ __device__ constexpr const auto& AsType() const
1695 {
1698 "Something went wrong, please check src and dst types.");
1699
1701 {
1702 return data_.d1x4_;
1703 }
1704 else if constexpr(is_same<X, d2_t>::value)
1705 {
1706 return data_.d2x2_;
1707 }
1708 else if constexpr(is_same<X, d4_t>::value)
1709 {
1710 return data_.d4x1_;
1711 }
1712 else
1713 {
1714 return err;
1715 }
1716 }
1717
1718 template <typename X>
1719 __host__ __device__ constexpr auto& AsType()
1720 {
1723 "Something went wrong, please check src and dst types.");
1724
1726 {
1727 return data_.d1x4_;
1728 }
1729 else if constexpr(is_same<X, d2_t>::value)
1730 {
1731 return data_.d2x2_;
1732 }
1733 else if constexpr(is_same<X, d4_t>::value)
1734 {
1735 return data_.d4x1_;
1736 }
1737 else
1738 {
1739 return err;
1740 }
1741 }
1742};
1743
1744template <typename T>
1745struct vector_type<T, 8, typename ck::enable_if_t<!is_native_type<T>()>>
1746{
1747 using d1_t = T;
1752
1753 using type = d8_t;
1754
1763
1764 __host__ __device__ constexpr vector_type() : data_{type{}} {}
1765
1766 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
1767
1768 template <typename X>
1769 __host__ __device__ constexpr const auto& AsType() const
1770 {
1774 "Something went wrong, please check src and dst types.");
1775
1777 {
1778 return data_.d1x8_;
1779 }
1780 else if constexpr(is_same<X, d2_t>::value)
1781 {
1782 return data_.d2x4_;
1783 }
1784 else if constexpr(is_same<X, d4_t>::value)
1785 {
1786 return data_.d4x2_;
1787 }
1788 else if constexpr(is_same<X, d8_t>::value)
1789 {
1790 return data_.d8x1_;
1791 }
1792 else
1793 {
1794 return err;
1795 }
1796 }
1797
1798 template <typename X>
1799 __host__ __device__ constexpr auto& AsType()
1800 {
1804 "Something went wrong, please check src and dst types.");
1805
1807 {
1808 return data_.d1x8_;
1809 }
1810 else if constexpr(is_same<X, d2_t>::value)
1811 {
1812 return data_.d2x4_;
1813 }
1814 else if constexpr(is_same<X, d4_t>::value)
1815 {
1816 return data_.d4x2_;
1817 }
1818 else if constexpr(is_same<X, d8_t>::value)
1819 {
1820 return data_.d8x1_;
1821 }
1822 else
1823 {
1824 return err;
1825 }
1826 }
1827};
1828
1829template <typename T>
1830struct vector_type<T, 16, typename ck::enable_if_t<!is_native_type<T>()>>
1831{
1832 using d1_t = T;
1838
1839 using type = d16_t;
1840
1850
1851 __host__ __device__ constexpr vector_type() : data_{type{}} {}
1852
1853 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
1854
1855 template <typename X>
1856 __host__ __device__ constexpr const auto& AsType() const
1857 {
1861 "Something went wrong, please check src and dst types.");
1862
1864 {
1865 return data_.d1x16_;
1866 }
1867 else if constexpr(is_same<X, d2_t>::value)
1868 {
1869 return data_.d2x8_;
1870 }
1871 else if constexpr(is_same<X, d4_t>::value)
1872 {
1873 return data_.d4x4_;
1874 }
1875 else if constexpr(is_same<X, d8_t>::value)
1876 {
1877 return data_.d8x2_;
1878 }
1879 else if constexpr(is_same<X, d16_t>::value)
1880 {
1881 return data_.d16x1_;
1882 }
1883 else
1884 {
1885 return err;
1886 }
1887 }
1888
1889 template <typename X>
1890 __host__ __device__ constexpr auto& AsType()
1891 {
1895 "Something went wrong, please check src and dst types.");
1896
1898 {
1899 return data_.d1x16_;
1900 }
1901 else if constexpr(is_same<X, d2_t>::value)
1902 {
1903 return data_.d2x8_;
1904 }
1905 else if constexpr(is_same<X, d4_t>::value)
1906 {
1907 return data_.d4x4_;
1908 }
1909 else if constexpr(is_same<X, d8_t>::value)
1910 {
1911 return data_.d8x2_;
1912 }
1913 else if constexpr(is_same<X, d16_t>::value)
1914 {
1915 return data_.d16x1_;
1916 }
1917 else
1918 {
1919 return err;
1920 }
1921 }
1922};
1923
1924template <typename T>
1925struct vector_type<T, 32, typename ck::enable_if_t<!is_native_type<T>()>>
1926{
1927 using d1_t = T;
1933
1934 using type = d32_t;
1935
1946
1947 __host__ __device__ constexpr vector_type() : data_{type{}} {}
1948
1949 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
1950
1951 template <typename X>
1952 __host__ __device__ constexpr const auto& AsType() const
1953 {
1957 "Something went wrong, please check src and dst types.");
1958
1959 if constexpr(is_same<X, d1_t>::value)
1960 {
1961 return data_.d1x32_;
1962 }
1963 else if constexpr(is_same<X, d2_t>::value)
1964 {
1965 return data_.d2x16_;
1966 }
1967 else if constexpr(is_same<X, d4_t>::value)
1968 {
1969 return data_.d4x8_;
1970 }
1971 else if constexpr(is_same<X, d8_t>::value)
1972 {
1973 return data_.d8x4_;
1974 }
1975 else if constexpr(is_same<X, d16_t>::value)
1976 {
1977 return data_.d16x2_;
1978 }
1979 else if constexpr(is_same<X, d32_t>::value)
1980 {
1981 return data_.d32x1_;
1982 }
1983 else
1984 {
1985 return err;
1986 }
1987 }
1988
1989 template <typename X>
1990 __host__ __device__ constexpr auto& AsType()
1991 {
1995 "Something went wrong, please check src and dst types.");
1996
1997 if constexpr(is_same<X, d1_t>::value)
1998 {
1999 return data_.d1x32_;
2000 }
2001 else if constexpr(is_same<X, d2_t>::value)
2002 {
2003 return data_.d2x16_;
2004 }
2005 else if constexpr(is_same<X, d4_t>::value)
2006 {
2007 return data_.d4x8_;
2008 }
2009 else if constexpr(is_same<X, d8_t>::value)
2010 {
2011 return data_.d8x4_;
2012 }
2013 else if constexpr(is_same<X, d16_t>::value)
2014 {
2015 return data_.d16x2_;
2016 }
2017 else if constexpr(is_same<X, d32_t>::value)
2018 {
2019 return data_.d32x1_;
2020 }
2021 else
2022 {
2023 return err;
2024 }
2025 }
2026};
2027
2028template <typename T>
2029struct vector_type<T, 64, typename ck::enable_if_t<!is_native_type<T>()>>
2030{
2031 using d1_t = T;
2038
2039 using type = d64_t;
2040
2052
2053 __host__ __device__ constexpr vector_type() : data_{type{}} {}
2054
2055 __host__ __device__ constexpr vector_type(type v) : data_{v} {}
2056
2057 template <typename X>
2058 __host__ __device__ constexpr const auto& AsType() const
2059 {
2064 "Something went wrong, please check src and dst types.");
2065
2066 if constexpr(is_same<X, d1_t>::value)
2067 {
2068 return data_.d1x64_;
2069 }
2070 else if constexpr(is_same<X, d2_t>::value)
2071 {
2072 return data_.d2x32_;
2073 }
2074 else if constexpr(is_same<X, d4_t>::value)
2075 {
2076 return data_.d4x16_;
2077 }
2078 else if constexpr(is_same<X, d8_t>::value)
2079 {
2080 return data_.d8x8_;
2081 }
2082 else if constexpr(is_same<X, d16_t>::value)
2083 {
2084 return data_.d16x4_;
2085 }
2086 else if constexpr(is_same<X, d32_t>::value)
2087 {
2088 return data_.d32x2_;
2089 }
2090 else if constexpr(is_same<X, d64_t>::value)
2091 {
2092 return data_.d64x1_;
2093 }
2094 else
2095 {
2096 return err;
2097 }
2098 }
2099
2100 template <typename X>
2101 __host__ __device__ constexpr auto& AsType()
2102 {
2107 "Something went wrong, please check src and dst types.");
2108
2109 if constexpr(is_same<X, d1_t>::value)
2110 {
2111 return data_.d1x64_;
2112 }
2113 else if constexpr(is_same<X, d2_t>::value)
2114 {
2115 return data_.d2x32_;
2116 }
2117 else if constexpr(is_same<X, d4_t>::value)
2118 {
2119 return data_.d4x16_;
2120 }
2121 else if constexpr(is_same<X, d8_t>::value)
2122 {
2123 return data_.d8x8_;
2124 }
2125 else if constexpr(is_same<X, d16_t>::value)
2126 {
2127 return data_.d16x4_;
2128 }
2129 else if constexpr(is_same<X, d32_t>::value)
2130 {
2131 return data_.d32x2_;
2132 }
2133 else if constexpr(is_same<X, d64_t>::value)
2134 {
2135 return data_.d64x1_;
2136 }
2137 else
2138 {
2139 return err;
2140 }
2141 }
2142};
2143
2144// fp32
2151
2152// fp16
2158
2159// bfp16
2165
2166// i32
2174
2175// i8
2182
2183// f8
2190
2191// bf8
2198
2199// f8
2206
2207// bf8
2214
2215#if CK_FP8_TYPE_OCP
2216// f8
2217using f8x2_t = f8x2_ocp_t;
2218using f8x4_t = f8x4_ocp_t;
2219using f8x8_t = f8x8_ocp_t;
2220using f8x16_t = f8x16_ocp_t;
2221using f8x32_t = f8x32_ocp_t;
2222using f8x64_t = f8x64_ocp_t;
2223
2224// bf8
2225using bf8x2_t = bf8x2_ocp_t;
2226using bf8x4_t = bf8x4_ocp_t;
2227using bf8x8_t = bf8x8_ocp_t;
2228using bf8x16_t = bf8x16_ocp_t;
2229using bf8x32_t = bf8x32_ocp_t;
2230using bf8x64_t = bf8x64_ocp_t;
2231#elif CK_FP8_TYPE_FNUZ
2232// f8
2233using f8x2_t = f8x2_fnuz_t;
2234using f8x4_t = f8x4_fnuz_t;
2235using f8x8_t = f8x8_fnuz_t;
2236using f8x16_t = f8x16_fnuz_t;
2237using f8x32_t = f8x32_fnuz_t;
2238using f8x64_t = f8x64_fnuz_t;
2239
2240// bf8
2241using bf8x2_t = bf8x2_fnuz_t;
2242using bf8x4_t = bf8x4_fnuz_t;
2243using bf8x8_t = bf8x8_fnuz_t;
2244using bf8x16_t = bf8x16_fnuz_t;
2245using bf8x32_t = bf8x32_fnuz_t;
2246using bf8x64_t = bf8x64_fnuz_t;
2247#endif
2248
2249// u8
2256
2257// f4
2264
2265// f6
2269
2270// bf6
2274
2275#ifndef CK_CODE_GEN_RTC
2276// e8m0
2278#endif
2279
2280// pack int4
2284
2285} // namespace ck
Definition ck.hpp:268
typename vector_type< float, 16 >::type float16_t
Definition dtype_vector.hpp:2148
typename vector_type< uint8_t, 4 >::type uint8x4_t
Definition dtype_vector.hpp:2251
f6_pk_t< f6_t, 16 > f6x16_pk_t
Definition data_type.hpp:180
typename vector_type< f4x2_pk_t, 32 >::type f4x64_t
Definition dtype_vector.hpp:2263
typename detail::StaticallyIndexedArrayImpl< T, N >::type StaticallyIndexedArray
Definition utility/statically_indexed_array.hpp:45
typename vector_type< f4x2_pk_t, 8 >::type f4x16_t
Definition dtype_vector.hpp:2261
typename vector_type< pk_i4_t, 2 >::type pk_i4x2_t
Definition dtype_vector.hpp:2281
__host__ __device__ constexpr auto make_vector_type(Number< N >)
Definition dtype_vector.hpp:57
typename vector_type< int32_t, 64 >::type int32x64_t
Definition dtype_vector.hpp:2173
int32_t index_t
Definition ck.hpp:299
typename vector_type< int8_t, 8 >::type int8x8_t
Definition dtype_vector.hpp:2178
typename vector_type< f4x2_pk_t, 4 >::type f4x8_t
Definition dtype_vector.hpp:2260
typename vector_type< bhalf_t, 8 >::type bhalf8_t
Definition dtype_vector.hpp:2162
typename vector_type< pk_i4_t, 8 >::type pk_i4x8_t
Definition dtype_vector.hpp:2283
typename vector_type< bf8_ocp_t, 8 >::type bf8x8_ocp_t
Definition dtype_vector.hpp:2210
typename vector_type< uint8_t, 2 >::type uint8x2_t
Definition dtype_vector.hpp:2250
typename vector_type< f4x2_pk_t, 2 >::type f4x4_t
Definition dtype_vector.hpp:2259
typename vector_type< half_t, 16 >::type half16_t
Definition dtype_vector.hpp:2156
typename vector_type< f8_fnuz_t, 2 >::type f8x2_fnuz_t
Definition dtype_vector.hpp:2184
typename vector_type< float, 64 >::type float64_t
Definition dtype_vector.hpp:2150
typename vector_type< f8_ocp_t, 32 >::type f8x32_ocp_t
Definition dtype_vector.hpp:2204
typename vector_type< f8_ocp_t, 64 >::type f8x64_ocp_t
Definition dtype_vector.hpp:2205
typename vector_type< int8_t, 4 >::type int8x4_t
Definition dtype_vector.hpp:2177
typename vector_type< f8_fnuz_t, 16 >::type f8x16_fnuz_t
Definition dtype_vector.hpp:2187
typename vector_type< f8_fnuz_t, 64 >::type f8x64_fnuz_t
Definition dtype_vector.hpp:2189
typename vector_type< bf8_ocp_t, 4 >::type bf8x4_ocp_t
Definition dtype_vector.hpp:2209
integral_constant< index_t, N > Number
Definition number.hpp:12
typename vector_type< bf8_ocp_t, 32 >::type bf8x32_ocp_t
Definition dtype_vector.hpp:2212
typename vector_type< bf8_fnuz_t, 16 >::type bf8x16_fnuz_t
Definition dtype_vector.hpp:2195
typename vector_type< uint8_t, 16 >::type uint8x16_t
Definition dtype_vector.hpp:2253
typename vector_type< int8_t, 64 >::type int8x64_t
Definition dtype_vector.hpp:2181
typename vector_type< bf8_ocp_t, 2 >::type bf8x2_ocp_t
Definition dtype_vector.hpp:2208
typename vector_type< bf8_fnuz_t, 8 >::type bf8x8_fnuz_t
Definition dtype_vector.hpp:2194
typename vector_type< int32_t, 4 >::type int32x4_t
Definition dtype_vector.hpp:2168
typename vector_type< half_t, 8 >::type half8_t
Definition dtype_vector.hpp:2155
typename vector_type< bf8_fnuz_t, 32 >::type bf8x32_fnuz_t
Definition dtype_vector.hpp:2196
typename vector_type< float, 4 >::type float4_t
Definition dtype_vector.hpp:2146
typename vector_type< int32_t, 8 >::type int32x8_t
Definition dtype_vector.hpp:2170
f6_pk_t< bf6_t, 32 > bf6x32_pk_t
Definition data_type.hpp:183
typename vector_type< float, 2 >::type float2_t
Definition dtype_vector.hpp:2145
typename vector_type< f4x2_pk_t, 1 >::type f4x2_t
Definition dtype_vector.hpp:2258
typename vector_type< uint8_t, 64 >::type uint8x64_t
Definition dtype_vector.hpp:2255
typename vector_type< int8_t, 16 >::type int8x16_t
Definition dtype_vector.hpp:2179
typename vector_type< half_t, 32 >::type half32_t
Definition dtype_vector.hpp:2157
typename vector_type< int32_t, 2 >::type int32x2_t
Definition dtype_vector.hpp:2167
typename vector_type< bhalf_t, 4 >::type bhalf4_t
Definition dtype_vector.hpp:2161
typename vector_type< int32_t, 16 >::type int32x16_t
Definition dtype_vector.hpp:2171
typename vector_type< bf6x32_pk_t, 1 >::type bf6x32_t
Definition dtype_vector.hpp:2273
f6_pk_t< f6_t, 32 > f6x32_pk_t
Definition data_type.hpp:181
typename vector_type< f8_ocp_t, 2 >::type f8x2_ocp_t
Definition dtype_vector.hpp:2200
typename vector_type< int32_t, 32 >::type int32x32_t
Definition dtype_vector.hpp:2172
typename vector_type< int32_t, 6 >::type int32x6_t
Definition dtype_vector.hpp:2169
typename vector_type< half_t, 2 >::type half2_t
Definition dtype_vector.hpp:2153
typename vector_type< bhalf_t, 32 >::type bhalf32_t
Definition dtype_vector.hpp:2164
typename vector_type< float, 32 >::type float32_t
Definition dtype_vector.hpp:2149
typename vector_type< f6x32_pk_t, 1 >::type f6x32_t
Definition dtype_vector.hpp:2268
typename vector_type< f8_ocp_t, 4 >::type f8x4_ocp_t
Definition dtype_vector.hpp:2201
typename vector_type< bhalf_t, 2 >::type bhalf2_t
Definition dtype_vector.hpp:2160
typename vector_type< f8_ocp_t, 16 >::type f8x16_ocp_t
Definition dtype_vector.hpp:2203
constexpr bool is_same_v
Definition type.hpp:283
typename vector_type< bf8_ocp_t, 64 >::type bf8x64_ocp_t
Definition dtype_vector.hpp:2213
typename vector_type< float, 8 >::type float8_t
Definition dtype_vector.hpp:2147
typename vector_type< f8_ocp_t, 8 >::type f8x8_ocp_t
Definition dtype_vector.hpp:2202
typename vector_type< bf6x16_pk_t, 2 >::type bf6x16x2_t
Definition dtype_vector.hpp:2272
typename vector_type< f8_fnuz_t, 8 >::type f8x8_fnuz_t
Definition dtype_vector.hpp:2186
typename vector_type< pk_i4_t, 4 >::type pk_i4x4_t
Definition dtype_vector.hpp:2282
typename vector_type< bhalf_t, 16 >::type bhalf16_t
Definition dtype_vector.hpp:2163
typename vector_type< bf8_ocp_t, 16 >::type bf8x16_ocp_t
Definition dtype_vector.hpp:2211
typename vector_type< e8m0_bexp_t, 4 >::type e8m0x4_bexp_t
Definition dtype_vector.hpp:2277
typename vector_type< f4x2_pk_t, 16 >::type f4x32_t
Definition dtype_vector.hpp:2262
typename vector_type< f8_fnuz_t, 4 >::type f8x4_fnuz_t
Definition dtype_vector.hpp:2185
typename vector_type< int8_t, 32 >::type int8x32_t
Definition dtype_vector.hpp:2180
__host__ __device__ constexpr Y bit_cast(const X &x)
Definition type.hpp:306
typename vector_type< f8_fnuz_t, 32 >::type f8x32_fnuz_t
Definition dtype_vector.hpp:2188
typename vector_type< bf6x16_pk_t, 1 >::type bf6x16_t
Definition dtype_vector.hpp:2271
typename vector_type< bf8_fnuz_t, 4 >::type bf8x4_fnuz_t
Definition dtype_vector.hpp:2193
typename vector_type< bf8_fnuz_t, 2 >::type bf8x2_fnuz_t
Definition dtype_vector.hpp:2192
typename vector_type< half_t, 4 >::type half4_t
Definition dtype_vector.hpp:2154
typename vector_type< uint8_t, 8 >::type uint8x8_t
Definition dtype_vector.hpp:2252
typename std::enable_if< B, T >::type enable_if_t
Definition enable_if.hpp:27
typename vector_type< f6x16_pk_t, 2 >::type f6x16x2_t
Definition dtype_vector.hpp:2267
f6_pk_t< bf6_t, 16 > bf6x16_pk_t
Definition data_type.hpp:182
typename vector_type< f6x16_pk_t, 1 >::type f6x16_t
Definition dtype_vector.hpp:2266
typename vector_type< int8_t, 2 >::type int8x2_t
Definition dtype_vector.hpp:2176
typename vector_type< bf8_fnuz_t, 64 >::type bf8x64_fnuz_t
Definition dtype_vector.hpp:2197
typename vector_type< uint8_t, 32 >::type uint8x32_t
Definition dtype_vector.hpp:2254
typename vector_type_maker< T, N >::type vector_type_maker_t
Definition dtype_vector.hpp:54
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1517
Definition amd_ck_fp8.hpp:49
unsigned char data_type
Definition amd_ck_fp8.hpp:50
Definition amd_ck_fp8.hpp:369
fp8_storage_t data_type
Definition amd_ck_fp8.hpp:370
static constexpr value_type value
Definition utility/integral_constant.hpp:13
Unsigned representation of a conventional biased Float32 exponent.
Definition utility/e8m0.hpp:26
uint8_t type
Definition utility/e8m0.hpp:27
Definition data_type.hpp:42
uint8_t type
Definition data_type.hpp:45
element_type storage_type
Definition data_type.hpp:92
Definition amd_ck_fp8.hpp:36
unsigned char data_type
Definition amd_ck_fp8.hpp:37
Definition amd_ck_fp8.hpp:323
fp8_storage_t data_type
Definition amd_ck_fp8.hpp:324
bf6x16_pk_t::storage_type type
Definition dtype_vector.hpp:1332
bf6x32_pk_t::storage_type type
Definition dtype_vector.hpp:1338
bf8_fnuz_t::data_type type
Definition dtype_vector.hpp:1307
bf8_ocp_t::data_type type
Definition dtype_vector.hpp:1294
e8m0_bexp_t::type type
Definition dtype_vector.hpp:1313
f4x2_pk_t::type type
Definition dtype_vector.hpp:1350
f6x16_pk_t::storage_type type
Definition dtype_vector.hpp:1320
f6x32_pk_t::storage_type type
Definition dtype_vector.hpp:1326
f8_fnuz_t::data_type type
Definition dtype_vector.hpp:1301
f8_ocp_t::data_type type
Definition dtype_vector.hpp:1288
pk_i4_t::type type
Definition dtype_vector.hpp:1344
Definition dtype_vector.hpp:1281
unsigned _BitInt(8 *sizeof(T)) type
Definition dtype_vector.hpp:1282
__host__ __device__ constexpr non_native_vector_base(T f)
Definition dtype_vector.hpp:1373
typename nnvb_data_t_selector< T >::type data_t
Definition dtype_vector.hpp:1359
__host__ __device__ constexpr non_native_vector_base(data_v v)
Definition dtype_vector.hpp:1378
__host__ __device__ constexpr non_native_vector_base(data_t a)
Definition dtype_vector.hpp:1372
union ck::non_native_vector_base< T, N, ck::enable_if_t< sizeof(T)==1||sizeof(T)==2||sizeof(T)==4||sizeof(T)==8 > >::alignas data_
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1405
__host__ __device__ constexpr non_native_vector_base(data_t a)
Definition dtype_vector.hpp:1477
__host__ __device__ constexpr non_native_vector_base(data_v v)
Definition dtype_vector.hpp:1493
union ck::non_native_vector_base< T, N, ck::enable_if_t< sizeof(T)==12||sizeof(T)==16||sizeof(T)==24||sizeof(T)==32 > >::alignas data_
__host__ __device__ constexpr non_native_vector_base(element_t v)
Definition dtype_vector.hpp:1495
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1512
Definition dtype_vector.hpp:1277
Definition data_type.hpp:187
int8_t type
Definition data_type.hpp:188
T type
Definition dtype_vector.hpp:37
static constexpr index_t vector_size
Definition dtype_vector.hpp:38
Definition data_type.hpp:39
Definition functional2.hpp:33
StaticallyIndexedArray< d16_t, 8 > d16x8_
Definition dtype_vector.hpp:1035
StaticallyIndexedArray< d64_t, 2 > d64x2_
Definition dtype_vector.hpp:1037
StaticallyIndexedArray< d128_t, 1 > d128x1_
Definition dtype_vector.hpp:1038
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1093
StaticallyIndexedArray< d4_t, 32 > d4x32_
Definition dtype_vector.hpp:1033
union ck::vector_type< T, 128, typename ck::enable_if_t< is_native_type< T >()> >::@202241371241025373166252363352130130115150033312 data_
StaticallyIndexedArray< d8_t, 16 > d8x16_
Definition dtype_vector.hpp:1034
StaticallyIndexedArray< d1_t, 128 > d1x128_
Definition dtype_vector.hpp:1031
constexpr vector_type(type v)
Definition dtype_vector.hpp:1043
StaticallyIndexedArray< d32_t, 4 > d32x4_
Definition dtype_vector.hpp:1036
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1046
StaticallyIndexedArray< d2_t, 64 > d2x64_
Definition dtype_vector.hpp:1032
StaticallyIndexedArray< d4_t, 3 > d4x3_
Definition dtype_vector.hpp:628
union ck::vector_type< T, 13, typename ck::enable_if_t< is_native_type< T >()> >::@156062127130067062145011300324246130017224226347 data_
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:633
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:667
StaticallyIndexedArray< d1_t, 13 > d1x13_
Definition dtype_vector.hpp:627
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:638
StaticallyIndexedArray< d13_t, 1 > d13x1_
Definition dtype_vector.hpp:630
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:635
StaticallyIndexedArray< d8_t, 1 > d8x1_
Definition dtype_vector.hpp:629
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:717
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:756
StaticallyIndexedArray< d4_t, 4 > d4x4_
Definition dtype_vector.hpp:712
StaticallyIndexedArray< d8_t, 2 > d8x2_
Definition dtype_vector.hpp:713
StaticallyIndexedArray< d2_t, 8 > d2x8_
Definition dtype_vector.hpp:711
union ck::vector_type< T, 16, typename ck::enable_if_t< is_native_type< T >()> >::@165227260166063015003202022302352217245050322065 data_
StaticallyIndexedArray< d1_t, 16 > d1x16_
Definition dtype_vector.hpp:710
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:722
StaticallyIndexedArray< d16_t, 1 > d16x1_
Definition dtype_vector.hpp:714
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:719
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1856
non_native_vector_base< T, 16 > d16_t
Definition dtype_vector.hpp:1837
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1890
non_native_vector_base< T, 2 > d2_t
Definition dtype_vector.hpp:1834
union ck::vector_type< T, 16, typename ck::enable_if_t<!is_native_type< T >()> >::alignas data_
non_native_vector_base< T, 1 > d1_nnv_t
Definition dtype_vector.hpp:1833
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:1851
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:1853
non_native_vector_base< T, 8 > d8_t
Definition dtype_vector.hpp:1836
non_native_vector_base< T, 4 > d4_t
Definition dtype_vector.hpp:1835
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:76
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:74
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:79
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:88
union ck::vector_type< T, 1, typename ck::enable_if_t< is_native_type< T >()> >::@225167146223337045370137005203233111316134352212 data_
StaticallyIndexedArray< T, 1 > d1x1_
Definition dtype_vector.hpp:71
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1592
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1576
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:1573
union ck::vector_type< T, 1, typename ck::enable_if_t<!is_native_type< T >()> >::alignas data_
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:1571
non_native_vector_base< T, 1 > d1_nnv_t
Definition dtype_vector.hpp:1561
StaticallyIndexedArray< d32_t, 8 > d32x8_
Definition dtype_vector.hpp:1163
StaticallyIndexedArray< d256_t, 1 > d256x1_
Definition dtype_vector.hpp:1166
StaticallyIndexedArray< d128_t, 2 > d128x2_
Definition dtype_vector.hpp:1165
StaticallyIndexedArray< d4_t, 64 > d4x64_
Definition dtype_vector.hpp:1160
StaticallyIndexedArray< d16_t, 16 > d16x16_
Definition dtype_vector.hpp:1162
union ck::vector_type< T, 256, typename ck::enable_if_t< is_native_type< T >()> >::@035372272373005147377210327201056137122216364205 data_
constexpr vector_type(type v)
Definition dtype_vector.hpp:1171
StaticallyIndexedArray< d64_t, 4 > d64x4_
Definition dtype_vector.hpp:1164
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1174
StaticallyIndexedArray< d8_t, 32 > d8x32_
Definition dtype_vector.hpp:1161
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1225
StaticallyIndexedArray< d2_t, 128 > d2x128_
Definition dtype_vector.hpp:1159
StaticallyIndexedArray< d1_t, 256 > d1x256_
Definition dtype_vector.hpp:1158
union ck::vector_type< T, 2, typename ck::enable_if_t< is_native_type< T >()> >::@130225347177032243247137251236330062250265001354 data_
StaticallyIndexedArray< d2_t, 1 > d2x1_
Definition dtype_vector.hpp:110
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:118
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:115
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:138
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:113
StaticallyIndexedArray< d1_t, 2 > d1x2_
Definition dtype_vector.hpp:109
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:1626
non_native_vector_base< T, 2 > d2_t
Definition dtype_vector.hpp:1613
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:1624
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1650
union ck::vector_type< T, 2, typename ck::enable_if_t<!is_native_type< T >()> >::alignas data_
non_native_vector_base< T, 1 > d1_nnv_t
Definition dtype_vector.hpp:1612
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1629
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:860
StaticallyIndexedArray< d8_t, 4 > d8x4_
Definition dtype_vector.hpp:808
constexpr vector_type(type v)
Definition dtype_vector.hpp:815
StaticallyIndexedArray< d1_t, 32 > d1x32_
Definition dtype_vector.hpp:805
StaticallyIndexedArray< d32_t, 1 > d32x1_
Definition dtype_vector.hpp:810
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:822
StaticallyIndexedArray< d16_t, 2 > d16x2_
Definition dtype_vector.hpp:809
union ck::vector_type< T, 32, typename ck::enable_if_t< is_native_type< T >()> >::@331145221004213361065145240112315321376367265260 data_
StaticallyIndexedArray< d2_t, 16 > d2x16_
Definition dtype_vector.hpp:806
StaticallyIndexedArray< d4_t, 8 > d4x8_
Definition dtype_vector.hpp:807
non_native_vector_base< T, 16 > d16_t
Definition dtype_vector.hpp:1931
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:1947
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:1949
non_native_vector_base< T, 8 > d8_t
Definition dtype_vector.hpp:1930
non_native_vector_base< T, 2 > d2_t
Definition dtype_vector.hpp:1928
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1990
non_native_vector_base< T, 4 > d4_t
Definition dtype_vector.hpp:1929
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1952
union ck::vector_type< T, 32, typename ck::enable_if_t<!is_native_type< T >()> >::alignas data_
non_native_vector_base< T, 32 > d32_t
Definition dtype_vector.hpp:1932
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:180
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:204
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:177
StaticallyIndexedArray< d3_t, 1 > d3x1_
Definition dtype_vector.hpp:172
StaticallyIndexedArray< d1_t, 3 > d1x3_
Definition dtype_vector.hpp:170
StaticallyIndexedArray< d2_t, 1 > d2x1_
Definition dtype_vector.hpp:171
union ck::vector_type< T, 3, typename ck::enable_if_t< is_native_type< T >()> >::@211371332021157120226052211202120075364077235352 data_
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:175
union ck::vector_type< T, 4, typename ck::enable_if_t< is_native_type< T >()> >::@011102301307171026362312330043335050350202337054 data_
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:247
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:245
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:250
StaticallyIndexedArray< d2_t, 2 > d2x2_
Definition dtype_vector.hpp:241
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:274
StaticallyIndexedArray< d1_t, 4 > d1x4_
Definition dtype_vector.hpp:240
StaticallyIndexedArray< d4_t, 1 > d4x1_
Definition dtype_vector.hpp:242
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:1689
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1719
non_native_vector_base< T, 2 > d2_t
Definition dtype_vector.hpp:1676
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:1691
non_native_vector_base< T, 4 > d4_t
Definition dtype_vector.hpp:1677
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1694
union ck::vector_type< T, 4, typename ck::enable_if_t<!is_native_type< T >()> >::alignas data_
non_native_vector_base< T, 1 > d1_nnv_t
Definition dtype_vector.hpp:1675
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:344
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:320
StaticallyIndexedArray< d4_t, 1 > d4x1_
Definition dtype_vector.hpp:311
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:315
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:317
StaticallyIndexedArray< d1_t, 5 > d1x5_
Definition dtype_vector.hpp:310
union ck::vector_type< T, 5, typename ck::enable_if_t< is_native_type< T >()> >::@345117206170047030123306031050121147250271031001 data_
StaticallyIndexedArray< d5_t, 1 > d5x1_
Definition dtype_vector.hpp:312
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:925
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:928
StaticallyIndexedArray< d2_t, 32 > d2x32_
Definition dtype_vector.hpp:915
StaticallyIndexedArray< d1_t, 64 > d1x64_
Definition dtype_vector.hpp:914
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:923
StaticallyIndexedArray< d4_t, 16 > d4x16_
Definition dtype_vector.hpp:916
StaticallyIndexedArray< d64_t, 1 > d64x1_
Definition dtype_vector.hpp:920
union ck::vector_type< T, 64, typename ck::enable_if_t< is_native_type< T >()> >::@343276251135117305266260212341324017066203315022 data_
StaticallyIndexedArray< d8_t, 8 > d8x8_
Definition dtype_vector.hpp:917
StaticallyIndexedArray< d32_t, 2 > d32x2_
Definition dtype_vector.hpp:919
StaticallyIndexedArray< d16_t, 4 > d16x4_
Definition dtype_vector.hpp:918
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:971
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:2055
non_native_vector_base< T, 32 > d32_t
Definition dtype_vector.hpp:2036
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:2053
non_native_vector_base< T, 2 > d2_t
Definition dtype_vector.hpp:2032
non_native_vector_base< T, 8 > d8_t
Definition dtype_vector.hpp:2034
non_native_vector_base< T, 16 > d16_t
Definition dtype_vector.hpp:2035
non_native_vector_base< T, 64 > d64_t
Definition dtype_vector.hpp:2037
union ck::vector_type< T, 64, typename ck::enable_if_t<!is_native_type< T >()> >::alignas data_
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:2101
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:2058
non_native_vector_base< T, 4 > d4_t
Definition dtype_vector.hpp:2033
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:421
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:389
StaticallyIndexedArray< d6_t, 1 > d6x1_
Definition dtype_vector.hpp:384
StaticallyIndexedArray< d3_t, 2 > d3x2_
Definition dtype_vector.hpp:383
StaticallyIndexedArray< d2_t, 3 > d2x3_
Definition dtype_vector.hpp:382
union ck::vector_type< T, 6, typename ck::enable_if_t< is_native_type< T >()> >::@114105064372076236227322341226332005235336177113 data_
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:387
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:392
StaticallyIndexedArray< d1_t, 6 > d1x6_
Definition dtype_vector.hpp:381
StaticallyIndexedArray< d1_t, 7 > d1x7_
Definition dtype_vector.hpp:463
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:474
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:503
StaticallyIndexedArray< d2_t, 3 > d2x3_
Definition dtype_vector.hpp:464
StaticallyIndexedArray< d4_t, 1 > d4x1_
Definition dtype_vector.hpp:465
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:471
union ck::vector_type< T, 7, typename ck::enable_if_t< is_native_type< T >()> >::@205010012041165331005316356146032312020333133253 data_
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:469
StaticallyIndexedArray< d7_t, 1 > d7x1_
Definition dtype_vector.hpp:466
union ck::vector_type< T, 8, typename ck::enable_if_t< is_native_type< T >()> >::@350250362234013341055145340205157112346266026100 data_
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:556
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:553
StaticallyIndexedArray< d8_t, 1 > d8x1_
Definition dtype_vector.hpp:548
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:585
StaticallyIndexedArray< d2_t, 4 > d2x4_
Definition dtype_vector.hpp:546
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:551
StaticallyIndexedArray< d1_t, 8 > d1x8_
Definition dtype_vector.hpp:545
StaticallyIndexedArray< d4_t, 2 > d4x2_
Definition dtype_vector.hpp:547
non_native_vector_base< T, 8 > d8_t
Definition dtype_vector.hpp:1751
__host__ __device__ constexpr const auto & AsType() const
Definition dtype_vector.hpp:1769
non_native_vector_base< T, 4 > d4_t
Definition dtype_vector.hpp:1750
non_native_vector_base< T, 1 > d1_nnv_t
Definition dtype_vector.hpp:1748
__host__ __device__ constexpr vector_type()
Definition dtype_vector.hpp:1764
__host__ __device__ constexpr vector_type(type v)
Definition dtype_vector.hpp:1766
union ck::vector_type< T, 8, typename ck::enable_if_t<!is_native_type< T >()> >::alignas data_
__host__ __device__ constexpr auto & AsType()
Definition dtype_vector.hpp:1799
non_native_vector_base< T, 2 > d2_t
Definition dtype_vector.hpp:1749
vector_type< T, N0 *N1 > type
Definition dtype_vector.hpp:44
vector_type< T, N0 *N1 > type
Definition dtype_vector.hpp:50
Definition dtype_vector.hpp:30
vector_type< T, N > type
Definition dtype_vector.hpp:31
Definition dtype_vector.hpp:10
StaticallyIndexedArray< d16_t, 1 > d16x1_
Definition dtype_vector.hpp:1848
StaticallyIndexedArray< d4_t, 4 > d4x4_
Definition dtype_vector.hpp:1846
StaticallyIndexedArray< d1_t, 16 > d1x16_
Definition dtype_vector.hpp:1844
StaticallyIndexedArray< d2_t, 8 > d2x8_
Definition dtype_vector.hpp:1845
StaticallyIndexedArray< d8_t, 2 > d8x2_
Definition dtype_vector.hpp:1847
StaticallyIndexedArray< d1_t, 1 > d1x1_
Definition dtype_vector.hpp:1567
StaticallyIndexedArray< d1_t, 2 > d1x2_
Definition dtype_vector.hpp:1620
StaticallyIndexedArray< d2_t, 1 > d2x1_
Definition dtype_vector.hpp:1621
StaticallyIndexedArray< d1_t, 32 > d1x32_
Definition dtype_vector.hpp:1939
StaticallyIndexedArray< d8_t, 4 > d8x4_
Definition dtype_vector.hpp:1942
StaticallyIndexedArray< d16_t, 2 > d16x2_
Definition dtype_vector.hpp:1943
StaticallyIndexedArray< d32_t, 1 > d32x1_
Definition dtype_vector.hpp:1944
StaticallyIndexedArray< d4_t, 8 > d4x8_
Definition dtype_vector.hpp:1941
StaticallyIndexedArray< d2_t, 16 > d2x16_
Definition dtype_vector.hpp:1940
StaticallyIndexedArray< d2_t, 2 > d2x2_
Definition dtype_vector.hpp:1685
StaticallyIndexedArray< d1_t, 4 > d1x4_
Definition dtype_vector.hpp:1684
StaticallyIndexedArray< d4_t, 1 > d4x1_
Definition dtype_vector.hpp:1686
StaticallyIndexedArray< d8_t, 8 > d8x8_
Definition dtype_vector.hpp:2047
StaticallyIndexedArray< d1_t, 64 > d1x64_
Definition dtype_vector.hpp:2044
StaticallyIndexedArray< d64_t, 1 > d64x1_
Definition dtype_vector.hpp:2050
StaticallyIndexedArray< d4_t, 16 > d4x16_
Definition dtype_vector.hpp:2046
StaticallyIndexedArray< d16_t, 4 > d16x4_
Definition dtype_vector.hpp:2048
StaticallyIndexedArray< d32_t, 2 > d32x2_
Definition dtype_vector.hpp:2049
StaticallyIndexedArray< d2_t, 32 > d2x32_
Definition dtype_vector.hpp:2045
StaticallyIndexedArray< d2_t, 4 > d2x4_
Definition dtype_vector.hpp:1759
StaticallyIndexedArray< d8_t, 1 > d8x1_
Definition dtype_vector.hpp:1761
StaticallyIndexedArray< d4_t, 2 > d4x2_
Definition dtype_vector.hpp:1760
StaticallyIndexedArray< d1_t, 8 > d1x8_
Definition dtype_vector.hpp:1758