Csl
csl
The CSL dialect models the Cerebras Systems Language.
It aims to be used as a target (using the -t cls commandline option) to do automatic
codegen for the CS2.
See external documentation.
Target = Literal['wse2', 'wse3']
module-attribute
StructLikeConstr = base(ImportedModuleType) | base(ComptimeStructType)
module-attribute
DsdElementTypeConstr = base(Float16Type) | base(Float32Type) | eq(IntegerType(16, Signedness.SIGNED)) | eq(IntegerType(16, Signedness.UNSIGNED)) | eq(IntegerType(32, Signedness.SIGNED)) | eq(IntegerType(32, Signedness.UNSIGNED))
module-attribute
f16_pointer = PtrType(f16, PtrKindAttr(PtrKind.SINGLE), PtrConstAttr(PtrConst.VAR))
module-attribute
f32_pointer = PtrType(f32, PtrKindAttr(PtrKind.SINGLE), PtrConstAttr(PtrConst.VAR))
module-attribute
i8_value = IntegerType(8, Signedness.SIGNED)
module-attribute
u16_value = IntegerType(16, Signedness.UNSIGNED)
module-attribute
i16_value = IntegerType(16, Signedness.SIGNED)
module-attribute
u32_value = IntegerType(32, Signedness.UNSIGNED)
module-attribute
i32_value = IntegerType(32, Signedness.SIGNED)
module-attribute
i16_pointer = PtrType(i16_value, PtrKindAttr(PtrKind.SINGLE), PtrConstAttr(PtrConst.VAR))
module-attribute
u16_pointer = PtrType(u16_value, PtrKindAttr(PtrKind.SINGLE), PtrConstAttr(PtrConst.VAR))
module-attribute
i32_pointer = PtrType(i32_value, PtrKindAttr(PtrKind.SINGLE), PtrConstAttr(PtrConst.VAR))
module-attribute
u32_pointer = PtrType(u32_value, PtrKindAttr(PtrKind.SINGLE), PtrConstAttr(PtrConst.VAR))
module-attribute
ColorId = IntegerType[Literal[5, 6], Signedness.UNSIGNED]
module-attribute
ColorIdAttr: TypeAlias = IntegerAttr[ColorId]
module-attribute
I3 = IntegerType[3, Signedness.SIGNLESS]
module-attribute
QueueIdAttr: TypeAlias = IntegerAttr[I3]
module-attribute
ParamAttr: TypeAlias = FloatAttr | IntegerAttr
module-attribute
ZerosOpAttr: TypeAlias = IntegerType | Float32Type | Float16Type
module-attribute
ZerosOpAttrConstr = BaseAttr(IntegerType) | BaseAttr(Float32Type) | BaseAttr(Float16Type)
module-attribute
FunctionSignatures = list[tuple[Attribute | type[Attribute], ...]]
module-attribute
ParamOpAttr: TypeAlias = Float16Type | Float32Type | IntegerType | ColorType | FunctionType | ImportedModuleType | ComptimeStructType
module-attribute
ParamOpAttrConstr = BaseAttr(Float16Type) | BaseAttr(Float32Type) | BaseAttr(IntegerType) | BaseAttr(ColorType) | BaseAttr(FunctionType) | BaseAttr(ImportedModuleType) | BaseAttr(ComptimeStructType)
module-attribute
CSL = Dialect('csl', [Add16Op, Add16cOp, AddressOfFnOp, AddressOfOp, And16Op, CallOp, ClzOp, ConcatStructOp, ConstStructOp, ConstantsOp, CslModuleOp, CtzOp, DirectionOp, FabshOp, FabssOp, FaddhOp, FaddhsOp, FaddsOp, Fh2sOp, Fh2xp16Op, FmachOp, FmachsOp, FmacsOp, FmaxhOp, FmaxsOp, FmovhOp, FmovsOp, FmulhOp, FmulsOp, FneghOp, FnegsOp, FnormhOp, FnormsOp, Fs2hOp, Fs2xp16Op, FscalehOp, FscalesOp, FsubhOp, FsubsOp, FuncOp, GetColorOp, GetFabDsdOp, GetMemDsdOp, ImportModuleConstOp, IncrementDsdOffsetOp, LayoutOp, MemberAccessOp, MemberCallOp, Mov16Op, Mov32Op, Or16Op, ParamOp, PopcntOp, PtrCastOp, ReturnOp, RpcOp, Sar16Op, SetDsdBaseAddrOp, SetDsdLengthOp, SetDsdStrideOp, SetRectangleOp, SetTileCodeOp, SignednessCastOp, Sll16Op, Slr16Op, Sub16Op, SymbolExportOp, TaskOp, ActivateOp, Xor16Op, Xp162fhOp, Xp162fsOp, ZerosOp, VariableOp, LoadVarOp, StoreVarOp], [ColorType, ComptimeStructType, DsdType, ImportedModuleType, PtrType, ModuleKindAttr, DirectionAttr, DirectionType, PtrConstAttr, PtrKindAttr, TaskKindAttr, VarType])
module-attribute
PtrKind
Bases: StrEnum
Source code in xdsl/dialects/csl.py
98 99 100 | |
SINGLE = 'single'
class-attribute
instance-attribute
MANY = 'many'
class-attribute
instance-attribute
PtrConst
Bases: StrEnum
Source code in xdsl/dialects/csl.py
103 104 105 | |
CONST = 'const'
class-attribute
instance-attribute
VAR = 'var'
class-attribute
instance-attribute
ModuleKind
Bases: StrEnum
Source code in xdsl/dialects/csl.py
108 109 110 | |
LAYOUT = 'layout'
class-attribute
instance-attribute
PROGRAM = 'program'
class-attribute
instance-attribute
TaskKind
Bases: StrEnum
Source code in xdsl/dialects/csl.py
113 114 115 116 | |
LOCAL = 'local'
class-attribute
instance-attribute
DATA = 'data'
class-attribute
instance-attribute
CONTROL = 'control'
class-attribute
instance-attribute
DsdKind
Bases: StrEnum
Source code in xdsl/dialects/csl.py
119 120 121 122 123 | |
mem1d_dsd = 'mem1d_dsd'
class-attribute
instance-attribute
mem4d_dsd = 'mem4d_dsd'
class-attribute
instance-attribute
fabin_dsd = 'fabin_dsd'
class-attribute
instance-attribute
fabout_dsd = 'fabout_dsd'
class-attribute
instance-attribute
Direction
Bases: StrEnum
Source code in xdsl/dialects/csl.py
126 127 128 129 130 | |
NORTH = 'north'
class-attribute
instance-attribute
SOUTH = 'south'
class-attribute
instance-attribute
EAST = 'east'
class-attribute
instance-attribute
WEST = 'west'
class-attribute
instance-attribute
InModuleKind
dataclass
Bases: OpTrait
Constrain an op to a particular module kind
Optionally specify if the op has to be a direct child of CslModuleOp (default is yes).
Ops with this trait are always allowed inside a csl_wrapper.module
Source code in xdsl/dialects/csl.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
kind: ModuleKind = field()
class-attribute
instance-attribute
_: KW_ONLY
instance-attribute
direct_child: bool = field(default=True)
class-attribute
instance-attribute
__init__(kind: ModuleKind = field(), *, direct_child: bool = True) -> None
verify(op: Operation) -> None
Source code in xdsl/dialects/csl.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
ComptimeStructType
dataclass
Bases: ParametrizedAttribute, TypeAttribute
Represents a compile time struct.
The type makes no guarantees on the fields available.
Source code in xdsl/dialects/csl.py
238 239 240 241 242 243 244 245 246 | |
name = 'csl.comptime_struct'
class-attribute
instance-attribute
ImportedModuleType
dataclass
Bases: ParametrizedAttribute, TypeAttribute
Represents an imported module (behaves the same as a comptime_struct otherwise).
The type makes no guarantees on the fields available.
Source code in xdsl/dialects/csl.py
249 250 251 252 253 254 255 256 257 | |
name = 'csl.imported_module'
class-attribute
instance-attribute
PtrKindAttr
dataclass
Bases: EnumAttribute[PtrKind], SpacedOpaqueSyntaxAttribute
Attribute representing whether a pointer is a single () or many ([]) pointer
Source code in xdsl/dialects/csl.py
263 264 265 266 267 | |
name = 'csl.ptr_kind'
class-attribute
instance-attribute
PtrConstAttr
dataclass
Bases: EnumAttribute[PtrConst], SpacedOpaqueSyntaxAttribute
Attribute representing whether a pointer's mutability
Source code in xdsl/dialects/csl.py
270 271 272 273 274 | |
name = 'csl.ptr_const'
class-attribute
instance-attribute
ModuleKindAttr
dataclass
Bases: EnumAttribute[ModuleKind], SpacedOpaqueSyntaxAttribute
Attribute representing the kind of CSL module, either layout or program
Source code in xdsl/dialects/csl.py
277 278 279 280 281 | |
name = 'csl.module_kind'
class-attribute
instance-attribute
TaskKindAttr
dataclass
Bases: EnumAttribute[TaskKind], SpacedOpaqueSyntaxAttribute
Source code in xdsl/dialects/csl.py
284 285 286 287 288 289 290 291 292 293 | |
name = 'csl.task_kind'
class-attribute
instance-attribute
get_color_bits()
Source code in xdsl/dialects/csl.py
288 289 290 291 292 293 | |
DirectionAttr
dataclass
Bases: EnumAttribute[Direction], SpacedOpaqueSyntaxAttribute
Source code in xdsl/dialects/csl.py
296 297 298 | |
name = 'csl.dir_kind'
class-attribute
instance-attribute
DirectionType
dataclass
Bases: ParametrizedAttribute, TypeAttribute
Source code in xdsl/dialects/csl.py
301 302 303 | |
name = 'csl.direction'
class-attribute
instance-attribute
PtrType
dataclass
Bases: ParametrizedAttribute, TypeAttribute, ContainerType
Represents a typed pointer in CSL.
kind refers to CSL having two types of pointers, single *type and many [*]type.
Source code in xdsl/dialects/csl.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | |
name = 'csl.ptr'
class-attribute
instance-attribute
type: TypeAttribute
instance-attribute
kind: PtrKindAttr
instance-attribute
constness: PtrConstAttr
instance-attribute
get(typ: Attribute, is_single: bool, is_const: bool)
staticmethod
Source code in xdsl/dialects/csl.py
320 321 322 323 324 325 326 327 | |
get_element_type() -> Attribute
Source code in xdsl/dialects/csl.py
329 330 | |
PtrCastOp
Bases: IRDLOperation
Implements @ptrcast(destination_ptr_type, ptr)
Source code in xdsl/dialects/csl.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
name = 'csl.ptrcast'
class-attribute
instance-attribute
ptr = operand_def(PtrType)
class-attribute
instance-attribute
result = result_def(PtrType)
class-attribute
instance-attribute
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
__init__(ptr: Operation | SSAValue, result_type: PtrType)
Source code in xdsl/dialects/csl.py
346 347 | |
DsdType
dataclass
Bases: EnumAttribute[DsdKind], TypeAttribute, SpacedOpaqueSyntaxAttribute
Represents a DSD in CSL.
Source code in xdsl/dialects/csl.py
381 382 383 384 385 386 387 | |
name = 'csl.dsd'
class-attribute
instance-attribute
ColorType
dataclass
Bases: ParametrizedAttribute, TypeAttribute
Type representing a color type in CSL
Source code in xdsl/dialects/csl.py
390 391 392 393 394 395 396 | |
name = 'csl.color'
class-attribute
instance-attribute
VarType
dataclass
Bases: ParametrizedAttribute, TypeAttribute, ContainerType
Source code in xdsl/dialects/csl.py
399 400 401 402 403 404 405 406 | |
name = 'csl.var'
class-attribute
instance-attribute
child_type: TypeAttribute
instance-attribute
get_element_type() -> TypeAttribute
Source code in xdsl/dialects/csl.py
405 406 | |
VariableOp
dataclass
Bases: IRDLOperation
Declares a variable.
The variable cannot be mutated directly. SSA values of the variable have to be loaded and stored using LoadVarOp and StoreVarOp.
This is similar to how memref works.
Source code in xdsl/dialects/csl.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | |
name = 'csl.variable'
class-attribute
instance-attribute
default = opt_prop_def(ParamAttr)
class-attribute
instance-attribute
res = result_def(VarType)
class-attribute
instance-attribute
assembly_format = '`(` $default `)` `:` type($res) attr-dict'
class-attribute
instance-attribute
get_element_type()
Source code in xdsl/dialects/csl.py
438 439 440 | |
from_type(child_type: Attribute) -> VariableOp
staticmethod
Source code in xdsl/dialects/csl.py
442 443 444 445 | |
from_value(value: ParamAttr) -> VariableOp
staticmethod
Source code in xdsl/dialects/csl.py
447 448 449 450 451 452 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
454 455 456 457 458 459 460 461 462 | |
LoadVarOp
Bases: IRDLOperation
Obtain the SSA value of a CSL variable. The obtained value itself is not
modifiable, but it can be stored in the variable using StoreVarOp.
Source code in xdsl/dialects/csl.py
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
name = 'csl.load_var'
class-attribute
instance-attribute
var = operand_def(VarType)
class-attribute
instance-attribute
res = result_def()
class-attribute
instance-attribute
traits = traits_def(MemoryReadEffect())
class-attribute
instance-attribute
assembly_format = '`(` $var `:` type($var) `)` `:` type($res) attr-dict'
class-attribute
instance-attribute
__init__(var: VariableOp | SSAValue)
Source code in xdsl/dialects/csl.py
480 481 482 483 484 485 486 487 488 489 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
491 492 493 494 495 496 497 | |
StoreVarOp
Bases: IRDLOperation
Update the value of a variable.
Source code in xdsl/dialects/csl.py
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | |
name = 'csl.store_var'
class-attribute
instance-attribute
var = operand_def(VarType)
class-attribute
instance-attribute
new_value = operand_def()
class-attribute
instance-attribute
traits = traits_def(MemoryWriteEffect())
class-attribute
instance-attribute
assembly_format = '$var `:` type($var) `=` $new_value `:` type($new_value) attr-dict'
class-attribute
instance-attribute
__init__(var: VariableOp, new_value: Operation | SSAValue)
Source code in xdsl/dialects/csl.py
516 517 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
519 520 521 522 523 524 525 | |
DirectionOp
Bases: IRDLOperation
Source code in xdsl/dialects/csl.py
528 529 530 531 532 533 534 535 536 537 538 539 540 541 | |
name = 'csl.get_dir'
class-attribute
instance-attribute
dir = prop_def(DirectionAttr)
class-attribute
instance-attribute
res = result_def(DirectionType)
class-attribute
instance-attribute
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
__init__(direction: DirectionAttr | Direction)
Source code in xdsl/dialects/csl.py
538 539 540 541 | |
CslModuleOp
dataclass
Bases: IRDLOperation
Separates layout module from program module
Source code in xdsl/dialects/csl.py
544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 | |
name = 'csl.module'
class-attribute
instance-attribute
body = region_def('single_block')
class-attribute
instance-attribute
kind = prop_def(ModuleKindAttr)
class-attribute
instance-attribute
sym_name = attr_def(SymbolNameConstraint())
class-attribute
instance-attribute
traits = traits_def(HasParent(ModuleOp), IsolatedFromAbove(), NoTerminator(), SymbolOpInterface())
class-attribute
instance-attribute
ImportModuleConstOp
Bases: IRDLOperation
Equivalent to an const <va_name> = @import_module("<module_name>", <params>) call.
Source code in xdsl/dialects/csl.py
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | |
name = 'csl.import_module'
class-attribute
instance-attribute
traits = traits_def(HasParent(CslModuleOp))
class-attribute
instance-attribute
module = prop_def(StringAttr)
class-attribute
instance-attribute
params = opt_operand_def(StructLikeConstr)
class-attribute
instance-attribute
result = result_def(ImportedModuleType)
class-attribute
instance-attribute
__init__(name: str | StringAttr, params: SSAValue | Operation | None = None)
Source code in xdsl/dialects/csl.py
579 580 581 582 583 584 585 586 587 588 | |
ConstStructOp
Bases: IRDLOperation
Source code in xdsl/dialects/csl.py
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | |
name = 'csl.const_struct'
class-attribute
instance-attribute
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
items = opt_prop_def(DictionaryAttr)
class-attribute
instance-attribute
ssa_fields = opt_prop_def(ArrayAttr[StringAttr])
class-attribute
instance-attribute
ssa_values = var_operand_def()
class-attribute
instance-attribute
res = result_def(ComptimeStructType)
class-attribute
instance-attribute
__init__(*args: tuple[str, Operation | SSAValue])
Source code in xdsl/dialects/csl.py
602 603 604 605 606 607 608 609 610 611 612 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
614 615 616 617 618 619 620 621 622 623 624 | |
ZerosOp
Bases: IRDLOperation
Represents the @zeros operation in CSL.
Source code in xdsl/dialects/csl.py
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 | |
name = 'csl.zeros'
class-attribute
instance-attribute
T: ClassVar = VarConstraint('T', ZerosOpAttrConstr)
class-attribute
instance-attribute
size = opt_operand_def(T)
class-attribute
instance-attribute
result = result_def(MemRefType.constr(T))
class-attribute
instance-attribute
is_const = opt_prop_def(builtin.UnitAttr)
class-attribute
instance-attribute
__init__(memref: MemRefType[IntegerType | Float32Type | Float16Type], dynamic_size: SSAValue | Operation | None = None, is_const: builtin.UnitAttr | None = None)
Source code in xdsl/dialects/csl.py
649 650 651 652 653 654 655 656 657 658 659 | |
ConstantsOp
Bases: IRDLOperation
Represents the @constants operation in CSL.
This can also be used as a stand-in for @zeros by passing a zero constant as the second argument.
If is_const is present, it is printed with the const prefix, otherwise it's assumed var by the csl printer.
Source code in xdsl/dialects/csl.py
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | |
name = 'csl.constants'
class-attribute
instance-attribute
T: ClassVar = VarConstraint('T', BaseAttr(IntegerType) | BaseAttr(Float32Type) | BaseAttr(Float16Type))
class-attribute
instance-attribute
size = operand_def(IntegerType)
class-attribute
instance-attribute
value = operand_def(T)
class-attribute
instance-attribute
result = result_def(MemRefType.constr(T))
class-attribute
instance-attribute
is_const = opt_prop_def(builtin.UnitAttr)
class-attribute
instance-attribute
__init__(size: SSAValue | Operation, value: SSAValue | Operation)
Source code in xdsl/dialects/csl.py
686 687 688 689 690 | |
GetColorOp
Bases: IRDLOperation
Source code in xdsl/dialects/csl.py
693 694 695 696 697 698 699 700 701 702 703 | |
name = 'csl.get_color'
class-attribute
instance-attribute
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
id = operand_def(IntegerType)
class-attribute
instance-attribute
res = result_def(ColorType)
class-attribute
instance-attribute
__init__(op: Operation)
Source code in xdsl/dialects/csl.py
702 703 | |
MemberAccessOp
dataclass
Bases: IRDLOperation
Access a member of a struct and assigna a new variable.
Source code in xdsl/dialects/csl.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | |
name = 'csl.member_access'
class-attribute
instance-attribute
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
struct = operand_def(StructLikeConstr)
class-attribute
instance-attribute
field = prop_def(StringAttr)
class-attribute
instance-attribute
result = result_def(Attribute)
class-attribute
instance-attribute
MemberCallOp
Bases: IRDLOperation
Call a member of a struct, optionally assign a value to the result.
Source code in xdsl/dialects/csl.py
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 | |
name = 'csl.member_call'
class-attribute
instance-attribute
struct = operand_def(StructLikeConstr)
class-attribute
instance-attribute
field = prop_def(StringAttr)
class-attribute
instance-attribute
args = var_operand_def(Attribute)
class-attribute
instance-attribute
result = opt_result_def(Attribute)
class-attribute
instance-attribute
__init__(fname: str, result_type: Attribute | None, struct: Operation, params: Sequence[SSAValue | Operation])
Source code in xdsl/dialects/csl.py
739 740 741 742 743 744 745 746 747 748 749 750 751 752 | |
FuncOp
Bases: _FuncBase
Almost the same as func.func, but only has one result, and is not isolated from above.
We dropped IsolatedFromAbove because CSL functions often times access global parameters or constants.
Source code in xdsl/dialects/csl.py
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 | |
name = 'csl.func'
class-attribute
instance-attribute
__init__(name: str, function_type: FunctionType | tuple[Sequence[Attribute], Attribute | None], region: Region | type[Region.DEFAULT] = Region.DEFAULT, *, arg_attrs: ArrayAttr[DictionaryAttr] | None = None, res_attrs: ArrayAttr[DictionaryAttr] | None = None)
Source code in xdsl/dialects/csl.py
766 767 768 769 770 771 772 773 774 775 776 777 778 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
780 781 | |
parse(parser: Parser) -> FuncOp
classmethod
Source code in xdsl/dialects/csl.py
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | |
print(printer: Printer)
Source code in xdsl/dialects/csl.py
815 816 | |
TaskOp
Bases: _FuncBase
Represents a task in CSL. All three types of task are represented by this Op.
It carries the ID it should be bound to, in case of local and control tasks this is the task ID, in the case of the data task, it's the id of the color the task is bound to.
NOTE: Control tasks not yet implemented
Source code in xdsl/dialects/csl.py
819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 | |
name = 'csl.task'
class-attribute
instance-attribute
kind = prop_def(TaskKindAttr)
class-attribute
instance-attribute
id = opt_prop_def(ColorIdAttr)
class-attribute
instance-attribute
traits = traits_def(InModuleKind(ModuleKind.PROGRAM))
class-attribute
instance-attribute
__init__(name: str, function_type: FunctionType | tuple[Sequence[Attribute], Attribute | None], region: Region | type[Region.DEFAULT] = Region.DEFAULT, *, task_kind: TaskKindAttr | TaskKind, arg_attrs: ArrayAttr[DictionaryAttr] | None = None, res_attrs: ArrayAttr[DictionaryAttr] | None = None, id: ColorIdAttr | int | None)
Source code in xdsl/dialects/csl.py
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 | |
parse(parser: Parser) -> TaskOp
classmethod
Source code in xdsl/dialects/csl.py
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 | |
print(printer: Printer)
Source code in xdsl/dialects/csl.py
942 943 | |
ActivateOp
Bases: IRDLOperation
This operation corresponds directly to the builtin @activate combined with a call to the
corresponding @get_<kind>_task_id to convert the numeric ID to a task id, e.g.:
csl.activate local, 0 : ui6
|
V
@activate(@get_local_task_id(0));
Source code in xdsl/dialects/csl.py
946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | |
name = 'csl.activate'
class-attribute
instance-attribute
id = prop_def(ColorIdAttr)
class-attribute
instance-attribute
kind = prop_def(TaskKindAttr)
class-attribute
instance-attribute
assembly_format = 'attr-dict $kind `,` $id'
class-attribute
instance-attribute
__init__(id: int | ColorIdAttr, kind: TaskKind | TaskKindAttr)
Source code in xdsl/dialects/csl.py
968 969 970 971 972 973 974 | |
ReturnOp
Bases: IRDLOperation
Return for CSL operations such as functions and tasks.
Source code in xdsl/dialects/csl.py
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 | |
name = 'csl.return'
class-attribute
instance-attribute
ret_val = opt_operand_def(Attribute)
class-attribute
instance-attribute
assembly_format = 'attr-dict ($ret_val^ `:` type($ret_val))?'
class-attribute
instance-attribute
traits = traits_def(HasParent(FuncOp, TaskOp), IsTerminator())
class-attribute
instance-attribute
__init__(return_val: SSAValue | Operation | None = None)
Source code in xdsl/dialects/csl.py
991 992 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
994 995 996 997 998 999 1000 1001 | |
LayoutOp
Bases: IRDLOperation
Source code in xdsl/dialects/csl.py
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | |
name = 'csl.layout'
class-attribute
instance-attribute
body = region_def()
class-attribute
instance-attribute
traits = traits_def(NoTerminator(), InModuleKind(ModuleKind.LAYOUT))
class-attribute
instance-attribute
__init__(ops: Sequence[Operation] | Region)
Source code in xdsl/dialects/csl.py
1012 1013 1014 1015 1016 1017 | |
parse(parser: Parser) -> LayoutOp
classmethod
Source code in xdsl/dialects/csl.py
1019 1020 1021 | |
print(printer: Printer)
Source code in xdsl/dialects/csl.py
1023 1024 1025 | |
CallOp
Bases: IRDLOperation
Call a regular function or task by name
Source code in xdsl/dialects/csl.py
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 | |
name = 'csl.call'
class-attribute
instance-attribute
callee = prop_def(SymbolRefAttr)
class-attribute
instance-attribute
args = var_operand_def(Attribute)
class-attribute
instance-attribute
result = opt_result_def(Attribute)
class-attribute
instance-attribute
__init__(callee: SymbolRefAttr, args: Sequence[SSAValue | Operation] | None = None, result: Attribute | None = None)
Source code in xdsl/dialects/csl.py
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 | |
SetRectangleOp
dataclass
Bases: IRDLOperation
Source code in xdsl/dialects/csl.py
1055 1056 1057 1058 1059 1060 1061 1062 | |
name = 'csl.set_rectangle'
class-attribute
instance-attribute
traits = traits_def(HasParent(LayoutOp))
class-attribute
instance-attribute
x_dim = operand_def(IntegerType)
class-attribute
instance-attribute
y_dim = operand_def(IntegerType)
class-attribute
instance-attribute
SetTileCodeOp
Bases: IRDLOperation
Source code in xdsl/dialects/csl.py
1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | |
name = 'csl.set_tile_code'
class-attribute
instance-attribute
traits = traits_def(HasAncestor(LayoutOp))
class-attribute
instance-attribute
file = prop_def(StringAttr)
class-attribute
instance-attribute
x_coord = operand_def(IntegerType)
class-attribute
instance-attribute
y_coord = operand_def(IntegerType)
class-attribute
instance-attribute
params = opt_operand_def(ComptimeStructType)
class-attribute
instance-attribute
__init__(fname: str | StringAttr, x_coord: SSAValue | Operation, y_coord: SSAValue | Operation, params: SSAValue | Operation | None = None)
Source code in xdsl/dialects/csl.py
1077 1078 1079 1080 1081 1082 1083 1084 1085 | |
DsdOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/csl.py
1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/csl.py
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 | |
IncrementDsdOffsetOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/csl.py
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/csl.py
1107 1108 1109 1110 1111 1112 1113 | |
SetDsdLengthOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/csl.py
1116 1117 1118 1119 1120 1121 1122 1123 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/csl.py
1117 1118 1119 1120 1121 1122 1123 | |
SetDsdStrideOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/csl.py
1126 1127 1128 1129 1130 1131 1132 1133 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/csl.py
1127 1128 1129 1130 1131 1132 1133 | |
GetMemDsdOp
dataclass
Bases: _GetDsdOp
CSL built-in for DSDs of the form
@get_dsd( [ mem1d_dsd | mem4d_dsd ] .{ .tensor_access = |i, j| {$sizes[0], $sizes[1]} -> $array_var[$strides[0] * i + $offsets[0], $strides[1] * j + offsets[1]] });
Source code in xdsl/dialects/csl.py
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | |
name = 'csl.get_mem_dsd'
class-attribute
instance-attribute
base_addr = operand_def(base(MemRefType) | base(TensorType[Attribute]))
class-attribute
instance-attribute
tensor_access = opt_prop_def(AffineMapAttr)
class-attribute
instance-attribute
traits = traits_def(Pure(), DsdOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
verify_() -> None
Source code in xdsl/dialects/csl.py
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | |
GetFabDsdOp
dataclass
Bases: _GetDsdOp
CSL built-in for DSDs of the form
@get_dsd( [ fabin_dsd | fabout_dsd ], .{ .extent = $sizes[0], .fabric_color = $fabric_color, .control = $control, # fabout_dsd only, not implemented .wavelet_index_offset = $wavelet_index_offset, # fabout_dsd only, not implemented });
Source code in xdsl/dialects/csl.py
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | |
name = 'csl.get_fab_dsd'
class-attribute
instance-attribute
fabric_color = prop_def(ColorIdAttr)
class-attribute
instance-attribute
queue_id = prop_def(QueueIdAttr)
class-attribute
instance-attribute
control = opt_prop_def(BoolAttr)
class-attribute
instance-attribute
wavelet_index_offset = opt_prop_def(BoolAttr)
class-attribute
instance-attribute
verify_() -> None
Source code in xdsl/dialects/csl.py
1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | |
SetDsdBaseAddrOp
dataclass
Bases: IRDLOperation
Returns a clone of the DSD with a different base_addr. Only works on memory DSDs, i.e. mem1d_dsd or mem4d_dsd.
Implements the CSL built-in @set_dsd_base_addr(input_dsd, base_addr)
Source code in xdsl/dialects/csl.py
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 | |
name = 'csl.set_dsd_base_addr'
class-attribute
instance-attribute
op = operand_def(DsdType)
class-attribute
instance-attribute
base_addr = operand_def(base(MemRefType) | base(TensorType[Attribute]) | base(PtrType))
class-attribute
instance-attribute
result = result_def(DsdType)
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
verify_() -> None
Source code in xdsl/dialects/csl.py
1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 | |
IncrementDsdOffsetOp
dataclass
Bases: IRDLOperation
Returns a clone of the DSD with a different offset Only works on memory DSDs, i.e. mem1d_dsd or mem4d_dsd.
Implements the CSL built-in @increment_dsd_offset(input_dsd, offset, elem_type)
where offset is a 16-bit signed int that may be negative, and elem_type is used to convert offset into words (any u,i,f type of 16,32 bit) elem_type should be derived by the printer
Source code in xdsl/dialects/csl.py
1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 | |
name = 'csl.increment_dsd_offset'
class-attribute
instance-attribute
op = operand_def(DsdType)
class-attribute
instance-attribute
offset = operand_def(eq(i16) | eq(i16_value))
class-attribute
instance-attribute
elem_type = prop_def(DsdElementTypeConstr)
class-attribute
instance-attribute
result = result_def(DsdType)
class-attribute
instance-attribute
traits = traits_def(Pure(), IncrementDsdOffsetOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
verify_() -> None
Source code in xdsl/dialects/csl.py
1277 1278 1279 1280 1281 1282 1283 | |
SetDsdLengthOp
dataclass
Bases: IRDLOperation
Returns a clone of the DSD with a different length Only works on 1-dimensional DSDs, i.e., mem1d_dsd and any fabric DSDs
Implements the CSL built-in @set_dsd_length(input_dsd, length)
Source code in xdsl/dialects/csl.py
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 | |
name = 'csl.set_dsd_length'
class-attribute
instance-attribute
op = operand_def(DsdType)
class-attribute
instance-attribute
length = operand_def(eq(i16) | eq(u16_value))
class-attribute
instance-attribute
result = result_def(DsdType)
class-attribute
instance-attribute
traits = traits_def(Pure(), SetDsdLengthOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
verify_() -> None
Source code in xdsl/dialects/csl.py
1303 1304 1305 1306 1307 1308 1309 1310 | |
SetDsdStrideOp
dataclass
Bases: IRDLOperation
Returns a clone of the DSD with a different stride Only works mem1d_dsd
Implements the CSL built-in @set_dsd_stride(input_dsd, stride)
Source code in xdsl/dialects/csl.py
1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 | |
name = 'csl.set_dsd_stride'
class-attribute
instance-attribute
op = operand_def(DsdType)
class-attribute
instance-attribute
stride = operand_def(eq(i8) | eq(i8_value))
class-attribute
instance-attribute
result = result_def(DsdType)
class-attribute
instance-attribute
traits = traits_def(Pure(), SetDsdStrideOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
verify_() -> None
Source code in xdsl/dialects/csl.py
1330 1331 1332 1333 1334 1335 | |
BuiltinDsdOp
dataclass
Bases: IRDLOperation, ABC
Source code in xdsl/dialects/csl.py
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 | |
ops = var_operand_def()
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures
class-attribute
verify_() -> None
Source code in xdsl/dialects/csl.py
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 | |
SymmetricBinary16BitOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1365 1366 1367 1368 1369 1370 1371 1372 | |
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, i16_value, DsdType), (DsdType, u16_value, DsdType), (DsdType, DsdType, i16_value), (DsdType, DsdType, u16_value)]
class-attribute
Unary16BitOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1375 1376 1377 1378 1379 1380 | |
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, i16_value), (DsdType, u16_value)]
class-attribute
Add16Op
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1383 1384 1385 | |
name = 'csl.add16'
class-attribute
instance-attribute
Add16cOp
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1388 1389 1390 | |
name = 'csl.addc16'
class-attribute
instance-attribute
And16Op
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1393 1394 1395 | |
name = 'csl.and16'
class-attribute
instance-attribute
ClzOp
dataclass
Bases: Unary16BitOp
Source code in xdsl/dialects/csl.py
1398 1399 1400 | |
name = 'csl.clz'
class-attribute
instance-attribute
CtzOp
dataclass
Bases: Unary16BitOp
Source code in xdsl/dialects/csl.py
1403 1404 1405 | |
name = 'csl.ctz'
class-attribute
instance-attribute
FabshOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1408 1409 1410 1411 1412 1413 1414 1415 | |
name = 'csl.fabsh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float16Type)]
class-attribute
FabssOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1418 1419 1420 1421 1422 1423 1424 1425 | |
name = 'csl.fabss'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float32Type)]
class-attribute
FaddhOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 | |
name = 'csl.faddh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float16Type, DsdType), (DsdType, DsdType, Float16Type), (f16_pointer, Float16Type, DsdType)]
class-attribute
FaddhsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 | |
name = 'csl.faddhs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float16Type, DsdType), (DsdType, DsdType, Float16Type), (f32_pointer, Float32Type, DsdType)]
class-attribute
FaddsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 | |
name = 'csl.fadds'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float32Type, DsdType), (DsdType, DsdType, Float32Type), (f32_pointer, Float32Type, DsdType)]
class-attribute
Fh2sOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1464 1465 1466 1467 1468 1469 1470 1471 | |
name = 'csl.fh2s'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float16Type)]
class-attribute
Fh2xp16Op
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1474 1475 1476 1477 1478 1479 1480 1481 1482 | |
name = 'csl.fh2xp16'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float16Type), (i16_pointer, Float16Type)]
class-attribute
FmachOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1485 1486 1487 1488 1489 1490 1491 | |
name = 'csl.fmach'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType, Float16Type)]
class-attribute
FmachsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1494 1495 1496 1497 1498 1499 1500 | |
name = 'csl.fmachs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType, Float16Type)]
class-attribute
FmacsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1503 1504 1505 1506 1507 1508 1509 | |
name = 'csl.fmacs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType, Float32Type)]
class-attribute
FmaxhOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 | |
name = 'csl.fmaxh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float16Type, DsdType), (DsdType, DsdType, Float16Type), (f16_pointer, Float16Type, DsdType)]
class-attribute
FmaxsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 | |
name = 'csl.fmaxs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float32Type, DsdType), (DsdType, DsdType, Float32Type), (f32_pointer, Float32Type, DsdType)]
class-attribute
FmovhOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1536 1537 1538 1539 1540 1541 1542 1543 1544 | |
name = 'csl.fmovh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (f16_pointer, DsdType), (DsdType, Float16Type)]
class-attribute
FmovsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1547 1548 1549 1550 1551 1552 1553 1554 1555 | |
name = 'csl.fmovs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (f32_pointer, DsdType), (DsdType, Float32Type)]
class-attribute
FmulhOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 | |
name = 'csl.fmulh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float16Type, DsdType), (DsdType, DsdType, Float16Type), (f16_pointer, Float16Type, DsdType)]
class-attribute
FmulsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 | |
name = 'csl.fmuls'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float32Type, DsdType), (DsdType, DsdType, Float32Type), (f32_pointer, Float32Type, DsdType)]
class-attribute
FneghOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1582 1583 1584 1585 1586 1587 1588 1589 | |
name = 'csl.fnegh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float16Type)]
class-attribute
FnegsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1592 1593 1594 1595 1596 1597 1598 1599 | |
name = 'csl.fnegs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float32Type)]
class-attribute
FnormhOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1602 1603 1604 1605 1606 | |
name = 'csl.fnormh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(f16_pointer, Float16Type)]
class-attribute
FnormsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1609 1610 1611 1612 1613 | |
name = 'csl.fnorms'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(f32_pointer, Float32Type)]
class-attribute
Fs2hOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1616 1617 1618 1619 1620 1621 1622 1623 | |
name = 'csl.fs2h'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float32Type)]
class-attribute
Fs2xp16Op
dataclass
Bases: BuiltinDsdOp
Implements @fs2xp16 Note: this actually converts to i16, not to i32
Source code in xdsl/dialects/csl.py
1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 | |
name = 'csl.fs2xp16'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, Float32Type), (i16_pointer, Float32Type)]
class-attribute
FscalehOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1642 1643 1644 1645 1646 | |
name = 'csl.fscaleh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(f16_pointer, Float16Type, i16_value)]
class-attribute
FscalesOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1649 1650 1651 1652 1653 | |
name = 'csl.fscales'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(f32_pointer, Float32Type, i16_value)]
class-attribute
FsubhOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 | |
name = 'csl.fsubh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float16Type, DsdType), (DsdType, DsdType, Float16Type), (f16_pointer, Float16Type, DsdType)]
class-attribute
FsubsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 | |
name = 'csl.fsubs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, Float32Type, DsdType), (DsdType, DsdType, Float32Type), (f32_pointer, Float32Type, DsdType)]
class-attribute
Mov16Op
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | |
name = 'csl.mov16'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (i16_pointer, DsdType), (u16_pointer, DsdType), (DsdType, i16_value), (DsdType, u16_value)]
class-attribute
Mov32Op
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 | |
name = 'csl.mov32'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (i32_pointer, DsdType), (u32_pointer, DsdType), (DsdType, i32_value), (DsdType, u32_value)]
class-attribute
Or16Op
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1706 1707 1708 | |
name = 'csl.or16'
class-attribute
instance-attribute
PopcntOp
dataclass
Bases: Unary16BitOp
Source code in xdsl/dialects/csl.py
1711 1712 1713 | |
name = 'csl.popcnt'
class-attribute
instance-attribute
Sar16Op
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1716 1717 1718 | |
name = 'csl.sar16'
class-attribute
instance-attribute
Sll16Op
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1721 1722 1723 | |
name = 'csl.sll16'
class-attribute
instance-attribute
Slr16Op
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1726 1727 1728 | |
name = 'csl.slr16'
class-attribute
instance-attribute
Sub16Op
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1731 1732 1733 1734 1735 1736 1737 1738 1739 | |
name = 'csl.sub16'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType, DsdType), (DsdType, DsdType, i16_value), (DsdType, DsdType, u16_value)]
class-attribute
Xor16Op
dataclass
Bases: SymmetricBinary16BitOp
Source code in xdsl/dialects/csl.py
1742 1743 1744 | |
name = 'csl.xor16'
class-attribute
instance-attribute
Xp162fhOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1747 1748 1749 1750 1751 1752 1753 1754 1755 | |
name = 'csl.xp162fh'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, i16_value), (DsdType, u16_value)]
class-attribute
Xp162fsOp
dataclass
Bases: BuiltinDsdOp
Source code in xdsl/dialects/csl.py
1758 1759 1760 1761 1762 1763 1764 1765 1766 | |
name = 'csl.xp162fs'
class-attribute
instance-attribute
SIGNATURES: FunctionSignatures = [(DsdType, DsdType), (DsdType, i16_value), (DsdType, u16_value)]
class-attribute
SymbolExportOp
Bases: IRDLOperation
This op does not correspond to any particular csl operation, it allows a symbol to be exported in a single operation in both layout and program module.
It corresponds to @export_name in layout and @export_symbol in program.
This op comes in two modes
- var_name: StringAttr, type: PtrType, value: Op(PtrType)
- var_name: SymbolRefAttr, type: FunctionType, value: None
Source code in xdsl/dialects/csl.py
1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 | |
name = 'csl.export'
class-attribute
instance-attribute
traits = traits_def(InModuleKind(ModuleKind.PROGRAM))
class-attribute
instance-attribute
value = opt_operand_def(PtrType)
class-attribute
instance-attribute
var_name = prop_def(base(StringAttr) | base(SymbolRefAttr))
class-attribute
instance-attribute
type = prop_def(base(PtrType) | base(FunctionType))
class-attribute
instance-attribute
__init__(sym_name: str | StringAttr, type_or_op: SSAValue | FunctionType)
Source code in xdsl/dialects/csl.py
1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 | |
get_name() -> str
Source code in xdsl/dialects/csl.py
1808 1809 1810 1811 1812 1813 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 | |
AddressOfFnOp
Bases: IRDLOperation
Takes the address of a function from symbol ref.
Result has to have kind SINGLE and constness CONST
Source code in xdsl/dialects/csl.py
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 | |
name = 'csl.addressof_fn'
class-attribute
instance-attribute
fn_name = prop_def(SymbolRefAttr)
class-attribute
instance-attribute
res = result_def(PtrType)
class-attribute
instance-attribute
__init__(fn: FuncOp)
Source code in xdsl/dialects/csl.py
1855 1856 1857 1858 1859 1860 1861 1862 1863 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 | |
AddressOfOp
Bases: IRDLOperation
Take the address of a scalar or an array (memref)
When taking the address of an array, the type of the returned pointer can be either a single pointer to the array or a many pointer to its contained type.
Source code in xdsl/dialects/csl.py
1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 | |
name = 'csl.addressof'
class-attribute
instance-attribute
value = operand_def()
class-attribute
instance-attribute
res = result_def(PtrType)
class-attribute
instance-attribute
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
__init__(value: SSAValue | Operation, result_type: PtrType)
Source code in xdsl/dialects/csl.py
1895 1896 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 | |
RpcOp
dataclass
Bases: IRDLOperation
represents a call to @rpc
When printing should wrap id in @get_data_task_id
Source code in xdsl/dialects/csl.py
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 | |
name = 'csl.rpc'
class-attribute
instance-attribute
traits = traits_def(InModuleKind(ModuleKind.PROGRAM))
class-attribute
instance-attribute
id = operand_def(ColorType)
class-attribute
instance-attribute
ParamOp
Bases: IRDLOperation
Represents param declarations in CSL
Whilst we can inline most things, the result of memcpy get_params
function still has to be passed as param.
It can also be useful to change some configuration parameters from the command line by passing params to the compiler.
Source code in xdsl/dialects/csl.py
1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 | |
T: ClassVar = VarConstraint('T', ParamOpAttrConstr)
class-attribute
instance-attribute
name = 'csl.param'
class-attribute
instance-attribute
traits = traits_def(HasParent(CslModuleOp))
class-attribute
instance-attribute
param_name = prop_def(StringAttr)
class-attribute
instance-attribute
init_value = opt_operand_def(T)
class-attribute
instance-attribute
res = result_def(T)
class-attribute
instance-attribute
__init__(name: str, result_type: ParamOpAttr, init_value: SSAValue | Operation | None = None)
Source code in xdsl/dialects/csl.py
2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 | |
SignednessCastOp
Bases: IRDLOperation
Cast that throws away signedness attributes
Source code in xdsl/dialects/csl.py
2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 | |
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
name = 'csl.mlir.signedness_cast'
class-attribute
instance-attribute
inp = operand_def(IntegerType)
class-attribute
instance-attribute
result = result_def(IntegerType)
class-attribute
instance-attribute
assembly_format = '$inp attr-dict `:` type($inp) `to` type($result)'
class-attribute
instance-attribute
__init__(op: SSAValue | Operation, result_type: IntegerType | None = None)
Create a signedness cast op.
If result_type is not provided, the signedness of the input type will be reversed in the following way: - Unsigned => Signless - Signed => Unsigned - Signless => Unsigned
Source code in xdsl/dialects/csl.py
2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 | |
verify_() -> None
Source code in xdsl/dialects/csl.py
2058 2059 2060 2061 2062 2063 2064 2065 2066 | |
ConcatStructOp
Bases: IRDLOperation
Concatenate two compile-time known structs
@concat_structs(this_struct, another_struct);
this_struct and another_struct are comptime expressions of anonymous struct type.
Attempting to concatenate a struct with named fields and a struct with nameless fields (e.g. .{1, 2}) results in an error.
Attempting to concatenate two structs with overlapping named fields also results in an error.
Source code in xdsl/dialects/csl.py
2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 | |
name = 'csl.concat_structs'
class-attribute
instance-attribute
this_struct = operand_def(ComptimeStructType)
class-attribute
instance-attribute
another_struct = operand_def(ComptimeStructType)
class-attribute
instance-attribute
result = result_def(ComptimeStructType)
class-attribute
instance-attribute
__init__(struct_a: Operation | SSAValue, struct_b: Operation | SSAValue)
Source code in xdsl/dialects/csl.py
2091 2092 2093 2094 2095 | |