[all-commits] [llvm/llvm-project] 5ca2b9: [flang-rt][cuda] Skip scope-exit cleanup when the ...
Zhen Wang via All-commits
all-commits at lists.llvm.org
Fri Jul 31 14:38:46 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5ca2b9313c4f33385aa60c554cb36f76bef67e55
https://github.com/llvm/llvm-project/commit/5ca2b9313c4f33385aa60c554cb36f76bef67e55
Author: Zhen Wang <zhenw at nvidia.com>
Date: 2026-07-31 (Fri, 31 Jul 2026)
Changed paths:
M flang-rt/lib/cuda/allocator.cpp
M flang/test/Lower/CUDA/cuda-return01.cuf
Log Message:
-----------
[flang-rt][cuda] Skip scope-exit cleanup when the context has a sticky error (#213184)
A sticky CUDA error (e.g. an illegal memory access in a kernel) leaves
the primary context active but unusable, so CUFDeviceIsActive() reports
it as fine and the compiler-generated scope-exit frees abort a program
that ran to completion: 'cudaFree(p)' failed with
'cudaErrorIllegalAddress'.
Detect this by freeing a null pointer, a no-op that still reports the
sticky error. It runs only once the primary context is known active, so
it cannot lazily create one.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list