[PATCH] D77954: [CUDA][HIP] Fix overload resolution issue for device host functions

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 11 19:44:46 PDT 2020


yaxunl added a comment.

In D77954#1976378 <https://reviews.llvm.org/D77954#1976378>, @rjmccall wrote:

> I'm not saying that we need to be bug-for-bug-compatible with `nvcc`, I'm just saying that we should be able to point to *something* to justify our behavior.  I take it that the CUDA spec has rules for some amount of host/device-based overloading?  What are they based on?


I checked CUDA SDK documentation and did not find useful information about overloading resolution based on host/device attributes. I guess the rule can only be deduced from nvcc behavior.

Based on https://reviews.llvm.org/D12453, https://reviews.llvm.org/D18416, and https://bcain-llvm.readthedocs.io/projects/llvm/en/latest/CompileCudaWithLLVM/#overloading-based-on-host-and-device-attributes, cuda-clang has different overload resolution rules based host/device attributes. This is intentional design decision.


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

https://reviews.llvm.org/D77954





More information about the cfe-commits mailing list