[clang] [Clang] Disable exceptions by default for GPU targets (PR #205402)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 25 05:48:01 PDT 2026
AaronBallman wrote:
> > I'm less confident about expectations there, particularly given how much effort WG21 has been putting into supporting GPUs with the library. CC @ldionne who may have more LWG-specific perspective than me.
> > That said, I was thinking about pushes NVidia made in this space in recent history, but then I spotted: https://developer.nvidia.com/blog/accelerating-standard-c-with-gpus-using-stdpar/#no_exceptions_in_gpu_code
>
> Yep, that's what current offloading code does. You accept it in the front-end but just lower it to a trap in codegen. I'm quite experienced when it comes to putting silly things on the GPU and I haven't bothered to make exceptions work. Even if they did work I'm pretty sure people would go out of their way not to use them.
SGTM, thanks for the discussion!
I think this is fine, but we'll have to change to using whatever new option we come up with when we handle constexpr exceptions so that those work at compile time on GPUs. CC @Sirraide for awareness.
https://github.com/llvm/llvm-project/pull/205402
More information about the cfe-commits
mailing list