
# Autogenerated by mlir-tblgen; don't manually edit.

from enum import IntEnum, auto, IntFlag
from ._ods_common import _cext as _ods_cext
from ..ir import register_attribute_builder
_ods_ir = _ods_cext.ir

class MatchInterfaceEnum(IntEnum):
    """An interface to match"""

    LinalgOp = 0
    TilingInterface = 1
    LoopLikeInterface = 2

    def __str__(self):
        if self is MatchInterfaceEnum.LinalgOp:
            return "LinalgOp"
        if self is MatchInterfaceEnum.TilingInterface:
            return "TilingInterface"
        if self is MatchInterfaceEnum.LoopLikeInterface:
            return "LoopLikeInterface"
        raise ValueError("Unknown MatchInterfaceEnum enum entry.")



@register_attribute_builder("MatchInterfaceEnum", allow_existing=True)
def _matchinterfaceenum(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(32, context=context), int(x))

class TransposeMatmulInput(IntEnum):
    """Input to transpose when converting matmul ops to transposed variants"""

    lhs = 0
    rhs = 1

    def __str__(self):
        if self is TransposeMatmulInput.lhs:
            return "lhs"
        if self is TransposeMatmulInput.rhs:
            return "rhs"
        raise ValueError("Unknown TransposeMatmulInput enum entry.")



@register_attribute_builder("TransposeMatmulInput", allow_existing=True)
def _transposematmulinput(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(32, context=context), int(x))

