Expand description
§PTX IR
This crate provides a data structure and parser for the Parallel Thread Execution (PTX) Intermediate Representation (IR).
§Usage
use ptx_ir::Module;
use std::path::PathBuf;
let input = PathBuf::from("tests/kernels/simple/add.ptx");
match Module::from_ptx_path(&input) {
Ok(module) => {
println!("{:#?}", module);
}
Err(diagnostic) => {
println!("{}", diagnostic);
}
}Structs§
- Call
Inst - Function
- Instruction
- PTX instructions generally have from zero to four operands, plus an optional guard predicate appearing after an @ symbol to the left of the opcode:
- Module
- PTX module, the top-level structure in a PTX file.
- Parameter
- Predicate
- Target
- Variable
Decl - Vector
Operand - Version
Enums§
- Address
Operand - Address
Size - Constant
- Directive
- Float
Rounding Mode - Integer
Rounding Mode - Linking
Directive - MulMode
- Opcode
- Operand
- Operands may be
- Predicate
Op - Register
- Shape2
- Shape3
- ShfDirection
- ShfMode
- Special
Reg - State
Space - Statement
- A PTX statement is either a directive or an instruction. Statements begin with an optional label and end with a semicolon.
- Type