Skip to main content

ptx_parser/unparser/instruction/
tensormap_cp_fenceproxy.rs

1//! Original PTX specification:
2//!
3//! tensormap.cp_fenceproxy.cp_qualifiers.fence_qualifiers.sync.aligned  [dst], [src], size;
4//! .cp_qualifiers    = { .global.shared::cta };
5//! .fence_qualifiers = { .to_proxy::from_proxy.release.scope };
6//! .to_proxy::from_proxy  = { .tensormap::generic };
7//! .scope            = { .cta, .cluster, .gpu , .sys };
8
9#![allow(unused)]
10
11use crate::lexer::PtxToken;
12use crate::unparser::{PtxUnparser, common::*};
13
14pub mod section_0 {
15    use super::*;
16    use crate::r#type::instruction::tensormap_cp_fenceproxy::section_0::*;
17
18    impl PtxUnparser for TensormapCpFenceproxyCpQualifiersFenceQualifiersSyncAligned {
19        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
20            self.unparse_tokens_mode(tokens, false);
21        }
22        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
23            push_opcode(tokens, "tensormap");
24            push_directive(tokens, "cp_fenceproxy");
25            match &self.cp_qualifiers {
26                CpQualifiers::GlobalSharedCta => {
27                    push_directive(tokens, "global.shared::cta");
28                }
29            }
30            match &self.fence_qualifiers {
31                FenceQualifiers::ToProxyFromProxyReleaseScope(_, _, _) => {
32                    push_directive(tokens, "tensormap::generic");
33                    push_directive(tokens, "release");
34                    push_directive(tokens, "cluster");
35                    push_directive(tokens, "cta");
36                    push_directive(tokens, "gpu");
37                    push_directive(tokens, "sys");
38                }
39            }
40            push_directive(tokens, "sync");
41            push_directive(tokens, "aligned");
42            if spaced {
43                tokens.push(PtxToken::Space);
44            }
45            self.dst.unparse_tokens_mode(tokens, spaced);
46            tokens.push(PtxToken::Comma);
47            if spaced {
48                tokens.push(PtxToken::Space);
49            }
50            self.src.unparse_tokens_mode(tokens, spaced);
51            tokens.push(PtxToken::Comma);
52            if spaced {
53                tokens.push(PtxToken::Space);
54            }
55            self.size.unparse_tokens_mode(tokens, spaced);
56            tokens.push(PtxToken::Semicolon);
57            if spaced {
58                tokens.push(PtxToken::Newline);
59            }
60        }
61    }
62}