Skip to main content

ptx_parser/type/instruction/
getctarank.rs

1//! Original PTX specification:
2//!
3//! getctarank{.space}.type d, a;
4//! // Get cta rank from source shared memory address in register a.
5//! getctarank.shared::cluster.type d, a;
6//! // // Get cta rank from shared memory variable.
7//! // getctarank.shared::cluster.type d, var;
8//! // // Get cta rank from shared memory variable+offset.
9//! // getctarank.shared::cluster.type d, var + imm;
10//! // Get cta rank from generic address of shared memory variable in register a.
11//! getctarank.type d, a;
12//! .space = { .shared::cluster };
13//! .type  = { .u32, .u64 };
14
15#![allow(unused)]
16use crate::r#type::common::*;
17
18pub mod section_0 {
19    use crate::Spanned;
20    use crate::parser::Span;
21    use crate::r#type::common::*;
22
23    use serde::Serialize;
24
25    #[derive(Debug, Clone, PartialEq, Serialize)]
26    pub enum Space {
27        SharedCluster, // .shared::cluster
28    }
29
30    #[derive(Debug, Clone, PartialEq, Serialize)]
31    pub enum Type {
32        U32, // .u32
33        U64, // .u64
34    }
35
36    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
37    pub struct GetctarankSpaceType {
38        pub space: Option<Space>, // {.space}
39        pub type_: Type,          // .type
40        pub d: GeneralOperand,    // d
41        pub a: GeneralOperand,    // a
42        pub span: Span,
43    }
44
45    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
46    pub struct GetctarankSharedClusterType {
47        pub shared_cluster: (), // .shared::cluster
48        pub type_: Type,        // .type
49        pub d: GeneralOperand,  // d
50        pub a: GeneralOperand,  // a
51        pub span: Span,
52    }
53
54    #[derive(Debug, Clone, PartialEq, Spanned, Serialize)]
55    pub struct GetctarankType {
56        pub type_: Type,       // .type
57        pub d: GeneralOperand, // d
58        pub a: GeneralOperand, // a
59        pub span: Span,
60    }
61}
62
63// Re-export types with section suffixes to avoid naming conflicts
64// e.g., Type0 for section_0::Type, Type1 for section_1::Type
65pub use section_0::GetctarankSharedClusterType;
66pub use section_0::GetctarankSpaceType;
67pub use section_0::GetctarankType;
68pub use section_0::Space as Space0;
69pub use section_0::Type as Type0;