Skip to content

kehrazy/purr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purr | Pythonic Universal IR Representation

A replacement for Tablegen when using MLIR.

Warning

this is NOT complete in any way shape or form

Example

from purr import Dialect, Op, asm, op, types

cool_math = Dialect(
    name="cool_math",
    cpp_namespace="cool::math",
    description="A dialect for cool math operations",
)


class AddOp(Op):
    dialect = cool_math
    lhs = op.operand(types.Tensor)
    rhs = op.operand(types.Tensor)
    output = op.result(types.Tensor)

    assembly_format = (
        asm.operand("lhs"),
        asm.keyword("+"),
        asm.operand("rhs"),
        asm.keyword("->"),
        asm.operand("output"),
    )

About

Pythonic MLIR definition generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages