Crate ptx_ir

Crate ptx_ir 

Source
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§

CallInst
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
VariableDecl
VectorOperand
Version

Enums§

AddressOperand
AddressSize
Constant
Directive
FloatRoundingMode
IntegerRoundingMode
LinkingDirective
MulMode
Opcode
Operand
Operands may be
PredicateOp
Register
Shape2
Shape3
ShfDirection
ShfMode
SpecialReg
StateSpace
Statement
A PTX statement is either a directive or an instruction. Statements begin with an optional label and end with a semicolon.
Type