Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Fix several truncations and warnings in numerics #253

Merged
merged 5 commits into from
Mar 9, 2022
Merged

Conversation

wmaxey
Copy link
Member

@wmaxey wmaxey commented Mar 8, 2022

This fixes some longstanding MSVC issues. No functional impact, but resolves a few warnings making tests build clean.

https://nvbugswb.nvidia.com/NVBugs5/redir.aspx?url=/3556730

@wmaxey wmaxey added the nvbug Has an associated internal NVIDIA NVBug. label Mar 8, 2022
@wmaxey wmaxey requested a review from griwes March 8, 2022 20:14
@wmaxey wmaxey self-assigned this Mar 8, 2022
@@ -53,10 +53,12 @@ int main(int, char**)
test<__int128_t>(0);
test<__uint128_t>(0);
#endif
#if !defined(_MSC_VER)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these disabled on MSVC?

Copy link
Member Author

@wmaxey wmaxey Mar 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complaints of division by zero. I was going to @ you and ask about this one. Should we include host <cmath> and use some macro for INFINITY?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we silence the warning with a pragma?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an outright error:

C:\Users\wmaxey\Documents\temp\libcudacxx\.upstream-tests\test\std\language.support\support.limits\limits\numeric.limits.members\infinity.pass.cpp(56): error #39-D: division by zero

C:\Users\wmaxey\Documents\temp\libcudacxx\.upstream-tests\test\std\language.support\support.limits\limits\numeric.limits.members\infinity.pass.cpp(57): error #39-D: division by zero

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Okay.

Yeah let's use INFINITY. I'd rather not have this commented out on MSVC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in latest commit and tested on MSVC 14.30/16/12.

@wmaxey wmaxey changed the title Bugfix/msvc numerics Fix several truncations and warnings in numerics Mar 9, 2022
@wmaxey wmaxey merged commit 0e5efa8 into main Mar 9, 2022
@wmaxey wmaxey deleted the bugfix/msvc_numerics branch March 9, 2022 02:27
@wmaxey wmaxey added this to the 1.8.0 milestone Mar 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
nvbug Has an associated internal NVIDIA NVBug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants