Correctly detect NVRTC and lack of stl support. #1073
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NVRTC is Nvidia's runtime CUDA compiler. It's a pure CUDA compiler, so treats everything it sees as device code which is 'CUDA C++'. Similarly, it doesn't support system headers so Jitify is normally used, which has shims for header replacement whilst parsing the include hierarchy along with some other usability features.
When building with NVRTC (via Jitify), GLM's
setup.hpp
was incorrectly settingGLM_HAS_CXX11_STL
to1
, I'm not sure why (compiler predefined macros), really all CUDA compilation needs this flag set to0
asstd::isnan
and similar math intrisinsics in device code would normally cause compilation failure if called behindstd::
. This PR fixes that for NVRTC and leaves the current non-RTC CUDA behaviour unchanged by adding a new CUDA compiler flag.This reduces compilation errors in my test case from
to
I believe that final issue is one that can be fixed on Jitify's side, but I'll discuss that with them in future.
P.S. It's a shame to have lost issues since the repo was forked to g-truc, transferring the old repo to the org would have retained everything (and the old URL would be a permeant redirect to here, until a repo of same name was created in that acc).