Skip to content

Commit 11e5d7f

Browse files
author
Spencer Bryngelson
committed
fix: correctly detect GPU build — ARG('gpu') returns 'no' not falsy
bool('no') is True in Python, so --no-gpu was incorrectly treated as a GPU build. Check against explicit non-GPU values instead.
1 parent 6bff725 commit 11e5d7f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

toolchain/mfc/test/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,10 @@ def run(self, targets: List[Union[str, MFCTarget]], gpus: Set[int]) -> subproces
307307

308308
# Set up environment: apply system-specific env vars from mpi_config.
309309
# gpu_env is applied only for GPU builds (e.g. MPICH_GPU_SUPPORT_ENABLED).
310+
# ARG("gpu") is "acc", "mp", or "no"/"" — only truthy GPU backends apply.
310311
env = dict(os.environ)
311312
env.update(cfg.env)
312-
gpu_build = bool(ARG("gpu"))
313+
gpu_build = ARG("gpu") not in (None, "", "no")
313314
if gpu_build:
314315
env.update(cfg.gpu_env)
315316
if gpus:

0 commit comments

Comments
 (0)