Skip to content

Commit

Permalink
tests: squash
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Jul 20, 2021
1 parent ec1d7fd commit 4252061
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ def assert_blocking(operator, exp_nests):
pbs[iterations[0].dim.name] = parallel_blocks[0]
except IndexError:
pbs[iterations[0].dim.name] = tree[0]
iterations = []

# Return if no Incr dimensions, ensuring that no Incr expected
if not bns and not exp_nests:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_autotuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_multiple_blocking():
opt=('blocking', {'openmp': False}))

# First of all, make sure there are indeed two different loop nests
_, pbs = assert_blocking(op, {'x0_blk0', 'x1_blk0'})
_, _ = assert_blocking(op, {'x0_blk0', 'x1_blk0'})

# 'basic' mode
op.apply(time_M=0, autotune='basic')
Expand Down
16 changes: 14 additions & 2 deletions tests/test_dle.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,23 @@ def test_cache_blocking_structure_subdims():
# Local SubDimension -> no blocking expected
op = Operator(Eq(f[t+1, xl, y, z], f[t, xl, y, z] + 1))

_, pbs = assert_blocking(op, {})
_, _ = assert_blocking(op, {})

# Non-local SubDimension -> blocking expected
op = Operator(Eq(f.forward, f + 1, subdomain=grid.interior))
_, _ = assert_structure(op, ['t,i0x0_blk0,i0y0_blk0,i0x,i0y,i0z'])

bns, _ = assert_blocking(op, {'i0x0_blk0'})

trees = retrieve_iteration_tree(bns['i0x0_blk0'])
tree = trees[0]
assert len(tree) == 5
assert tree[0].dim.is_Incr and tree[0].dim.parent is xi and tree[0].dim.root is x
assert tree[1].dim.is_Incr and tree[1].dim.parent is yi and tree[1].dim.root is y
assert tree[2].dim.is_Incr and tree[2].dim.parent is tree[0].dim and\
tree[2].dim.root is x
assert tree[3].dim.is_Incr and tree[3].dim.parent is tree[1].dim and\
tree[3].dim.root is y
assert not tree[4].dim.is_Incr and tree[4].dim is zi and tree[4].dim.parent is z


@pytest.mark.parallel(mode=[(1, 'full')]) # Shortcut to put loops in nested efuncs
Expand Down

0 comments on commit 4252061

Please sign in to comment.