Skip to main content

ptx_parser/parser/instruction/
clusterlaunchcontrol_query_cancel.rs

1//! Original PTX specification:
2//!
3//! clusterlaunchcontrol.query_cancel.is_canceled.pred.b128 pred, try_cancel_response;
4//! clusterlaunchcontrol.query_cancel.get_first_ctaid.v4.b32.b128 {xdim, ydim, zdim, _},  try_cancel_response;
5//! clusterlaunchcontrol.query_cancel{.get_first_ctaid::dimension}.b32.b128 reg, try_cancel_response;
6//! .get_first_ctaid::dimension = { .get_first_ctaid::x, .get_first_ctaid::y, .get_first_ctaid::z };
7
8#![allow(unused)]
9
10use crate::parser::{
11    PtxParseError, PtxParser, PtxTokenStream, Span,
12    util::{
13        between, comma_p, directive_p, exclamation_p, lbracket_p, lparen_p, map, minus_p, optional,
14        pipe_p, rbracket_p, rparen_p, semicolon_p, sep_by, string_p, try_map,
15    },
16};
17use crate::r#type::common::*;
18use crate::{alt, ok, seq_n};
19
20pub mod section_0 {
21    use super::*;
22    use crate::r#type::instruction::clusterlaunchcontrol_query_cancel::section_0::*;
23
24    // ============================================================================
25    // Generated enum parsers
26    // ============================================================================
27
28    impl PtxParser for GetFirstCtaidDimension {
29        fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
30            alt!(
31                map(string_p(".get_first_ctaid::x"), |_, _span| {
32                    GetFirstCtaidDimension::GetFirstCtaidX
33                }),
34                map(string_p(".get_first_ctaid::y"), |_, _span| {
35                    GetFirstCtaidDimension::GetFirstCtaidY
36                }),
37                map(string_p(".get_first_ctaid::z"), |_, _span| {
38                    GetFirstCtaidDimension::GetFirstCtaidZ
39                })
40            )
41        }
42    }
43
44    impl PtxParser for ClusterlaunchcontrolQueryCancelIsCanceledPredB128 {
45        fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
46            try_map(
47                seq_n!(
48                    string_p("clusterlaunchcontrol"),
49                    string_p(".query_cancel"),
50                    string_p(".is_canceled"),
51                    string_p(".pred"),
52                    string_p(".b128"),
53                    GeneralOperand::parse(),
54                    comma_p(),
55                    GeneralOperand::parse(),
56                    semicolon_p()
57                ),
58                |(_, query_cancel, is_canceled, pred, b128, pred2, _, try_cancel_response, _),
59                 span| {
60                    ok!(ClusterlaunchcontrolQueryCancelIsCanceledPredB128 {
61                        query_cancel = query_cancel,
62                        is_canceled = is_canceled,
63                        pred = pred,
64                        b128 = b128,
65                        pred2 = pred2,
66                        try_cancel_response = try_cancel_response,
67
68                    })
69                },
70            )
71        }
72    }
73
74    impl PtxParser for ClusterlaunchcontrolQueryCancelGetFirstCtaidV4B32B128 {
75        fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
76            try_map(
77                seq_n!(
78                    string_p("clusterlaunchcontrol"),
79                    string_p(".query_cancel"),
80                    string_p(".get_first_ctaid"),
81                    string_p(".v4"),
82                    string_p(".b32"),
83                    string_p(".b128"),
84                    VectorOperand::parse(),
85                    comma_p(),
86                    GeneralOperand::parse(),
87                    semicolon_p()
88                ),
89                |(
90                    _,
91                    query_cancel,
92                    get_first_ctaid,
93                    v4,
94                    b32,
95                    b128,
96                    xdim,
97                    _,
98                    try_cancel_response,
99                    _,
100                ),
101                 span| {
102                    ok!(ClusterlaunchcontrolQueryCancelGetFirstCtaidV4B32B128 {
103                        query_cancel = query_cancel,
104                        get_first_ctaid = get_first_ctaid,
105                        v4 = v4,
106                        b32 = b32,
107                        b128 = b128,
108                        xdim = xdim,
109                        try_cancel_response = try_cancel_response,
110
111                    })
112                },
113            )
114        }
115    }
116
117    impl PtxParser for ClusterlaunchcontrolQueryCancelGetFirstCtaidDimensionB32B128 {
118        fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
119            try_map(
120                seq_n!(
121                    string_p("clusterlaunchcontrol"),
122                    string_p(".query_cancel"),
123                    optional(GetFirstCtaidDimension::parse()),
124                    string_p(".b32"),
125                    string_p(".b128"),
126                    GeneralOperand::parse(),
127                    comma_p(),
128                    GeneralOperand::parse(),
129                    semicolon_p()
130                ),
131                |(
132                    _,
133                    query_cancel,
134                    get_first_ctaid_dimension,
135                    b32,
136                    b128,
137                    reg,
138                    _,
139                    try_cancel_response,
140                    _,
141                ),
142                 span| {
143                    ok!(ClusterlaunchcontrolQueryCancelGetFirstCtaidDimensionB32B128 {
144                        query_cancel = query_cancel,
145                        get_first_ctaid_dimension = get_first_ctaid_dimension,
146                        b32 = b32,
147                        b128 = b128,
148                        reg = reg,
149                        try_cancel_response = try_cancel_response,
150
151                    })
152                },
153            )
154        }
155    }
156}