[PATCH] D37906: [CUDA] Work around a new quirk in CUDA9 headers.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 09:53:52 PDT 2017


tra added a comment.

I don't think we really care why they do it for nvcc. 
My understanding is that nvcc needs to avoid name clashes between their implementation of functions and the ones that come from the host headers and that's why they have to tread really carefully around host includes.

We just need to get those definitions of the device-side functions and we don't care whether host-side functions with the same name are visible at the same time. I wish CUDA would just put all device-side function definitions into a separate file/namespace and let us cherry-pick them at will. Alas, we have to work around nvcc's work arounds...

BTW, this change essentially augments the job that the "#undef __GNUC__" above used to do in older CUDA versions.  CUDA9 replaced __GNUC__ with _GLIBCXX_MATH_H in CUDA-9 in some places.


https://reviews.llvm.org/D37906





More information about the cfe-commits mailing list