Csl stencil set global coeffs
csl_stencil_set_global_coeffs
¶
GenerateCoeffAPICalls
dataclass
¶
Bases: RewritePattern
Generates calls to the stencil_comms API to set coefficients.
The API currently supports only f32 coeffs.
Source code in xdsl/transforms/csl_stencil_set_global_coeffs.py
__init__() -> None
¶
match_and_rewrite(op: csl_wrapper.ModuleOp, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/csl_stencil_set_global_coeffs.py
CslStencilSetGlobalCoeffs
dataclass
¶
Bases: ModulePass
Generates a single coeff api call - only works if all csl_stencil.apply ops use the same coeffs.
csl_stencil.apply ops must be in a main csl.func inside a module wrapper.
Source code in xdsl/transforms/csl_stencil_set_global_coeffs.py
get_dir_and_distance(offset: stencil.IndexAttr | tuple[int, ...]) -> tuple[csl.Direction, int]
¶
Given an access op, return the distance and direction, assuming as access to a neighbour (not self) in a star-shape pattern
Source code in xdsl/transforms/csl_stencil_set_global_coeffs.py
get_dir_and_distance_ops(op: csl_stencil.AccessOp) -> tuple[csl.DirectionOp, arith.ConstantOp]
¶
Given an access op, return the distance and direction ops, assuming as access to a neighbour (not self) in a star-shape pattern