Skip to main content

ptx_parser/unparser/instruction/
griddepcontrol.rs

1//! Original PTX specification:
2//!
3//! griddepcontrol.action;
4//! .action   = { .launch_dependents, .wait };
5
6#![allow(unused)]
7
8use crate::lexer::PtxToken;
9use crate::unparser::{PtxUnparser, common::*};
10
11pub mod section_0 {
12    use super::*;
13    use crate::r#type::instruction::griddepcontrol::section_0::*;
14
15    impl PtxUnparser for GriddepcontrolAction {
16        fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
17            self.unparse_tokens_mode(tokens, false);
18        }
19        fn unparse_tokens_mode(&self, tokens: &mut ::std::vec::Vec<PtxToken>, spaced: bool) {
20            push_opcode(tokens, "griddepcontrol");
21            match &self.action {
22                Action::LaunchDependents => {
23                    push_directive(tokens, "launch_dependents");
24                }
25                Action::Wait => {
26                    push_directive(tokens, "wait");
27                }
28            }
29            tokens.push(PtxToken::Semicolon);
30            if spaced {
31                tokens.push(PtxToken::Newline);
32            }
33        }
34    }
35}