Module type

Module type 

Source
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 type
  • ptx_parser::r#type::Instruction - Instruction with label/predicate
  • ptx_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§

instruction

Structs§

AddressSizeDirective
Structured representation of the .address_size directive.
DwarfDirective
Raw dwarf directive emitted by the compiler (e.g. @@dwarf).
EntryFunction
A PTX kernel declared with the .entry directive.
FileDirective
Structured representation of the .file directive.
FuncFunction
A PTX device function declared with the .func directive.
FunctionAlias
Alias directive relating one function symbol to another.
FunctionBody
Statements contained within a PTX function body.
FunctionDim3
Dimension triplet used by several function header directives.
FunctionSymbol
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).
LinkingDirective
Linking directives that influence symbol visibility. TODO: further parse the prototype, which should be a function signature.
LocationDirective
Structured representation of a .loc directive inside a PTX function.
Module
A full PTX module containing directives and function definitions.
PragmaDirective
Structured representation of a .pragma directive.
Predicate
Predicate guard for conditional instruction execution
PredicateRegister
Predicate register names (e.g., %p0).
RegisterDirective
.reg .ty name
RegisterOperand
Register operand starting with % (e.g., %r1).
SectionDirective
Structured representation of the .section directive.
StatementSectionDirective
Structured representation of a .section directive inside a function body.
TargetDirective
Structured representation of the .target directive.
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]
TexHandler3Optional
Texture handler with optional sampler operand, e.g. [tex, coords] or [tex, sampler, coords]
VariableDirective
Module-scoped variable declaration shared by .tex, .shared, .global, and .const.
VariableSymbol
Variable symbol
VersionDirective
Structured representation of the .version directive.

Enums§

AddressBase
Base location referenced by an address expression.
AddressOffset
Specific adjustment applied within a displacement term.
AddressOperand
Representation of an address operand.
AddressSpace
Memory spaces
AttributeDirective
Axis
Axis component for 3-component special registers (x/y/z)
CodeLinkage
CodeOrDataLinkage
DataLinkage
DataType
FunctionHeaderDirective
Directive tokens that may decorate a PTX function header.
FunctionKernelDirective
All directives that describe kernel/function entities.
FunctionStatement
Nested statement block enclosed in braces. Executable items that appear within a function body.
GeneralOperand
GlobalInitializer
Structured representation of a global variable initialiser.
InitializerValue
ModuleDebugDirective
Debugging directives defined by the PTX ISA.
ModuleDirective
Module-level directives recognised by the parser.
ModuleInfoDirectiveKind
Directives that apply to the PTX module as a whole.
ModuleVariableDirective
Module-level declarations that reserve storage in a specific address space.
NumericLiteral
Operand
Sign
SpecialRegister
StatementDirective
Directive that applies to individual statements.
TexType
VariableModifier
Qualifiers left on module variable declarations (e.g. .v4).
VectorOperand