Skip to content

Attrs

attrs

IteratorType

Bases: StrEnum

Iterator type for linalg trait

Source code in xdsl/dialects/linalg/attrs.py
12
13
14
15
16
17
class IteratorType(StrEnum):
    "Iterator type for linalg trait"

    PARALLEL = auto()
    REDUCTION = auto()
    WINDOW = auto()

PARALLEL = auto() class-attribute instance-attribute

REDUCTION = auto() class-attribute instance-attribute

WINDOW = auto() class-attribute instance-attribute

IteratorTypeAttr dataclass

Bases: EnumAttribute[IteratorType]

Source code in xdsl/dialects/linalg/attrs.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@irdl_attr_definition
class IteratorTypeAttr(EnumAttribute[IteratorType]):
    name = "linalg.iterator_type"

    @classmethod
    def parallel(cls) -> IteratorTypeAttr:
        return IteratorTypeAttr(IteratorType.PARALLEL)

    @classmethod
    def reduction(cls) -> IteratorTypeAttr:
        return IteratorTypeAttr(IteratorType.REDUCTION)

    @classmethod
    def window(cls) -> IteratorTypeAttr:
        return IteratorTypeAttr(IteratorType.WINDOW)

    @classmethod
    def parse_parameter(cls, parser: AttrParser) -> IteratorType:
        with parser.in_angle_brackets():
            return super().parse_parameter(parser)

    def print_parameter(self, printer: Printer) -> None:
        with printer.in_angle_brackets():
            super().print_parameter(printer)

name = 'linalg.iterator_type' class-attribute instance-attribute

parallel() -> IteratorTypeAttr classmethod

Source code in xdsl/dialects/linalg/attrs.py
24
25
26
@classmethod
def parallel(cls) -> IteratorTypeAttr:
    return IteratorTypeAttr(IteratorType.PARALLEL)

reduction() -> IteratorTypeAttr classmethod

Source code in xdsl/dialects/linalg/attrs.py
28
29
30
@classmethod
def reduction(cls) -> IteratorTypeAttr:
    return IteratorTypeAttr(IteratorType.REDUCTION)

window() -> IteratorTypeAttr classmethod

Source code in xdsl/dialects/linalg/attrs.py
32
33
34
@classmethod
def window(cls) -> IteratorTypeAttr:
    return IteratorTypeAttr(IteratorType.WINDOW)

parse_parameter(parser: AttrParser) -> IteratorType classmethod

Source code in xdsl/dialects/linalg/attrs.py
36
37
38
39
@classmethod
def parse_parameter(cls, parser: AttrParser) -> IteratorType:
    with parser.in_angle_brackets():
        return super().parse_parameter(parser)

print_parameter(printer: Printer) -> None

Source code in xdsl/dialects/linalg/attrs.py
41
42
43
def print_parameter(self, printer: Printer) -> None:
    with printer.in_angle_brackets():
        super().print_parameter(printer)