We do this by wrapping <complex> and <algorithm>.
Tests are in the test-suite. <complex.h> support to come separately.
Paths
| Differential D24979
[CUDA] Support <complex> and std::min/max on the device. ClosedPublic Authored by jlebar on Sep 27 2016, 11:44 AM.
Details Summary We do this by wrapping <complex> and <algorithm>. Tests are in the test-suite. <complex.h> support to come separately.
Diff Detail Event Timelinejlebar updated this object. jlebar added parent revisions: D24978: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h., D24977: [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library., D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas..Sep 27 2016, 11:46 AM Comment Actions This looks like fix-includes and it may be somewhat shaky if users start messing with include paths. You may want to get @echristo's input on that. I' personally would prefer to force-include these files. I suspect it will not change things much as we already include a lot.
Comment Actions
We have already had bugs filed by users whose root cause was that we #included more things than nvcc #includes. I know exact compatibility with nvcc is not our goal, but unless we have a good reason I don't think we should break compatibility with nvcc *and* the C++ standard by force-including additional system headers.
We add this include path first, so I think it should be OK? What do you think, @echristo? echristo edited edge metadata. Comment Actions
It is very similar to fixincludes, but in this case I think it's probably the right thing. If nothing else it's very easy to change our minds later. One small wording change requested. Thanks! -eric
This revision is now accepted and ready to land.Sep 27 2016, 1:33 PM Closed by commit rL283680: [CUDA] Support <complex> and std::min/max on the device. (authored by jlebar). · Explain WhyOct 8 2016, 3:25 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 72719 clang/lib/Driver/ToolChains.cpp
clang/lib/Headers/CMakeLists.txt
clang/lib/Headers/__clang_cuda_complex_builtins.h
clang/lib/Headers/__clang_cuda_runtime_wrapper.h
clang/lib/Headers/cuda_wrappers/algorithm
clang/lib/Headers/cuda_wrappers/complex
|
path::append accepts multiple path parts so you can construct path in one call.