Exemple #1
0
def test_same_node_read_write_not_overlap():

    oir = StencilFactory(vertical_loops=[
        VerticalLoopFactory(sections__0=VerticalLoopSectionFactory(
            interval=Interval(start=AxisBound.start(),
                              end=AxisBound.from_start(1)),
            horizontal_executions__0__body__0=AssignStmtFactory(
                left__name="field", right__name="other"),
        )),
        VerticalLoopFactory(sections__0=VerticalLoopSectionFactory(
            interval=Interval(start=AxisBound.from_start(1),
                              end=AxisBound.from_start(2)),
            horizontal_executions__0__body__0=AssignStmtFactory(
                left__name="field", right__name="field", right__offset__k=-1),
        )),
    ])
    sdfg = OirSDFGBuilder().visit(oir)
    convert(sdfg, oir.loc)
Exemple #2
0
def test_two_vertical_loops_no_read():
    oir_pre = StencilFactory(vertical_loops=[
        VerticalLoopFactory(sections__0=VerticalLoopSectionFactory(
            horizontal_executions=[
                HorizontalExecutionFactory(body__0=AssignStmtFactory(
                    left__name="field",
                    right=Literal(value="42.0", dtype=DataType.FLOAT32),
                ))
            ],
            interval__end=AxisBound.from_start(3),
        ), ),
        VerticalLoopFactory(sections__0=VerticalLoopSectionFactory(
            horizontal_executions=[
                HorizontalExecutionFactory(body__0=AssignStmtFactory(
                    left__name="field",
                    right=Literal(value="43.0", dtype=DataType.FLOAT32),
                ))
            ],
            interval__start=AxisBound.from_start(3),
        ), ),
    ])
    sdfg = OirSDFGBuilder().visit(oir_pre)
    convert(sdfg, oir_pre.loc)