[PATCH] D84364: [CUDA][HIP] Defer overloading resolution diagnostics for host device functions

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 16:41:32 PDT 2020


tra added a comment.

LGTM.

Nice!

To sum it up --  the patch introduces  `-fgpu-defer-diag` flag which allows deferring overload resolution diagnostics, if overload set included candidates from both sides.

We may be deferring cases when we don't have to (e.g. `df()->()callee2()` should've errored out right away, even during host compilation, as there's no way it could ever be valid), but this approach is a good starting point. It affects only the interesting subset of diags, is not enabled by default, and can be refined further, if necessary.



================
Comment at: clang/include/clang/Basic/LangOptions.def:244
 LANGOPT(GPUMaxThreadsPerBlock, 32, 256, "default max threads per block for kernel launch bounds for HIP")
+LANGOPT(GPUDeferDiag, 1, 0, "defer all semantic diagnostic messages in host device functions for CUDA/HIP")
 
----------------
The description does not seem to reflect reality. IIUIC only overload-related diagnostic messages will be deferred.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84364/new/

https://reviews.llvm.org/D84364



More information about the cfe-commits mailing list