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

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 19:32:32 PDT 2020


yaxunl marked an inline comment as done.
yaxunl added a comment.

In D84364#2255572 <https://reviews.llvm.org/D84364#2255572>, @tra wrote:

> 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.

Thanks Artem. Would you please also review https://reviews.llvm.org/D84362 since this patch depends on that. Thanks.



================
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")
 
----------------
tra wrote:
> The description does not seem to reflect reality. IIUIC only overload-related diagnostic messages will be deferred.
will fix when committing


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

https://reviews.llvm.org/D84364



More information about the cfe-commits mailing list