def test_looplevel(gen):
    (x, y) = (hl.Var('x'), hl.Var('y'))
    target = hl.get_jit_target_from_environment()
    buffer_input = hl.Buffer(hl.UInt(8), [4, 4])
    buffer_input.fill(123)
    func_input = hl.Func('func_input')
    func_input[(x, y)] = (x + y)
    simple_compute_at = hl.LoopLevel()
    simple = gen(target, buffer_input, func_input, 3.5, compute_level=simple_compute_at)
    computed_output = hl.Func('computed_output')
    computed_output[(x, y)] = (simple[(x, y)] + 3)
    simple_compute_at.set(hl.LoopLevel(computed_output, x))
    _realize_and_check(computed_output, 3)
def test_looplevel(gen):
    (x, y) = (hl.Var('x'), hl.Var('y'))
    target = hl.get_jit_target_from_environment()
    buffer_input = hl.Buffer(hl.UInt(8), [4, 4])
    buffer_input.fill(123)
    func_input = hl.Func('func_input')
    func_input[(x, y)] = (x + y)
    simple_compute_at = hl.LoopLevel()
    simple = gen(target, buffer_input, func_input, 3.5, compute_level=simple_compute_at)
    computed_output = hl.Func('computed_output')
    computed_output[(x, y)] = (simple[(x, y)] + 3)
    simple_compute_at.set(hl.LoopLevel(computed_output, x))
    _realize_and_check(computed_output, 3)