-
Couldn't load subscription status.
- Fork 802
Adding IsFinite long vector tests #7836
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
| INPUT_SET(InputSet::Positive, 1.0f, 1.0f, 65535.0f, 0.01f, 5531.0f, 0.01f, 1.0f, | ||
| 0.01f, 331.2330f, 3250.01f); | ||
| INPUT_SET(InputSet::SelectCond, 0.0f, 1.0f); | ||
| INPUT_SET(InputSet::Infinite, std::numeric_limits<float>::infinity(), |
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.
You'll want to add some finite values to the set of values we test. Otherwise, all the results are just going to be false.
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.
Looking forward a bit, we know that we're going to be adding some more special values? Would it be better to have an input set that contains a mixture of non-special and special float values?
| INPUT_SET(InputSet::Positive, 1.0, 1.0, 342.0, 0.01, 5531.0, 0.01, 1.0, 0.01, | ||
| 331.2330, 3250.01); | ||
| INPUT_SET(InputSet::SelectCond, 0.0, 1.0); | ||
| INPUT_SET(InputSet::Infinite, std::numeric_limits<HLSLHalf_t>::infinity(), |
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.
You should double check what's happening here. Passing HLSLHalf_t as the template argument to std::numeric_limits will be doing an implicit conversion to float. Which is fine. And it looks like DirectX::PackedVector::XMConvertFloatToHalf does the right thing by converting that to an inf 'HALF'.
I think it would be better to do std::numeric_limits::infinity() to be more explicit. What do you think?
| // Float Ops | ||
| // | ||
|
|
||
| #define BOOLEAN_FLOAT_OP(OP, IMPL) \ |
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'm assuming this macro will be helpful for the other float ops we're adding.
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.
"boolean float op" sounds a bit contradictory.
I think we're doing a bunch of "float specials" here, I wonder if it would make sense to group them in that way?
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.
Some minor suggestions. Outside of those LGTM
|
Please associate this with the appropriate workitem (maybe with a "closes #xxx" type thing in the PR description) |
| OP(Ternary, Select, 3, "TestSelect", "", " -DFUNC_TEST_SELECT=1", | ||
| "LongVectorOp", SelectCond, Default2, Default3) | ||
|
|
||
| OP(Unary, IsFinite, 1, "TestIsFinite", "", " -DFUNC_TEST_ISFINITE=1", |
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.
Is Unary the right group to use here? Why not UnaryMath (and if so, should move this up next to the other unary math ops)
| INPUT_SET(InputSet::Positive, 1.0f, 1.0f, 65535.0f, 0.01f, 5531.0f, 0.01f, 1.0f, | ||
| 0.01f, 331.2330f, 3250.01f); | ||
| INPUT_SET(InputSet::SelectCond, 0.0f, 1.0f); | ||
| INPUT_SET(InputSet::Infinite, std::numeric_limits<float>::infinity(), |
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.
Looking forward a bit, we know that we're going to be adding some more special values? Would it be better to have an input set that contains a mixture of non-special and special float values?
| // Float Ops | ||
| // | ||
|
|
||
| #define BOOLEAN_FLOAT_OP(OP, IMPL) \ |
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.
"boolean float op" sounds a bit contradictory.
I think we're doing a bunch of "float specials" here, I wonder if it would make sense to group them in that way?
| HLK_TEST(IsFinite, double); | ||
| // Explicit Cast |
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.
| HLK_TEST(IsFinite, double); | |
| // Explicit Cast | |
| HLK_TEST(IsFinite, double); | |
| // Explicit Cast |
| } | ||
| #endif | ||
| #ifdef FUNC_TEST_ISFINITE |
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.
Should this really be something like "FLOAT_SPECIALS" and have another define choose between isinifite, isinf and isnan?
This PR adds
isfiniteintrinsic test to long vectors.Closes: #7850