[clang] [CUDA][HIP] Fix host/device context in concept (PR #67721)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 11:15:37 PST 2024


Artem-B wrote:

While I'm not sure how concepts will work in CUDA in the end, I'm OK with fixing obviously wrong behaviors now, without potentially paining ourselves into a corner.
The key issue in the example in https://godbolt.org/z/o7Wa68n9c seems to be that CUDA's context-aware overload resolution seems to be broken in concepts. E.g. https://godbolt.org/z/EzhhMqsGe -- plain call works, but in the constraint it does not.

Would fixing this particular issue (get in-constraint call to be resolved to the same function the regular call was) address the problem at hand that you want to solve? 

I'd be OK with a tactical fix addressing overload resolution above. Making a language-wide call on how we're going to treat concepts going forward would probably need more discussions and may be better suited for an RFC. This should get sorted out between AMD (HIP), NVIDIA(CUDA) and LLVM/Clang(C++), and, maybe OpenCL stakeholders, so we all are on the same page on what it means for concepts use in heterogeneous compute.

https://github.com/llvm/llvm-project/pull/67721


More information about the cfe-commits mailing list