Fix <cmath> intrinsics for CUDA#1886
Merged
StephanTLavavej merged 2 commits intomicrosoft:mainfrom Apr 30, 2021
Merged
Conversation
sylveon
approved these changes
Apr 29, 2021
Contributor
|
The Intel compiler seems to have broken too, recommend adding a check for it as well: https://community.intel.com/t5/Intel-C-Compiler/error-LNK2019-unresolved-external-symbol-floorf-referenced-in/td-p/1267096 |
CaseyCarter
reviewed
Apr 29, 2021
CaseyCarter
suggested changes
Apr 29, 2021
Contributor
CaseyCarter
left a comment
There was a problem hiding this comment.
Oops - I made a single comment rather than starting another review.
Intel's C++ compilers also don't grok these intrinsics; the LLVM-based compilers define `__clang__`, but the "classic" compiler does not.
CaseyCarter
approved these changes
Apr 29, 2021
Contributor
CaseyCarter
left a comment
There was a problem hiding this comment.
I applied my suggestion, which I don't see being controversial.
barcharcraz
approved these changes
Apr 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1885.
This simply selects the classic CRT implementation when
__CUDACC__is defined. I'm centralizing this in_HAS_CMATH_INTRINSICS(which is a pattern we've started using elsewhere), which makes the diff look more complicated, but the code is ultimately simpler (and easier to modify in the future if we need to).