1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
//! Original PTX specification:
//!
//! // Thread fence:
//! fence{.sem}.scope;
//! // Thread fence (uni-directional):
//! fence.acquire.sync_restrict::shared::cluster.cluster;
//! fence.release.sync_restrict::shared::cta.cluster;
//! // Operation fence (uni-directional):
//! fence.op_restrict.release.cluster;
//! // Proxy fence (bi-directional):
//! fence.proxy.proxykind;
//! // Proxy fence (uni-directional):
//! fence.proxy.to_proxykind::from_proxykind.release.scope;
//! fence.proxy.to_proxykind::from_proxykind.acquire.scope [addr], size;
//! fence.proxy.async::generic.acquire.sync_restrict::shared::cluster.cluster;
//! fence.proxy.async::generic.release.sync_restrict::shared::cta.cluster;
//! // Old style membar:
//! membar.level;
//! membar.proxy.proxykind;
//! .sem = { .sc, .acq_rel, .acquire, .release };
//! .scope = { .cta, .cluster, .gpu, .sys };
//! .level = { .cta, .gl, .sys };
//! .proxykind = { .alias, .async, .async.global, .async.shared::cta, .async.shared::cluster};
//! .op_restrict = { .mbarrier_init };
//! .to_proxykind::from_proxykind = {.tensormap::generic};
#![allow(unused)]
use crate::r#type::common::*;
pub mod section_0 {
use crate::Spanned;
use crate::parser::Span;
use crate::r#type::common::*;
use serde::Serialize;
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Sem {
AcqRel, // .acq_rel
Acquire, // .acquire
Release, // .release
Sc, // .sc
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Scope {
Cluster, // .cluster
Cta, // .cta
Gpu, // .gpu
Sys, // .sys
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum OpRestrict {
MbarrierInit, // .mbarrier_init
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Proxykind {
AsyncSharedCluster, // .async.shared::cluster
AsyncSharedCta, // .async.shared::cta
AsyncGlobal, // .async.global
Alias, // .alias
Async, // .async
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum ToProxykindFromProxykind {
TensormapGeneric, // .tensormap::generic
}
#[derive(Debug, Clone, PartialEq, Serialize)]
pub enum Level {
Cta, // .cta
Sys, // .sys
Gl, // .gl
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceSemScope {
pub sem: Option<Sem>, // {.sem}
pub scope: Scope, // .scope
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceAcquireSyncRestrictSharedClusterCluster {
pub acquire: (), // .acquire
pub sync_restrict_shared_cluster: (), // .sync_restrict::shared::cluster
pub cluster: (), // .cluster
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceReleaseSyncRestrictSharedCtaCluster {
pub release: (), // .release
pub sync_restrict_shared_cta: (), // .sync_restrict::shared::cta
pub cluster: (), // .cluster
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceOpRestrictReleaseCluster {
pub op_restrict: OpRestrict, // .op_restrict
pub release: (), // .release
pub cluster: (), // .cluster
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceProxyProxykind {
pub proxy: (), // .proxy
pub proxykind: Proxykind, // .proxykind
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceProxyToProxykindFromProxykindReleaseScope {
pub proxy: (), // .proxy
pub to_proxykind_from_proxykind: ToProxykindFromProxykind, // .to_proxykind::from_proxykind
pub release: (), // .release
pub scope: Scope, // .scope
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceProxyToProxykindFromProxykindAcquireScope {
pub proxy: (), // .proxy
pub to_proxykind_from_proxykind: ToProxykindFromProxykind, // .to_proxykind::from_proxykind
pub acquire: (), // .acquire
pub scope: Scope, // .scope
pub addr: AddressOperand, // [addr]
pub size: GeneralOperand, // size
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceProxyAsyncGenericAcquireSyncRestrictSharedClusterCluster {
pub proxy: (), // .proxy
pub async_generic: (), // .async::generic
pub acquire: (), // .acquire
pub sync_restrict_shared_cluster: (), // .sync_restrict::shared::cluster
pub cluster: (), // .cluster
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct FenceProxyAsyncGenericReleaseSyncRestrictSharedCtaCluster {
pub proxy: (), // .proxy
pub async_generic: (), // .async::generic
pub release: (), // .release
pub sync_restrict_shared_cta: (), // .sync_restrict::shared::cta
pub cluster: (), // .cluster
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct MembarLevel {
pub level: Level, // .level
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
pub struct MembarProxyProxykind {
pub proxy: (), // .proxy
pub proxykind: Proxykind, // .proxykind
pub span: Span,
}
}
// Re-export types with section suffixes to avoid naming conflicts
// e.g., Type0 for section_0::Type, Type1 for section_1::Type
pub use section_0::FenceAcquireSyncRestrictSharedClusterCluster;
pub use section_0::FenceOpRestrictReleaseCluster;
pub use section_0::FenceProxyAsyncGenericAcquireSyncRestrictSharedClusterCluster;
pub use section_0::FenceProxyAsyncGenericReleaseSyncRestrictSharedCtaCluster;
pub use section_0::FenceProxyProxykind;
pub use section_0::FenceProxyToProxykindFromProxykindAcquireScope;
pub use section_0::FenceProxyToProxykindFromProxykindReleaseScope;
pub use section_0::FenceReleaseSyncRestrictSharedCtaCluster;
pub use section_0::FenceSemScope;
pub use section_0::Level as Level0;
pub use section_0::MembarLevel;
pub use section_0::MembarProxyProxykind;
pub use section_0::OpRestrict as OpRestrict0;
pub use section_0::Proxykind as Proxykind0;
pub use section_0::Scope as Scope0;
pub use section_0::Sem as Sem0;
pub use section_0::ToProxykindFromProxykind as ToProxykindFromProxykind0;