ptx_parser/parser/instruction/
tcgen05_wait.rs1#![allow(unused)]
7
8use crate::parser::{
9 PtxParseError, PtxParser, PtxTokenStream, Span,
10 util::{
11 between, comma_p, directive_p, exclamation_p, lbracket_p, lparen_p, map, minus_p, optional,
12 pipe_p, rbracket_p, rparen_p, semicolon_p, sep_by, string_p, try_map,
13 },
14};
15use crate::r#type::common::*;
16use crate::{alt, ok, seq_n};
17
18pub mod section_0 {
19 use super::*;
20 use crate::r#type::instruction::tcgen05_wait::section_0::*;
21
22 impl PtxParser for WaitOperation {
27 fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
28 alt!(
29 map(string_p(".wait::ld"), |_, _span| WaitOperation::WaitLd),
30 map(string_p(".wait::st"), |_, _span| WaitOperation::WaitSt)
31 )
32 }
33 }
34
35 impl PtxParser for Tcgen05WaitOperationSyncAligned {
36 fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
37 try_map(
38 seq_n!(
39 string_p("tcgen05"),
40 WaitOperation::parse(),
41 string_p(".sync"),
42 string_p(".aligned"),
43 semicolon_p()
44 ),
45 |(_, wait_operation, sync, aligned, _), span| {
46 ok!(Tcgen05WaitOperationSyncAligned {
47 wait_operation = wait_operation,
48 sync = sync,
49 aligned = aligned,
50
51 })
52 },
53 )
54 }
55 }
56}