Skip to content

Commit 2458298

Browse files
committed
misc: Change name of new parameter
1 parent 63311db commit 2458298

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎devito/__init__.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@ def reinit_compiler(val):
112112
# optimisations.
113113
configuration.add('safe-math', 0, [0, 1], preprocessor=bool, callback=reinit_compiler)
114114

115-
# Use any GPU present on the node to set parameters such as the autopadding value.
116-
# This can be disabled by setting this parameter to `0`, but should not be toggled.
117-
# By setting the value to zero the user is promising that they will not try to use
118-
# the GPU at any point during the running of their script, this is useful when
119-
# iGPUs, APUs or disabled GPUs are present on a node.
120-
configuration.add('gpu', 1, [0, 1], preprocessor=bool)
121-
122115

123116
# Enable/disable automatic padding for allocated data
124117
def _preprocess_autopadding(v):
@@ -135,6 +128,13 @@ def _preprocess_autopadding(v):
135128
[False, True, 0, 1, np.float16, np.float32, np.float64],
136129
preprocessor=_preprocess_autopadding)
137130

131+
# Use any GPU present on the node to set parameters such as the autopadding
132+
# value. This can be disabled by setting this parameter to , but should not be
133+
# toggled. By setting the value to 'cpu-only' the user is promising that they
134+
# will not try to use the GPU at any point during the running of their script,
135+
# this is useful when iGPUs, APUs or disabled GPUs are present on a node.
136+
configuration.add('autopadding-mode', None, [None, 'cpu-only'])
137+
138138
# Select target device
139139
configuration.add('deviceid', -1, preprocessor=int, impacts_jit=False)
140140

‎devito/arch/archinfo.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ def node_max_mem_trans_nbytes(platform):
12461246

12471247
if isinstance(platform, Cpu64):
12481248
gpu_info = get_gpu_info()
1249-
if not configuration['gpu'] or not gpu_info:
1249+
if configuration['autopadding-mode'] == 'cpu-only' or not gpu_info:
12501250
# This node may simply not have a GPU
12511251
return mmtb0
12521252

‎devito/parameters.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ def _signature_items(self):
141141

142142
env_vars_mapper = {
143143
'DEVITO_ARCH': 'compiler',
144+
'DEVITO_AUTOPADDING_MODE': 'autopadding-mode',
144145
'DEVITO_AUTOTUNING': 'autotuning',
145146
'DEVITO_DEVELOP': 'develop-mode',
146147
'DEVITO_DEVICEID': 'deviceid',
147148
'DEVITO_FIRST_TOUCH': 'first-touch',
148-
'DEVITO_GPU': 'gpu',
149149
'DEVITO_IGNORE_UNKNOWN_PARAMS': 'ignore-unknowns',
150150
'DEVITO_JIT_BACKDOOR': 'jit-backdoor',
151151
'DEVITO_LANGUAGE': 'language',

‎tests/test_data.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def test_w_halo_wo_padding(self):
364364

365365
# Platform is used to fix the pad value
366366
# GPU is disabled to prevent GPU pad value from being used
367-
@switchconfig(gpu=0, autopadding=True, platform='bdw')
367+
@switchconfig(autopadding_mode='cpu-only', autopadding=True, platform='bdw')
368368
def test_w_halo_w_autopadding(self):
369369
grid = Grid(shape=(4, 4, 4))
370370
u0 = Function(name='u0', grid=grid, space_order=0)

0 commit comments

Comments
 (0)