Page MenuHomePhabricator

[CUDA] Define __CUDACC__ before standard library headers

Authored by tambre on Apr 17 2020, 12:00 PM.



libstdc++ since version 7 when GNU extensions are enabled (e.g. -std=gnu++11) use it to avoid defining overloads using __float128.
This fixes compiling with GNU extensions failing due to __float128 being used.

Discovered at

Diff Detail

Event Timeline

tambre created this revision.Apr 17 2020, 12:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2020, 12:00 PM
tambre edited the summary of this revision. (Show Details)Apr 17 2020, 12:01 PM
tambre edited the summary of this revision. (Show Details)
tra added inline comments.Apr 17 2020, 12:08 PM

We should undef CUDACC here to make sure it does not affect anything else in the headers we include further down.

tra updated this revision to Diff 258396.Apr 17 2020, 12:26 PM

Undef CUDACC after the standard headers.

tra accepted this revision.Apr 17 2020, 12:26 PM
This revision is now accepted and ready to land.Apr 17 2020, 12:26 PM
This revision was automatically updated to reflect the committed changes.