Skip to content

Commit de02159

Browse files
committed
api: Add DEVITO_DEVICE_DEFAULT env var
1 parent 019c837 commit de02159

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

FAQ.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ Used to select a specific "backend compiler". The backend compiler takes as inpu
292292
#### DEVITO_PLATFORM
293293
This environment variable is mostly needed when running on GPUs, to ask Devito to generate code for a particular device (see for example this [tutorial](https://github.com/devitocodes/devito/blob/main/examples/gpu/01_diffusion_with_openmp_offloading.ipynb)). Can be also used to specify CPU architectures such as Intel's -- Haswell, Broadwell, SKL and KNL -- ARM, AMD, and Power. Often one can ignore this variable because Devito typically does a decent job at auto-detecting the underlying platform.
294294

295+
#### DEVITO_DEVICEID
296+
Specify the default device to use when running on a GPU. This is useful when multiple GPUs are available on the system. The default is `0`, which means the first device. Use `1` for the second device, and so on.
297+
295298
#### DEVITO_LANGUAGE
296299
Specify the generated code language. The default is `C`, which means sequential C. Use `openmp` to emit C+OpenMP or `openacc` for C+OpenACC.
297300

devito/parameters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def _signature_items(self):
147147
'DEVITO_OPT': 'opt',
148148
'DEVITO_MPI': 'mpi',
149149
'DEVITO_TOPOLOGY': 'topology',
150+
'DEVITO_DEVICEID': 'deviceid',
150151
'DEVITO_LANGUAGE': 'language',
151152
'DEVITO_AUTOTUNING': 'autotuning',
152153
'DEVITO_LOGGING': 'log-level',

0 commit comments

Comments
 (0)