-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix <cmath>
intrinsics for CUDA
#1886
Fix <cmath>
intrinsics for CUDA
#1886
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied my suggestion, which I don't see being controversial.
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).