Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion devito/core/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class DeviceOperatorMixin:
# Overrides the default values in the main Operator class
BLOCK_LEVELS = 0
CIRE_BLOCK_TEMPS = False
PAR_TILE_UNBOUND = True
MPI_MODES = (True, 'basic',)

GPU_FIT = 'all-fallback'
Expand Down Expand Up @@ -91,7 +92,7 @@ def _normalize_kwargs(cls, **kwargs):
o['par-tile'] = ParTile(oo.pop('par-tile', False), default=(32, 4, 4),
sparse=oo.pop('par-tile-sparse', None),
reduce=oo.pop('par-tile-reduce', None),
unbound=True)
unbound=cls.PAR_TILE_UNBOUND)
o['par-collapse-ncores'] = 1 # Always collapse (meaningful if `par-tile=False`)
o['par-collapse-work'] = 1 # Always collapse (meaningful if `par-tile=False`)
o['par-chunk-nonaffine'] = oo.pop('par-chunk-nonaffine', cls.PAR_CHUNK_NONAFFINE)
Expand Down
10 changes: 6 additions & 4 deletions tests/test_gpu_openacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ def test_multiple_tile_sizes(self, par_tile):
assert trees[3][1].pragmas[0].ccode.value ==\
f'acc parallel loop {sclause} present(src,src_gp,src_wx,src_wy,src_wz,u)'

def test_short_multi_tile_keeps_outer_dim_blocked(self):
@pytest.mark.parametrize('par_tile', [
((32, 4), (16, 4)),
((32, 4, 4), (16, 4)),
])
def test_short_multi_tile_keeps_outer_dim_blocked(self, par_tile):
"""
A multi `par-tile` entry shorter than the nest it lands on must not cost
the outermost Dimension its BlockDimension: on a device, dropping it
Expand All @@ -158,9 +162,7 @@ def test_short_multi_tile_keeps_outer_dim_blocked(self):
eqns = [Eq(u.forward, u.dx),
Eq(v.forward, u.forward.dx)]

# The second entry is 2D, while the nest it lands on is 3D
par_tile = ((32, 4, 4), (16, 4))

# OpenACC retains full blocking for short multi entries
op = Operator(eqns, platform='nvidiaX', language='openacc',
opt=(
'advanced',
Expand Down
Loading