Skip to content

Commit 9b12adb

Browse files
committed
compiler: Privilege default par-tile with rcompile
1 parent e376a0d commit 9b12adb

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

devito/core/gpu.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,25 @@ def _rcompile_wrapper(cls, **kwargs0):
126126

127127
def wrapper(expressions, mode='default', options=None, **kwargs1):
128128
kwargs = {**kwargs0, **kwargs1}
129+
options = options or {}
129130

130131
if mode == 'host':
131-
options = options or {}
132132
target = {
133133
'platform': 'cpu64',
134134
'language': 'C' if options0['par-disabled'] else 'openmp',
135135
'compiler': 'custom'
136136
}
137137
else:
138-
options = {**options0, **(options or {})}
138+
# Always use the default `par-tile` for recursive compilation
139+
# unless the caller explicitly overrides it so that if the user
140+
# supplies a multi par-tile there is no need to worry about the
141+
# small kernels typically generated by recursive compilation
142+
par_tile = options.get('par-tile')
143+
if not par_tile:
144+
par_tile = options0['par-tile']
145+
par_tile = ParTile(par_tile.default, default=par_tile.default)
146+
options = {**options0, **options, 'par-tile': par_tile}
147+
139148
target = None
140149

141150
return rcompile(expressions, kwargs, options, target=target)

0 commit comments

Comments
 (0)