Skip to main content

ptx_parser/unparser/instruction/
mma_sp.rs

1//! Original PTX specification:
2//!
3//! // Half precision floating point type:
4//! mma.spvariant.sync.aligned.m16n8k16.row.col.dtype.f16.f16.ctype  d, a, b, c, e, f;
5//! mma.spvariant.sync.aligned.m16n8k32.row.col.dtype.f16.f16.ctype  d, a, b, c, e, f;
6//! .ctype     = {.f16, .f32};
7//! .dtype     = {.f16, .f32};
8//! .spvariant = {.sp, .sp::ordered_metadata};
9//! ----------------------------------------------------
10//! // Alternate floating point type:
11//! mma.spvariant.sync.aligned.m16n8k16.row.col.f32.bf16.bf16.f32     d, a, b, c, e, f;
12//! mma.spvariant.sync.aligned.m16n8k32.row.col.f32.bf16.bf16.f32     d, a, b, c, e, f;
13//! mma.spvariant.sync.aligned.m16n8k8.row.col.f32.tf32.tf32.f32      d, a, b, c, e, f;
14//! mma.spvariant.sync.aligned.m16n8k16.row.col.f32.tf32.tf32.f32     d, a, b, c, e, f;
15//! mma.spvariant.sync.aligned.m16n8k64.row.col.f32.f8type.f8type.f32 d, a, b, c, e, f;
16//! mma.sp::ordered_metadata.sync.aligned.m16n8k64.row.col.kind.dtype.f8f6f4type.f8f6f4type.ctype d, a, b, c, e, f;
17//! .f8type     = {.e4m3, .e5m2};
18//! .spvariant  = {.sp, .sp::ordered_metadata};
19//! .f8f6f4type = {.e4m3, .e5m2, .e3m2, .e2m3, .e2m1};
20//! .kind       = {.kind::f8f6f4};
21//! .ctype      = {.f16, .f32};
22//! .dtype      = {.f16, .f32};
23//! ----------------------------------------------------
24//! // Alternate floating point type:
25//! // Alternate floating point type with block scaling:
26//! mma.spvariant.sync.aligned.m16n8k128.row.col.kind.block_scale{.scale_vec_size}.f32.e2m1.e2m1.f32.stype d, a, b, c, e, f, scale-a-data, {byte-id-a, thread-id-a}, scale-b-data, {byte-id-b, thread-id-b};
27//! .spvariant      = {.sp::ordered_metadata};
28//! .kind           = {.kind::mxf4};
29//! .scale_vec_size = {.scale_vec::2X};
30//! .stype          = {.ue8m0};
31//! ----------------------------------------------------
32//! // Alternate floating point type:
33//! mma.spvariant.sync.aligned.m16n8k128.row.col.kind.block_scale.scale_vec_size.f32.e2m1.e2m1.f32.stype d, a, b, c, e, f, scale-a-data, {byte-id-a, thread-id-a}, scale-b-data, {byte-id-b, thread-id-b};
34//! .spvariant      = {.sp::ordered_metadata};
35//! .kind           = {.kind::mxf4nvf4};
36//! .scale_vec_size = {.scale_vec::2X, .scale_vec::4X};
37//! .stype          = {.ue8m0, .ue4m3};
38//! ----------------------------------------------------
39//! // Alternate floating point type:
40//! mma.spvariant.sync.aligned.m16n8k64.row.col.kind.block_scale{.scale_vec_size}.f32.f8f6f4type.f8f6f4type.f32.stype d, a, b, c, e, f, scale-a-data, {byte-id-a, thread-id-a}, scale-b-data, {byte-id-b, thread-id-b};
41//! .spvariant      = {.sp::ordered_metadata};
42//! .kind           = {.kind::mxf8f6f4};
43//! .scale_vec_size = {.scale_vec::1X};
44//! .f8f6f4type     = {.e4m3, .e5m2, .e3m2, .e2m3, .e2m1};
45//! .stype          = {.ue8m0};
46//! ----------------------------------------------------
47//! // Alternate floating point type:
48//! // Integer type:
49//! mma.spvariant.sync.aligned.shape.row.col{.satfinite}.s32.atype.btype.s32 d, a, b, c, e, f;
50//! .shape     = {.m16n8k32, .m16n8k64};
51//! .atype     = {.u8, .s8};
52//! .btype     = {.u8, .s8};
53//! .spvariant = {.sp, .sp::ordered_metadata};
54//! ----------------------------------------------------
55//! // Alternate floating point type:
56//! mma.spvariant.sync.aligned.shape.row.col{.satfinite}.s32.atype.btype.s32 d, a, b, c, e, f;
57//! .shape     = {.m16n8k64, .m16n8k128};
58//! .atype     = {.u4, .s4};
59//! .btype     = {.u4, .s4};
60//! .spvariant = {.sp, .sp::ordered_metadata};
61
62#![allow(unused)]
63
64use crate::lexer::PtxToken;
65use crate::unparser::{PtxUnparser, common::*};
66
67pub mod section_0 {
68    use super::*;
69    use crate::r#type::instruction::mma_sp::section_0::*;
70
71    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k16RowColDtypeF16F16Ctype {
72        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
73            self.unparse_tokens_mode(tokens, false);
74        }
75        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
76            push_opcode(tokens, "mma");
77            match &self.spvariant {
78                Spvariant::SpOrderedMetadata => {
79                    push_directive(tokens, "sp::ordered_metadata");
80                }
81                Spvariant::Sp => {
82                    push_directive(tokens, "sp");
83                }
84            }
85            push_directive(tokens, "sync");
86            push_directive(tokens, "aligned");
87            push_directive(tokens, "m16n8k16");
88            push_directive(tokens, "row");
89            push_directive(tokens, "col");
90            match &self.dtype {
91                Dtype::F16 => {
92                    push_directive(tokens, "f16");
93                }
94                Dtype::F32 => {
95                    push_directive(tokens, "f32");
96                }
97            }
98            push_directive(tokens, "f16");
99            push_directive(tokens, "f16");
100            match &self.ctype {
101                Ctype::F16 => {
102                    push_directive(tokens, "f16");
103                }
104                Ctype::F32 => {
105                    push_directive(tokens, "f32");
106                }
107            }
108            if spaced {
109                tokens.push(PtxToken::Space);
110            }
111            self.d.unparse_tokens_mode(tokens, spaced);
112            tokens.push(PtxToken::Comma);
113            if spaced {
114                tokens.push(PtxToken::Space);
115            }
116            self.a.unparse_tokens_mode(tokens, spaced);
117            tokens.push(PtxToken::Comma);
118            if spaced {
119                tokens.push(PtxToken::Space);
120            }
121            self.b.unparse_tokens_mode(tokens, spaced);
122            tokens.push(PtxToken::Comma);
123            if spaced {
124                tokens.push(PtxToken::Space);
125            }
126            self.c.unparse_tokens_mode(tokens, spaced);
127            tokens.push(PtxToken::Comma);
128            if spaced {
129                tokens.push(PtxToken::Space);
130            }
131            self.e.unparse_tokens_mode(tokens, spaced);
132            tokens.push(PtxToken::Comma);
133            if spaced {
134                tokens.push(PtxToken::Space);
135            }
136            self.f.unparse_tokens_mode(tokens, spaced);
137            tokens.push(PtxToken::Semicolon);
138            if spaced {
139                tokens.push(PtxToken::Newline);
140            }
141        }
142    }
143
144    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k32RowColDtypeF16F16Ctype {
145        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
146            self.unparse_tokens_mode(tokens, false);
147        }
148        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
149            push_opcode(tokens, "mma");
150            match &self.spvariant {
151                Spvariant::SpOrderedMetadata => {
152                    push_directive(tokens, "sp::ordered_metadata");
153                }
154                Spvariant::Sp => {
155                    push_directive(tokens, "sp");
156                }
157            }
158            push_directive(tokens, "sync");
159            push_directive(tokens, "aligned");
160            push_directive(tokens, "m16n8k32");
161            push_directive(tokens, "row");
162            push_directive(tokens, "col");
163            match &self.dtype {
164                Dtype::F16 => {
165                    push_directive(tokens, "f16");
166                }
167                Dtype::F32 => {
168                    push_directive(tokens, "f32");
169                }
170            }
171            push_directive(tokens, "f16");
172            push_directive(tokens, "f16");
173            match &self.ctype {
174                Ctype::F16 => {
175                    push_directive(tokens, "f16");
176                }
177                Ctype::F32 => {
178                    push_directive(tokens, "f32");
179                }
180            }
181            if spaced {
182                tokens.push(PtxToken::Space);
183            }
184            self.d.unparse_tokens_mode(tokens, spaced);
185            tokens.push(PtxToken::Comma);
186            if spaced {
187                tokens.push(PtxToken::Space);
188            }
189            self.a.unparse_tokens_mode(tokens, spaced);
190            tokens.push(PtxToken::Comma);
191            if spaced {
192                tokens.push(PtxToken::Space);
193            }
194            self.b.unparse_tokens_mode(tokens, spaced);
195            tokens.push(PtxToken::Comma);
196            if spaced {
197                tokens.push(PtxToken::Space);
198            }
199            self.c.unparse_tokens_mode(tokens, spaced);
200            tokens.push(PtxToken::Comma);
201            if spaced {
202                tokens.push(PtxToken::Space);
203            }
204            self.e.unparse_tokens_mode(tokens, spaced);
205            tokens.push(PtxToken::Comma);
206            if spaced {
207                tokens.push(PtxToken::Space);
208            }
209            self.f.unparse_tokens_mode(tokens, spaced);
210            tokens.push(PtxToken::Semicolon);
211            if spaced {
212                tokens.push(PtxToken::Newline);
213            }
214        }
215    }
216}
217
218pub mod section_1 {
219    use super::*;
220    use crate::r#type::instruction::mma_sp::section_1::*;
221
222    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k16RowColF32Bf16Bf16F32 {
223        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
224            self.unparse_tokens_mode(tokens, false);
225        }
226        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
227            push_opcode(tokens, "mma");
228            match &self.spvariant {
229                Spvariant::SpOrderedMetadata => {
230                    push_directive(tokens, "sp::ordered_metadata");
231                }
232                Spvariant::Sp => {
233                    push_directive(tokens, "sp");
234                }
235            }
236            push_directive(tokens, "sync");
237            push_directive(tokens, "aligned");
238            push_directive(tokens, "m16n8k16");
239            push_directive(tokens, "row");
240            push_directive(tokens, "col");
241            push_directive(tokens, "f32");
242            push_directive(tokens, "bf16");
243            push_directive(tokens, "bf16");
244            push_directive(tokens, "f32");
245            if spaced {
246                tokens.push(PtxToken::Space);
247            }
248            self.d.unparse_tokens_mode(tokens, spaced);
249            tokens.push(PtxToken::Comma);
250            if spaced {
251                tokens.push(PtxToken::Space);
252            }
253            self.a.unparse_tokens_mode(tokens, spaced);
254            tokens.push(PtxToken::Comma);
255            if spaced {
256                tokens.push(PtxToken::Space);
257            }
258            self.b.unparse_tokens_mode(tokens, spaced);
259            tokens.push(PtxToken::Comma);
260            if spaced {
261                tokens.push(PtxToken::Space);
262            }
263            self.c.unparse_tokens_mode(tokens, spaced);
264            tokens.push(PtxToken::Comma);
265            if spaced {
266                tokens.push(PtxToken::Space);
267            }
268            self.e.unparse_tokens_mode(tokens, spaced);
269            tokens.push(PtxToken::Comma);
270            if spaced {
271                tokens.push(PtxToken::Space);
272            }
273            self.f.unparse_tokens_mode(tokens, spaced);
274            tokens.push(PtxToken::Semicolon);
275            if spaced {
276                tokens.push(PtxToken::Newline);
277            }
278        }
279    }
280
281    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k32RowColF32Bf16Bf16F32 {
282        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
283            self.unparse_tokens_mode(tokens, false);
284        }
285        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
286            push_opcode(tokens, "mma");
287            match &self.spvariant {
288                Spvariant::SpOrderedMetadata => {
289                    push_directive(tokens, "sp::ordered_metadata");
290                }
291                Spvariant::Sp => {
292                    push_directive(tokens, "sp");
293                }
294            }
295            push_directive(tokens, "sync");
296            push_directive(tokens, "aligned");
297            push_directive(tokens, "m16n8k32");
298            push_directive(tokens, "row");
299            push_directive(tokens, "col");
300            push_directive(tokens, "f32");
301            push_directive(tokens, "bf16");
302            push_directive(tokens, "bf16");
303            push_directive(tokens, "f32");
304            if spaced {
305                tokens.push(PtxToken::Space);
306            }
307            self.d.unparse_tokens_mode(tokens, spaced);
308            tokens.push(PtxToken::Comma);
309            if spaced {
310                tokens.push(PtxToken::Space);
311            }
312            self.a.unparse_tokens_mode(tokens, spaced);
313            tokens.push(PtxToken::Comma);
314            if spaced {
315                tokens.push(PtxToken::Space);
316            }
317            self.b.unparse_tokens_mode(tokens, spaced);
318            tokens.push(PtxToken::Comma);
319            if spaced {
320                tokens.push(PtxToken::Space);
321            }
322            self.c.unparse_tokens_mode(tokens, spaced);
323            tokens.push(PtxToken::Comma);
324            if spaced {
325                tokens.push(PtxToken::Space);
326            }
327            self.e.unparse_tokens_mode(tokens, spaced);
328            tokens.push(PtxToken::Comma);
329            if spaced {
330                tokens.push(PtxToken::Space);
331            }
332            self.f.unparse_tokens_mode(tokens, spaced);
333            tokens.push(PtxToken::Semicolon);
334            if spaced {
335                tokens.push(PtxToken::Newline);
336            }
337        }
338    }
339
340    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k8RowColF32Tf32Tf32F32 {
341        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
342            self.unparse_tokens_mode(tokens, false);
343        }
344        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
345            push_opcode(tokens, "mma");
346            match &self.spvariant {
347                Spvariant::SpOrderedMetadata => {
348                    push_directive(tokens, "sp::ordered_metadata");
349                }
350                Spvariant::Sp => {
351                    push_directive(tokens, "sp");
352                }
353            }
354            push_directive(tokens, "sync");
355            push_directive(tokens, "aligned");
356            push_directive(tokens, "m16n8k8");
357            push_directive(tokens, "row");
358            push_directive(tokens, "col");
359            push_directive(tokens, "f32");
360            push_directive(tokens, "tf32");
361            push_directive(tokens, "tf32");
362            push_directive(tokens, "f32");
363            if spaced {
364                tokens.push(PtxToken::Space);
365            }
366            self.d.unparse_tokens_mode(tokens, spaced);
367            tokens.push(PtxToken::Comma);
368            if spaced {
369                tokens.push(PtxToken::Space);
370            }
371            self.a.unparse_tokens_mode(tokens, spaced);
372            tokens.push(PtxToken::Comma);
373            if spaced {
374                tokens.push(PtxToken::Space);
375            }
376            self.b.unparse_tokens_mode(tokens, spaced);
377            tokens.push(PtxToken::Comma);
378            if spaced {
379                tokens.push(PtxToken::Space);
380            }
381            self.c.unparse_tokens_mode(tokens, spaced);
382            tokens.push(PtxToken::Comma);
383            if spaced {
384                tokens.push(PtxToken::Space);
385            }
386            self.e.unparse_tokens_mode(tokens, spaced);
387            tokens.push(PtxToken::Comma);
388            if spaced {
389                tokens.push(PtxToken::Space);
390            }
391            self.f.unparse_tokens_mode(tokens, spaced);
392            tokens.push(PtxToken::Semicolon);
393            if spaced {
394                tokens.push(PtxToken::Newline);
395            }
396        }
397    }
398
399    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k16RowColF32Tf32Tf32F32 {
400        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
401            self.unparse_tokens_mode(tokens, false);
402        }
403        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
404            push_opcode(tokens, "mma");
405            match &self.spvariant {
406                Spvariant::SpOrderedMetadata => {
407                    push_directive(tokens, "sp::ordered_metadata");
408                }
409                Spvariant::Sp => {
410                    push_directive(tokens, "sp");
411                }
412            }
413            push_directive(tokens, "sync");
414            push_directive(tokens, "aligned");
415            push_directive(tokens, "m16n8k16");
416            push_directive(tokens, "row");
417            push_directive(tokens, "col");
418            push_directive(tokens, "f32");
419            push_directive(tokens, "tf32");
420            push_directive(tokens, "tf32");
421            push_directive(tokens, "f32");
422            if spaced {
423                tokens.push(PtxToken::Space);
424            }
425            self.d.unparse_tokens_mode(tokens, spaced);
426            tokens.push(PtxToken::Comma);
427            if spaced {
428                tokens.push(PtxToken::Space);
429            }
430            self.a.unparse_tokens_mode(tokens, spaced);
431            tokens.push(PtxToken::Comma);
432            if spaced {
433                tokens.push(PtxToken::Space);
434            }
435            self.b.unparse_tokens_mode(tokens, spaced);
436            tokens.push(PtxToken::Comma);
437            if spaced {
438                tokens.push(PtxToken::Space);
439            }
440            self.c.unparse_tokens_mode(tokens, spaced);
441            tokens.push(PtxToken::Comma);
442            if spaced {
443                tokens.push(PtxToken::Space);
444            }
445            self.e.unparse_tokens_mode(tokens, spaced);
446            tokens.push(PtxToken::Comma);
447            if spaced {
448                tokens.push(PtxToken::Space);
449            }
450            self.f.unparse_tokens_mode(tokens, spaced);
451            tokens.push(PtxToken::Semicolon);
452            if spaced {
453                tokens.push(PtxToken::Newline);
454            }
455        }
456    }
457
458    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k64RowColF32F8typeF8typeF32 {
459        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
460            self.unparse_tokens_mode(tokens, false);
461        }
462        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
463            push_opcode(tokens, "mma");
464            match &self.spvariant {
465                Spvariant::SpOrderedMetadata => {
466                    push_directive(tokens, "sp::ordered_metadata");
467                }
468                Spvariant::Sp => {
469                    push_directive(tokens, "sp");
470                }
471            }
472            push_directive(tokens, "sync");
473            push_directive(tokens, "aligned");
474            push_directive(tokens, "m16n8k64");
475            push_directive(tokens, "row");
476            push_directive(tokens, "col");
477            push_directive(tokens, "f32");
478            match &self.f8type {
479                F8type::E4m3 => {
480                    push_directive(tokens, "e4m3");
481                }
482                F8type::E5m2 => {
483                    push_directive(tokens, "e5m2");
484                }
485            }
486            match &self.f8type1 {
487                F8type::E4m3 => {
488                    push_directive(tokens, "e4m3");
489                }
490                F8type::E5m2 => {
491                    push_directive(tokens, "e5m2");
492                }
493            }
494            push_directive(tokens, "f32");
495            if spaced {
496                tokens.push(PtxToken::Space);
497            }
498            self.d.unparse_tokens_mode(tokens, spaced);
499            tokens.push(PtxToken::Comma);
500            if spaced {
501                tokens.push(PtxToken::Space);
502            }
503            self.a.unparse_tokens_mode(tokens, spaced);
504            tokens.push(PtxToken::Comma);
505            if spaced {
506                tokens.push(PtxToken::Space);
507            }
508            self.b.unparse_tokens_mode(tokens, spaced);
509            tokens.push(PtxToken::Comma);
510            if spaced {
511                tokens.push(PtxToken::Space);
512            }
513            self.c.unparse_tokens_mode(tokens, spaced);
514            tokens.push(PtxToken::Comma);
515            if spaced {
516                tokens.push(PtxToken::Space);
517            }
518            self.e.unparse_tokens_mode(tokens, spaced);
519            tokens.push(PtxToken::Comma);
520            if spaced {
521                tokens.push(PtxToken::Space);
522            }
523            self.f.unparse_tokens_mode(tokens, spaced);
524            tokens.push(PtxToken::Semicolon);
525            if spaced {
526                tokens.push(PtxToken::Newline);
527            }
528        }
529    }
530
531    impl PtxUnparser
532        for MmaSpOrderedMetadataSyncAlignedM16n8k64RowColKindDtypeF8f6f4typeF8f6f4typeCtype
533    {
534        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
535            self.unparse_tokens_mode(tokens, false);
536        }
537        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
538            push_opcode(tokens, "mma");
539            push_directive(tokens, "sp::ordered_metadata");
540            push_directive(tokens, "sync");
541            push_directive(tokens, "aligned");
542            push_directive(tokens, "m16n8k64");
543            push_directive(tokens, "row");
544            push_directive(tokens, "col");
545            match &self.kind {
546                Kind::KindF8f6f4 => {
547                    push_directive(tokens, "kind::f8f6f4");
548                }
549            }
550            match &self.dtype {
551                Dtype::F16 => {
552                    push_directive(tokens, "f16");
553                }
554                Dtype::F32 => {
555                    push_directive(tokens, "f32");
556                }
557            }
558            match &self.f8f6f4type {
559                F8f6f4type::E4m3 => {
560                    push_directive(tokens, "e4m3");
561                }
562                F8f6f4type::E5m2 => {
563                    push_directive(tokens, "e5m2");
564                }
565                F8f6f4type::E3m2 => {
566                    push_directive(tokens, "e3m2");
567                }
568                F8f6f4type::E2m3 => {
569                    push_directive(tokens, "e2m3");
570                }
571                F8f6f4type::E2m1 => {
572                    push_directive(tokens, "e2m1");
573                }
574            }
575            match &self.f8f6f4type1 {
576                F8f6f4type::E4m3 => {
577                    push_directive(tokens, "e4m3");
578                }
579                F8f6f4type::E5m2 => {
580                    push_directive(tokens, "e5m2");
581                }
582                F8f6f4type::E3m2 => {
583                    push_directive(tokens, "e3m2");
584                }
585                F8f6f4type::E2m3 => {
586                    push_directive(tokens, "e2m3");
587                }
588                F8f6f4type::E2m1 => {
589                    push_directive(tokens, "e2m1");
590                }
591            }
592            match &self.ctype {
593                Ctype::F16 => {
594                    push_directive(tokens, "f16");
595                }
596                Ctype::F32 => {
597                    push_directive(tokens, "f32");
598                }
599            }
600            if spaced {
601                tokens.push(PtxToken::Space);
602            }
603            self.d.unparse_tokens_mode(tokens, spaced);
604            tokens.push(PtxToken::Comma);
605            if spaced {
606                tokens.push(PtxToken::Space);
607            }
608            self.a.unparse_tokens_mode(tokens, spaced);
609            tokens.push(PtxToken::Comma);
610            if spaced {
611                tokens.push(PtxToken::Space);
612            }
613            self.b.unparse_tokens_mode(tokens, spaced);
614            tokens.push(PtxToken::Comma);
615            if spaced {
616                tokens.push(PtxToken::Space);
617            }
618            self.c.unparse_tokens_mode(tokens, spaced);
619            tokens.push(PtxToken::Comma);
620            if spaced {
621                tokens.push(PtxToken::Space);
622            }
623            self.e.unparse_tokens_mode(tokens, spaced);
624            tokens.push(PtxToken::Comma);
625            if spaced {
626                tokens.push(PtxToken::Space);
627            }
628            self.f.unparse_tokens_mode(tokens, spaced);
629            tokens.push(PtxToken::Semicolon);
630            if spaced {
631                tokens.push(PtxToken::Newline);
632            }
633        }
634    }
635}
636
637pub mod section_2 {
638    use super::*;
639    use crate::r#type::instruction::mma_sp::section_2::*;
640
641    impl PtxUnparser
642        for MmaSpvariantSyncAlignedM16n8k128RowColKindBlockScaleScaleVecSizeF32E2m1E2m1F32Stype
643    {
644        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
645            self.unparse_tokens_mode(tokens, false);
646        }
647        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
648            push_opcode(tokens, "mma");
649            match &self.spvariant {
650                Spvariant::SpOrderedMetadata => {
651                    push_directive(tokens, "sp::ordered_metadata");
652                }
653            }
654            push_directive(tokens, "sync");
655            push_directive(tokens, "aligned");
656            push_directive(tokens, "m16n8k128");
657            push_directive(tokens, "row");
658            push_directive(tokens, "col");
659            match &self.kind {
660                Kind::KindMxf4 => {
661                    push_directive(tokens, "kind::mxf4");
662                }
663            }
664            push_directive(tokens, "block_scale");
665            if let Some(scale_vec_size_0) = self.scale_vec_size.as_ref() {
666                match scale_vec_size_0 {
667                    ScaleVecSize::ScaleVec2x => {
668                        push_directive(tokens, "scale_vec::2X");
669                    }
670                }
671            }
672            push_directive(tokens, "f32");
673            push_directive(tokens, "e2m1");
674            push_directive(tokens, "e2m1");
675            push_directive(tokens, "f32");
676            match &self.stype {
677                Stype::Ue8m0 => {
678                    push_directive(tokens, "ue8m0");
679                }
680            }
681            if spaced {
682                tokens.push(PtxToken::Space);
683            }
684            self.d.unparse_tokens_mode(tokens, spaced);
685            tokens.push(PtxToken::Comma);
686            if spaced {
687                tokens.push(PtxToken::Space);
688            }
689            self.a.unparse_tokens_mode(tokens, spaced);
690            tokens.push(PtxToken::Comma);
691            if spaced {
692                tokens.push(PtxToken::Space);
693            }
694            self.b.unparse_tokens_mode(tokens, spaced);
695            tokens.push(PtxToken::Comma);
696            if spaced {
697                tokens.push(PtxToken::Space);
698            }
699            self.c.unparse_tokens_mode(tokens, spaced);
700            tokens.push(PtxToken::Comma);
701            if spaced {
702                tokens.push(PtxToken::Space);
703            }
704            self.e.unparse_tokens_mode(tokens, spaced);
705            tokens.push(PtxToken::Comma);
706            if spaced {
707                tokens.push(PtxToken::Space);
708            }
709            self.f.unparse_tokens_mode(tokens, spaced);
710            tokens.push(PtxToken::Comma);
711            if spaced {
712                tokens.push(PtxToken::Space);
713            }
714            self.scale_a_data.unparse_tokens_mode(tokens, spaced);
715            tokens.push(PtxToken::Comma);
716            if spaced {
717                tokens.push(PtxToken::Space);
718            }
719            self.byte_id_a.unparse_tokens_mode(tokens, spaced);
720            tokens.push(PtxToken::Comma);
721            if spaced {
722                tokens.push(PtxToken::Space);
723            }
724            self.scale_b_data.unparse_tokens_mode(tokens, spaced);
725            tokens.push(PtxToken::Comma);
726            if spaced {
727                tokens.push(PtxToken::Space);
728            }
729            self.byte_id_b.unparse_tokens_mode(tokens, spaced);
730            tokens.push(PtxToken::Semicolon);
731            if spaced {
732                tokens.push(PtxToken::Newline);
733            }
734        }
735    }
736}
737
738pub mod section_3 {
739    use super::*;
740    use crate::r#type::instruction::mma_sp::section_3::*;
741
742    impl PtxUnparser
743        for MmaSpvariantSyncAlignedM16n8k128RowColKindBlockScaleScaleVecSizeF32E2m1E2m1F32Stype1
744    {
745        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
746            self.unparse_tokens_mode(tokens, false);
747        }
748        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
749            push_opcode(tokens, "mma");
750            match &self.spvariant {
751                Spvariant::SpOrderedMetadata => {
752                    push_directive(tokens, "sp::ordered_metadata");
753                }
754            }
755            push_directive(tokens, "sync");
756            push_directive(tokens, "aligned");
757            push_directive(tokens, "m16n8k128");
758            push_directive(tokens, "row");
759            push_directive(tokens, "col");
760            match &self.kind {
761                Kind::KindMxf4nvf4 => {
762                    push_directive(tokens, "kind::mxf4nvf4");
763                }
764            }
765            push_directive(tokens, "block_scale");
766            match &self.scale_vec_size {
767                ScaleVecSize::ScaleVec2x => {
768                    push_directive(tokens, "scale_vec::2X");
769                }
770                ScaleVecSize::ScaleVec4x => {
771                    push_directive(tokens, "scale_vec::4X");
772                }
773            }
774            push_directive(tokens, "f32");
775            push_directive(tokens, "e2m1");
776            push_directive(tokens, "e2m1");
777            push_directive(tokens, "f32");
778            match &self.stype {
779                Stype::Ue8m0 => {
780                    push_directive(tokens, "ue8m0");
781                }
782                Stype::Ue4m3 => {
783                    push_directive(tokens, "ue4m3");
784                }
785            }
786            if spaced {
787                tokens.push(PtxToken::Space);
788            }
789            self.d.unparse_tokens_mode(tokens, spaced);
790            tokens.push(PtxToken::Comma);
791            if spaced {
792                tokens.push(PtxToken::Space);
793            }
794            self.a.unparse_tokens_mode(tokens, spaced);
795            tokens.push(PtxToken::Comma);
796            if spaced {
797                tokens.push(PtxToken::Space);
798            }
799            self.b.unparse_tokens_mode(tokens, spaced);
800            tokens.push(PtxToken::Comma);
801            if spaced {
802                tokens.push(PtxToken::Space);
803            }
804            self.c.unparse_tokens_mode(tokens, spaced);
805            tokens.push(PtxToken::Comma);
806            if spaced {
807                tokens.push(PtxToken::Space);
808            }
809            self.e.unparse_tokens_mode(tokens, spaced);
810            tokens.push(PtxToken::Comma);
811            if spaced {
812                tokens.push(PtxToken::Space);
813            }
814            self.f.unparse_tokens_mode(tokens, spaced);
815            tokens.push(PtxToken::Comma);
816            if spaced {
817                tokens.push(PtxToken::Space);
818            }
819            self.scale_a_data.unparse_tokens_mode(tokens, spaced);
820            tokens.push(PtxToken::Comma);
821            if spaced {
822                tokens.push(PtxToken::Space);
823            }
824            self.byte_id_a.unparse_tokens_mode(tokens, spaced);
825            tokens.push(PtxToken::Comma);
826            if spaced {
827                tokens.push(PtxToken::Space);
828            }
829            self.scale_b_data.unparse_tokens_mode(tokens, spaced);
830            tokens.push(PtxToken::Comma);
831            if spaced {
832                tokens.push(PtxToken::Space);
833            }
834            self.byte_id_b.unparse_tokens_mode(tokens, spaced);
835            tokens.push(PtxToken::Semicolon);
836            if spaced {
837                tokens.push(PtxToken::Newline);
838            }
839        }
840    }
841}
842
843pub mod section_4 {
844    use super::*;
845    use crate::r#type::instruction::mma_sp::section_4::*;
846
847    impl PtxUnparser for MmaSpvariantSyncAlignedM16n8k64RowColKindBlockScaleScaleVecSizeF32F8f6f4typeF8f6f4typeF32Stype {
848        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
849            self.unparse_tokens_mode(tokens, false);
850        }
851        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
852            push_opcode(tokens, "mma");
853                    match &self.spvariant {
854                            Spvariant::SpOrderedMetadata => {
855                                    push_directive(tokens, "sp::ordered_metadata");
856                            }
857                    }
858                    push_directive(tokens, "sync");
859                    push_directive(tokens, "aligned");
860                    push_directive(tokens, "m16n8k64");
861                    push_directive(tokens, "row");
862                    push_directive(tokens, "col");
863                    match &self.kind {
864                            Kind::KindMxf8f6f4 => {
865                                    push_directive(tokens, "kind::mxf8f6f4");
866                            }
867                    }
868                    push_directive(tokens, "block_scale");
869                    if let Some(scale_vec_size_1) = self.scale_vec_size.as_ref() {
870                            match scale_vec_size_1 {
871                                    ScaleVecSize::ScaleVec1x => {
872                                            push_directive(tokens, "scale_vec::1X");
873                                    }
874                            }
875                    }
876                    push_directive(tokens, "f32");
877                    match &self.f8f6f4type {
878                            F8f6f4type::E4m3 => {
879                                    push_directive(tokens, "e4m3");
880                            }
881                            F8f6f4type::E5m2 => {
882                                    push_directive(tokens, "e5m2");
883                            }
884                            F8f6f4type::E3m2 => {
885                                    push_directive(tokens, "e3m2");
886                            }
887                            F8f6f4type::E2m3 => {
888                                    push_directive(tokens, "e2m3");
889                            }
890                            F8f6f4type::E2m1 => {
891                                    push_directive(tokens, "e2m1");
892                            }
893                    }
894                    match &self.f8f6f4type1 {
895                            F8f6f4type::E4m3 => {
896                                    push_directive(tokens, "e4m3");
897                            }
898                            F8f6f4type::E5m2 => {
899                                    push_directive(tokens, "e5m2");
900                            }
901                            F8f6f4type::E3m2 => {
902                                    push_directive(tokens, "e3m2");
903                            }
904                            F8f6f4type::E2m3 => {
905                                    push_directive(tokens, "e2m3");
906                            }
907                            F8f6f4type::E2m1 => {
908                                    push_directive(tokens, "e2m1");
909                            }
910                    }
911                    push_directive(tokens, "f32");
912                    match &self.stype {
913                            Stype::Ue8m0 => {
914                                    push_directive(tokens, "ue8m0");
915                            }
916                    }
917                    if spaced { tokens.push(PtxToken::Space); }
918                    self.d.unparse_tokens_mode(tokens, spaced);
919            tokens.push(PtxToken::Comma);
920                    if spaced { tokens.push(PtxToken::Space); }
921                    self.a.unparse_tokens_mode(tokens, spaced);
922            tokens.push(PtxToken::Comma);
923                    if spaced { tokens.push(PtxToken::Space); }
924                    self.b.unparse_tokens_mode(tokens, spaced);
925            tokens.push(PtxToken::Comma);
926                    if spaced { tokens.push(PtxToken::Space); }
927                    self.c.unparse_tokens_mode(tokens, spaced);
928            tokens.push(PtxToken::Comma);
929                    if spaced { tokens.push(PtxToken::Space); }
930                    self.e.unparse_tokens_mode(tokens, spaced);
931            tokens.push(PtxToken::Comma);
932                    if spaced { tokens.push(PtxToken::Space); }
933                    self.f.unparse_tokens_mode(tokens, spaced);
934            tokens.push(PtxToken::Comma);
935                    if spaced { tokens.push(PtxToken::Space); }
936                    self.scale_a_data.unparse_tokens_mode(tokens, spaced);
937            tokens.push(PtxToken::Comma);
938                    if spaced { tokens.push(PtxToken::Space); }
939                    self.byte_id_a.unparse_tokens_mode(tokens, spaced);
940            tokens.push(PtxToken::Comma);
941                    if spaced { tokens.push(PtxToken::Space); }
942                    self.scale_b_data.unparse_tokens_mode(tokens, spaced);
943            tokens.push(PtxToken::Comma);
944                    if spaced { tokens.push(PtxToken::Space); }
945                    self.byte_id_b.unparse_tokens_mode(tokens, spaced);
946            tokens.push(PtxToken::Semicolon);
947            if spaced { tokens.push(PtxToken::Newline); }
948        }
949    }
950}
951
952pub mod section_5 {
953    use super::*;
954    use crate::r#type::instruction::mma_sp::section_5::*;
955
956    impl PtxUnparser for MmaSpvariantSyncAlignedShapeRowColSatfiniteS32AtypeBtypeS32 {
957        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
958            self.unparse_tokens_mode(tokens, false);
959        }
960        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
961            push_opcode(tokens, "mma");
962            match &self.spvariant {
963                Spvariant::SpOrderedMetadata => {
964                    push_directive(tokens, "sp::ordered_metadata");
965                }
966                Spvariant::Sp => {
967                    push_directive(tokens, "sp");
968                }
969            }
970            push_directive(tokens, "sync");
971            push_directive(tokens, "aligned");
972            match &self.shape {
973                Shape::M16n8k32 => {
974                    push_directive(tokens, "m16n8k32");
975                }
976                Shape::M16n8k64 => {
977                    push_directive(tokens, "m16n8k64");
978                }
979            }
980            push_directive(tokens, "row");
981            push_directive(tokens, "col");
982            if self.satfinite {
983                push_directive(tokens, "satfinite");
984            }
985            push_directive(tokens, "s32");
986            match &self.atype {
987                Atype::U8 => {
988                    push_directive(tokens, "u8");
989                }
990                Atype::S8 => {
991                    push_directive(tokens, "s8");
992                }
993            }
994            match &self.btype {
995                Btype::U8 => {
996                    push_directive(tokens, "u8");
997                }
998                Btype::S8 => {
999                    push_directive(tokens, "s8");
1000                }
1001            }
1002            push_directive(tokens, "s32");
1003            if spaced {
1004                tokens.push(PtxToken::Space);
1005            }
1006            self.d.unparse_tokens_mode(tokens, spaced);
1007            tokens.push(PtxToken::Comma);
1008            if spaced {
1009                tokens.push(PtxToken::Space);
1010            }
1011            self.a.unparse_tokens_mode(tokens, spaced);
1012            tokens.push(PtxToken::Comma);
1013            if spaced {
1014                tokens.push(PtxToken::Space);
1015            }
1016            self.b.unparse_tokens_mode(tokens, spaced);
1017            tokens.push(PtxToken::Comma);
1018            if spaced {
1019                tokens.push(PtxToken::Space);
1020            }
1021            self.c.unparse_tokens_mode(tokens, spaced);
1022            tokens.push(PtxToken::Comma);
1023            if spaced {
1024                tokens.push(PtxToken::Space);
1025            }
1026            self.e.unparse_tokens_mode(tokens, spaced);
1027            tokens.push(PtxToken::Comma);
1028            if spaced {
1029                tokens.push(PtxToken::Space);
1030            }
1031            self.f.unparse_tokens_mode(tokens, spaced);
1032            tokens.push(PtxToken::Semicolon);
1033            if spaced {
1034                tokens.push(PtxToken::Newline);
1035            }
1036        }
1037    }
1038}
1039
1040pub mod section_6 {
1041    use super::*;
1042    use crate::r#type::instruction::mma_sp::section_6::*;
1043
1044    impl PtxUnparser for MmaSpvariantSyncAlignedShapeRowColSatfiniteS32AtypeBtypeS321 {
1045        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
1046            self.unparse_tokens_mode(tokens, false);
1047        }
1048        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
1049            push_opcode(tokens, "mma");
1050            match &self.spvariant {
1051                Spvariant::SpOrderedMetadata => {
1052                    push_directive(tokens, "sp::ordered_metadata");
1053                }
1054                Spvariant::Sp => {
1055                    push_directive(tokens, "sp");
1056                }
1057            }
1058            push_directive(tokens, "sync");
1059            push_directive(tokens, "aligned");
1060            match &self.shape {
1061                Shape::M16n8k128 => {
1062                    push_directive(tokens, "m16n8k128");
1063                }
1064                Shape::M16n8k64 => {
1065                    push_directive(tokens, "m16n8k64");
1066                }
1067            }
1068            push_directive(tokens, "row");
1069            push_directive(tokens, "col");
1070            if self.satfinite {
1071                push_directive(tokens, "satfinite");
1072            }
1073            push_directive(tokens, "s32");
1074            match &self.atype {
1075                Atype::U4 => {
1076                    push_directive(tokens, "u4");
1077                }
1078                Atype::S4 => {
1079                    push_directive(tokens, "s4");
1080                }
1081            }
1082            match &self.btype {
1083                Btype::U4 => {
1084                    push_directive(tokens, "u4");
1085                }
1086                Btype::S4 => {
1087                    push_directive(tokens, "s4");
1088                }
1089            }
1090            push_directive(tokens, "s32");
1091            if spaced {
1092                tokens.push(PtxToken::Space);
1093            }
1094            self.d.unparse_tokens_mode(tokens, spaced);
1095            tokens.push(PtxToken::Comma);
1096            if spaced {
1097                tokens.push(PtxToken::Space);
1098            }
1099            self.a.unparse_tokens_mode(tokens, spaced);
1100            tokens.push(PtxToken::Comma);
1101            if spaced {
1102                tokens.push(PtxToken::Space);
1103            }
1104            self.b.unparse_tokens_mode(tokens, spaced);
1105            tokens.push(PtxToken::Comma);
1106            if spaced {
1107                tokens.push(PtxToken::Space);
1108            }
1109            self.c.unparse_tokens_mode(tokens, spaced);
1110            tokens.push(PtxToken::Comma);
1111            if spaced {
1112                tokens.push(PtxToken::Space);
1113            }
1114            self.e.unparse_tokens_mode(tokens, spaced);
1115            tokens.push(PtxToken::Comma);
1116            if spaced {
1117                tokens.push(PtxToken::Space);
1118            }
1119            self.f.unparse_tokens_mode(tokens, spaced);
1120            tokens.push(PtxToken::Semicolon);
1121            if spaced {
1122                tokens.push(PtxToken::Newline);
1123            }
1124        }
1125    }
1126}