1#![allow(non_snake_case)]
21#![allow(clippy::too_many_arguments)]
23
24use crate::ir::attrs::Attrs;
32use crate::ir::attrs::AttrsObj;
33use std::ops::Deref;
34use tvm_ffi::DLDataType;
35use tvm_ffi::ObjectArc;
36use tvm_ffi::String;
37#[allow(missing_docs)]
45#[repr(C)]
46#[derive(tvm_ffi::derive::ObjectRef, Clone)]
47pub struct TCGen05InstrDescriptorAttrs {
48 data_: ObjectArc<TCGen05InstrDescriptorAttrsObj>,
49}
50
51#[allow(non_snake_case)]
54#[allow(missing_docs)]
55#[repr(C)]
56#[derive(tvm_ffi::derive::Object)]
57#[object(type_key = "tirx.cuda.TCGen05InstrDescriptorAttrs", final, immutable)]
58pub struct TCGen05InstrDescriptorAttrsObj {
59 base_: AttrsObj,
60 pub d_dtype: String,
61 pub a_dtype: String,
62 pub b_dtype: String,
63 pub M: i64,
64 pub N: i64,
65 pub K: i64,
66 pub trans_a: bool,
67 pub trans_b: bool,
68 pub n_cta_groups: i64,
69 pub neg_a: bool,
70 pub neg_b: bool,
71 pub sat_d: bool,
72 pub is_sparse: bool,
73}
74
75const _: () = {
76 assert!(::core::mem::size_of::<TCGen05InstrDescriptorAttrsObj>() == 120);
77 assert!(::core::mem::align_of::<TCGen05InstrDescriptorAttrsObj>() == 8);
78};
79
80impl Deref for TCGen05InstrDescriptorAttrsObj {
81 type Target = AttrsObj;
82 fn deref(&self) -> &AttrsObj {
83 &self.base_
84 }
85}
86
87#[allow(missing_docs)]
88impl TCGen05InstrDescriptorAttrsObj {
89 #[allow(non_snake_case)]
90 pub(crate) fn new(
91 d_dtype: String,
92 a_dtype: String,
93 b_dtype: String,
94 M: i64,
95 N: i64,
96 K: i64,
97 trans_a: bool,
98 trans_b: bool,
99 n_cta_groups: i64,
100 neg_a: bool,
101 neg_b: bool,
102 sat_d: bool,
103 is_sparse: bool,
104 ) -> Self {
105 let base_ = AttrsObj::new();
106 Self {
107 base_,
108 d_dtype,
109 a_dtype,
110 b_dtype,
111 M,
112 N,
113 K,
114 trans_a,
115 trans_b,
116 n_cta_groups,
117 neg_a,
118 neg_b,
119 sat_d,
120 is_sparse,
121 }
122 }
123}
124
125#[allow(missing_docs)]
126impl TCGen05InstrDescriptorAttrs {
127 #[allow(non_snake_case)]
129 pub fn new(
130 d_dtype: impl Into<String>,
131 a_dtype: impl Into<String>,
132 b_dtype: impl Into<String>,
133 M: i64,
134 N: i64,
135 K: i64,
136 trans_a: bool,
137 trans_b: bool,
138 n_cta_groups: i64,
139 neg_a: bool,
140 neg_b: bool,
141 sat_d: bool,
142 is_sparse: bool,
143 ) -> Self {
144 let obj = TCGen05InstrDescriptorAttrsObj::new(
145 d_dtype.into(),
146 a_dtype.into(),
147 b_dtype.into(),
148 M,
149 N,
150 K,
151 trans_a,
152 trans_b,
153 n_cta_groups,
154 neg_a,
155 neg_b,
156 sat_d,
157 is_sparse,
158 );
159 Self { data_: ObjectArc::new(obj) }
160 }
161}
162
163tvm_ffi::impl_object_ref_upcast!(TCGen05InstrDescriptorAttrs => Attrs);
164#[allow(missing_docs)]
172#[repr(C)]
173#[derive(tvm_ffi::derive::ObjectRef, Clone)]
174pub struct TCGen05InstrDescriptorBlockScaledAttrs {
175 data_: ObjectArc<TCGen05InstrDescriptorBlockScaledAttrsObj>,
176}
177
178#[allow(non_snake_case)]
181#[allow(missing_docs)]
182#[repr(C)]
183#[derive(tvm_ffi::derive::Object)]
184#[object(type_key = "tirx.cuda.TCGen05InstrDescriptorBlockScaledAttrs", final, immutable)]
185pub struct TCGen05InstrDescriptorBlockScaledAttrsObj {
186 base_: AttrsObj,
187 pub d_dtype: String,
188 pub a_dtype: String,
189 pub b_dtype: String,
190 pub sfa_dtype: String,
191 pub sfb_dtype: String,
192 pub M: i64,
193 pub N: i64,
194 pub K: i64,
195 pub trans_a: bool,
196 pub trans_b: bool,
197 pub n_cta_groups: i64,
198 pub neg_a: bool,
199 pub neg_b: bool,
200 pub is_sparse: bool,
201}
202
203const _: () = {
204 assert!(::core::mem::size_of::<TCGen05InstrDescriptorBlockScaledAttrsObj>() == 152);
205 assert!(::core::mem::align_of::<TCGen05InstrDescriptorBlockScaledAttrsObj>() == 8);
206};
207
208impl Deref for TCGen05InstrDescriptorBlockScaledAttrsObj {
209 type Target = AttrsObj;
210 fn deref(&self) -> &AttrsObj {
211 &self.base_
212 }
213}
214
215#[allow(missing_docs)]
216impl TCGen05InstrDescriptorBlockScaledAttrsObj {
217 #[allow(non_snake_case)]
218 pub(crate) fn new(
219 d_dtype: String,
220 a_dtype: String,
221 b_dtype: String,
222 sfa_dtype: String,
223 sfb_dtype: String,
224 M: i64,
225 N: i64,
226 K: i64,
227 trans_a: bool,
228 trans_b: bool,
229 n_cta_groups: i64,
230 neg_a: bool,
231 neg_b: bool,
232 is_sparse: bool,
233 ) -> Self {
234 let base_ = AttrsObj::new();
235 Self {
236 base_,
237 d_dtype,
238 a_dtype,
239 b_dtype,
240 sfa_dtype,
241 sfb_dtype,
242 M,
243 N,
244 K,
245 trans_a,
246 trans_b,
247 n_cta_groups,
248 neg_a,
249 neg_b,
250 is_sparse,
251 }
252 }
253}
254
255#[allow(missing_docs)]
256impl TCGen05InstrDescriptorBlockScaledAttrs {
257 #[allow(non_snake_case)]
259 pub fn new(
260 d_dtype: impl Into<String>,
261 a_dtype: impl Into<String>,
262 b_dtype: impl Into<String>,
263 sfa_dtype: impl Into<String>,
264 sfb_dtype: impl Into<String>,
265 M: i64,
266 N: i64,
267 K: i64,
268 trans_a: bool,
269 trans_b: bool,
270 n_cta_groups: i64,
271 neg_a: bool,
272 neg_b: bool,
273 is_sparse: bool,
274 ) -> Self {
275 let obj = TCGen05InstrDescriptorBlockScaledAttrsObj::new(
276 d_dtype.into(),
277 a_dtype.into(),
278 b_dtype.into(),
279 sfa_dtype.into(),
280 sfb_dtype.into(),
281 M,
282 N,
283 K,
284 trans_a,
285 trans_b,
286 n_cta_groups,
287 neg_a,
288 neg_b,
289 is_sparse,
290 );
291 Self { data_: ObjectArc::new(obj) }
292 }
293}
294
295tvm_ffi::impl_object_ref_upcast!(TCGen05InstrDescriptorBlockScaledAttrs => Attrs);
296#[allow(missing_docs)]
303#[repr(C)]
304#[derive(tvm_ffi::derive::ObjectRef, Clone)]
305pub struct TensorMapEncodeTiledAttr {
306 data_: ObjectArc<TensorMapEncodeTiledAttrObj>,
307}
308
309#[allow(missing_docs)]
312#[repr(C)]
313#[derive(tvm_ffi::derive::Object)]
314#[object(type_key = "tirx.cuda.TensorMapEncodeTiledAttr", final, immutable)]
315pub struct TensorMapEncodeTiledAttrObj {
316 base_: AttrsObj,
317 pub descriptor_dtype: DLDataType,
318 pub rank: i64,
319 pub interleave: i64,
320 pub swizzle: i64,
321 pub l2_promotion: i64,
322 pub oob_fill: i64,
323 pub force_cu_dtype: i64,
324}
325
326const _: () = {
327 assert!(::core::mem::size_of::<TensorMapEncodeTiledAttrObj>() == 80);
328 assert!(::core::mem::align_of::<TensorMapEncodeTiledAttrObj>() == 8);
329};
330
331impl Deref for TensorMapEncodeTiledAttrObj {
332 type Target = AttrsObj;
333 fn deref(&self) -> &AttrsObj {
334 &self.base_
335 }
336}
337
338#[allow(missing_docs)]
339impl TensorMapEncodeTiledAttrObj {
340 pub(crate) fn new(
341 descriptor_dtype: DLDataType,
342 rank: i64,
343 interleave: i64,
344 swizzle: i64,
345 l2_promotion: i64,
346 oob_fill: i64,
347 force_cu_dtype: i64,
348 ) -> Self {
349 let base_ = AttrsObj::new();
350 Self {
351 base_,
352 descriptor_dtype,
353 rank,
354 interleave,
355 swizzle,
356 l2_promotion,
357 oob_fill,
358 force_cu_dtype,
359 }
360 }
361}
362
363#[allow(missing_docs)]
364impl TensorMapEncodeTiledAttr {
365 pub fn new(
367 descriptor_dtype: impl Into<DLDataType>,
368 rank: i64,
369 interleave: i64,
370 swizzle: i64,
371 l2_promotion: i64,
372 oob_fill: i64,
373 force_cu_dtype: i64,
374 ) -> Self {
375 let obj = TensorMapEncodeTiledAttrObj::new(
376 descriptor_dtype.into(),
377 rank,
378 interleave,
379 swizzle,
380 l2_promotion,
381 oob_fill,
382 force_cu_dtype,
383 );
384 Self { data_: ObjectArc::new(obj) }
385 }
386}
387
388tvm_ffi::impl_object_ref_upcast!(TensorMapEncodeTiledAttr => Attrs);
389