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 cfloat comparison with fp16 #335

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

davidmallasen
Copy link
Contributor

Hello,

Since not all of the parameters are passed to the overloaded operator, when using fp16 aka sw::universal::cfloat<16, 5, short unsigned int, true, false, false> an error is thrown:

/include/universal/number/cfloat/cfloat_impl.hpp:3753:118: error: no matching function for call to ‘operator==(const sw::universal::cfloat<16, 5, short unsigned int, true, false, false>&, sw::universal::cfloat<16, 5, short unsigned int, false, false, false>)’
 3753 |         return operator<(lhs, cfloat<nbits, es, bt, hasSubnormals, hasSupernormals, isSaturating>(rhs)) || operator==(lhs, cfloat<nbits, es, bt>(rhs));

This PR fixes this.

Best,
David

Copy link
Contributor

@Ravenwater Ravenwater left a comment

Choose a reason for hiding this comment

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

Excellent catch.

@Ravenwater Ravenwater merged commit e24c1ad into stillwater-sc:main Apr 28, 2023
4 checks passed
@davidmallasen davidmallasen deleted the cfloat-fix branch April 28, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants