[PATCH] D47804: [CUDA] Replace 'nv_weak' attributes in CUDA headers with 'weak'.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 5 17:13:30 PDT 2018


tra added a comment.

I'll wait to see if that fixes @Hahnfeld's problem.

AFAICT, nv_weak is not used for anything interesting other than the device-side runtime stubs that return errors (apparently, until they are linked with the proper device runtime which would have strong version of the symbols.

I've tested with 8.0, 9.0 and 9.2 with -fcuda-rdc and all appear to produce .weak variants of those stubs in PTX.
One thing that I've noticed that we do differently is that those stubs being present in clang-generated PTX regardless of whether -fcuda-rdc is in effect. Well, there's only so much we can do with preprocessor magic. Other than wasted space, it's benign AFAICT. If it turns out that it's problematic after all, we should be able to disable them away with __attribute__((if_enabled...)).


https://reviews.llvm.org/D47804





More information about the cfe-commits mailing list