[PATCH] D52938: [CUDA] Use all 64 bits of GUID in __nv_module_id
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 5 11:40:31 PDT 2018
tra added a comment.
This particular change is largely cosmetic. I've just spotted this nit while I was debugging a different problem.
It's also related to module ID.
We're trying to compile NCCL 2.3 with -fcuda-rdc and we were getting duplicate symbols when we tried to link multiple object files compiled from the same source file.
E.g.
clang++ -DPART1 -o foo-1.o foo.cu
clang++ -DPART2 -o foo-2.o foo.cu
...
nvlink ....
The stubs generated by nvlink ended up with conflicting names (based on module ID) that were identical for all foo-*.o.
It appears that clang generates ID based on the source file name only, so all foo-*.o end up with identical ID.
NVCC, on the other hand, appears to generate ID based on some other factors (compiler flags? preprocessed TU source?) so each object file gets a unique ID.
For now we've worked around this by renaming the source files before compilation of each part, but we will need to find a better solution.
https://reviews.llvm.org/D52938
More information about the cfe-commits
mailing list