Artem-B wrote:

> When I say "HD-promoted," I don't mean the function's attributes got promoted 
> to __host__ __device__. I mean its emission state changed — it went from 
> "might not need device codegen" to "must emit device code" because a device 
> function calls it.

I see. Does mentioning "HD promoted" add any value to the diags? Why not just 
print actual target attributes for all functions in the call chains. That 
should make diagnostics unambiguous, I think.

I'm fine with not distinguishing implicit/explicit, as long as we tell the user 
what compiler thinks of the target attributes for all functions in the call 
chain. That's the key piece of info we need to reason about the error. How 
compiler arrived at particular attributes is secondary. I.e. nominally 
attribute-less constexpr function would be HD in the call chain, but it's easy 
enough to figure the reason. Making it easier to tell compiler-inferred 
attributes from explicit ones could be useful but it's probably not critical 
for diagnosing this class of errors.

https://github.com/llvm/llvm-project/pull/187153
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to