Skip to content
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

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

StephanTLavavej
Copy link
Member

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).

@StephanTLavavej StephanTLavavej added bug Something isn't working high priority Important! labels Apr 29, 2021
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner April 29, 2021 10:13
@sylveon
Copy link
Contributor

sylveon commented Apr 29, 2021

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

stl/inc/cmath Outdated Show resolved Hide resolved
Copy link
Member

@CaseyCarter CaseyCarter left a 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.
Copy link
Member

@CaseyCarter CaseyCarter left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority Important!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<cmath>: New intrinsics broke CUDA
5 participants