def testMultitileSizes(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.MultiTileSizesOp(sequence.bodyTarget, dimension=1, target_size=42) transform.YieldOp()
def testTileCompact(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.TileOp(sequence.bodyTarget, sizes=[4, 8], interchange=[0, 1]) transform.YieldOp()
def testTileZero(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.TileOp(sequence.bodyTarget, sizes=[4, 0, 2, 0], interchange=[0, 1, 2, 3]) transform.YieldOp()
def testPad(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.PadOp(sequence.bodyTarget, padding_values=[FloatAttr.get_f32(42.0)], padding_dimensions=[1], transpose_paddings=[[1, 0]]) transform.YieldOp()
def testInterchange(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.InterchangeOp(sequence.bodyTarget, iterator_interchange=[ IntegerAttr.get( IntegerType.get_signless(64), 1), 0 ]) transform.YieldOp()
def testTileDynamic(): with_pdl = transform.WithPDLPatternsOp() with InsertionPoint(with_pdl.body): sequence = transform.SequenceOp(with_pdl.bodyTarget) with InsertionPoint(sequence.body): m1 = transform.PDLMatchOp(sequence.bodyTarget, "first") m2 = transform.PDLMatchOp(sequence.bodyTarget, "second") structured.TileOp(sequence.bodyTarget, sizes=[m1, 3, m2, 0]) transform.YieldOp()
def testTileAttributes(): sequence = transform.SequenceOp() attr = ArrayAttr.get( [IntegerAttr.get(IntegerType.get_signless(64), x) for x in [4, 8]]) ichange = ArrayAttr.get( [IntegerAttr.get(IntegerType.get_signless(64), x) for x in [0, 1]]) with InsertionPoint(sequence.body): structured.TileOp(sequence.bodyTarget, sizes=attr, interchange=ichange) transform.YieldOp()
def testSplit(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): split = structured.SplitOp(sequence.bodyTarget, dimension=1, split_point=42) structured.SplitOp(split.results[0], dimension=3, split_point=split.results[1]) transform.YieldOp()
def testScalarize(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.ScalarizeOp(sequence.bodyTarget) transform.YieldOp()
def testDecompose(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.DecomposeOp(sequence.bodyTarget) transform.YieldOp()
def testVectorize(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): structured.VectorizeOp(sequence.bodyTarget, vectorize_padding=True) transform.YieldOp()
def loopUnroll(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): loop.LoopUnrollOp(sequence.bodyTarget, factor=42) transform.YieldOp()
def loopPipeline(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): loop.LoopPipelineOp(sequence.bodyTarget, iteration_interval=3) transform.YieldOp()
def loopPeel(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): loop.LoopPeelOp(sequence.bodyTarget) transform.YieldOp()
def loopOutline(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): loop.LoopOutlineOp(sequence.bodyTarget, func_name="foo") transform.YieldOp()
def getParentLoop(): sequence = transform.SequenceOp() with InsertionPoint(sequence.body): loop.GetParentForOp(sequence.bodyTarget, num_loops=2) transform.YieldOp()