Expand description
PTX type definitions - Abstract Syntax Tree (AST) nodes.
All types are re-exported at the top level for easy access:
ptx_parser::r#type::Module- Root module typeptx_parser::r#type::Instruction- Instruction with label/predicateptx_parser::r#type::Operand- Operand types- etc.
Instruction variants are under a separate namespace:
ptx_parser::r#type::instruction::Inst- Enum of all instruction variants- Individual instruction modules under
ptx_parser::r#type::instruction::*
Modules§
Structs§
- Address
Size Directive - Structured representation of the
.address_sizedirective. - Dwarf
Directive - Raw dwarf directive emitted by the compiler (e.g. @@dwarf).
- Entry
Function - A PTX kernel declared with the
.entrydirective. - Extern
Call Block - File
Directive - Structured representation of the
.filedirective. - Func
Function - A PTX device function declared with the
.funcdirective. - Function
Alias - Alias directive relating one function symbol to another.
- Function
Body - Statements contained within a PTX function body.
- Function
Dim3 - Dimension triplet used by several function header directives.
- Function
Symbol - Function symbol
- Immediate
- Immediate value represented as a string. TODO: Replace with appropriate numeric type later.
- Instruction
- Represents a complete instruction with optional label and predicate guard Format: [label:] [@{!}pred] instruction
- Label
- Label name (e.g.,
L__label_1). - Linking
Directive - Linking directives that influence symbol visibility. TODO: further parse the prototype, which should be a function signature.
- Location
Directive - Structured representation of a
.locdirective inside a PTX function. - Module
- A full PTX module containing directives and function definitions.
- Pragma
Directive - Structured representation of a
.pragmadirective. - Predicate
- Predicate guard for conditional instruction execution
- Predicate
Register - Predicate register names (e.g.,
%p0). - Register
Directive - .reg .ty name
- Register
Operand - Register operand starting with % (e.g.,
%r1). - Section
Directive - Structured representation of the
.sectiondirective. - Statement
Section Directive - Structured representation of a
.sectiondirective inside a function body. - Target
Directive - Structured representation of the
.targetdirective. - TexHandler2
- Texture handler with 2 operands, e.g. [%r1, %r2]
- TexHandler3
- Texture handler with optional sampler operand, e.g.
[tex, coords]or[tex, sampler, coords] - TexHandler3
Optional - Texture handler with optional sampler operand, e.g.
[tex, coords]or[tex, sampler, coords] - Variable
Directive - Module-scoped variable declaration shared by
.tex,.shared,.global, and.const. - Variable
Symbol - Variable symbol
- Version
Directive - Structured representation of the
.versiondirective.
Enums§
- Address
Base - Base location referenced by an address expression.
- Address
Offset - Specific adjustment applied within a displacement term.
- Address
Operand - Representation of an address operand.
- Address
Space - Memory spaces
- Attribute
Directive - Axis
- Axis component for 3-component special registers (x/y/z)
- Code
Linkage - Code
OrData Linkage - Data
Linkage - Data
Type - Extern
Call Setup - Function
Entry Directive - Entry directives that appear before executable statements in a function body.
- Function
Header Directive - Directive tokens that may decorate a PTX function header.
- Function
Kernel Directive - All directives that describe kernel/function entities.
- Function
Statement - Nested statement block enclosed in braces. Executable items that appear within a function body.
- General
Operand - Module
Debug Directive - Debugging directives defined by the PTX ISA.
- Module
Directive - Module-level directives recognised by the parser.
- Module
Info Directive Kind - Directives that apply to the PTX module as a whole.
- Module
Variable Directive - Module-level declarations that reserve storage in a specific address space.
- Operand
- Sign
- Special
Register - Statement
Directive - Directive that applies to individual statements.
- TexType
- Vector
Operand