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

example 22 now tests emulated_float64_t #114

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Przemog1
Copy link
Contributor

No description provided.

Comment on lines +584 to +607
TestValues expectedTestValues = {
.intCreateVal = static_cast<emulated::emulated_float64_t::storage_t>(24.0),
.uintCreateVal = static_cast<emulated::emulated_float64_t::storage_t>(24u),
.uint64CreateVal = static_cast<emulated::emulated_float64_t::storage_t>(24ull),
.floatCreateVal = static_cast<emulated::emulated_float64_t::storage_t>(1.2f),
.doubleCreateVal = static_cast<emulated::emulated_float64_t::storage_t>(1.2),
.additionVal = emulated::emulated_float64_t::create(30.0),
.substractionVal = emulated::emulated_float64_t::create(10.0),
.multiplicationVal = emulated::emulated_float64_t::create(200.0),
.divisionVal = emulated::emulated_float64_t::create(2.0),
.lessOrEqualVal = false,
.greaterOrEqualVal = true,
.equalVal = false,
.notEqualVal = true,
.lessVal = false,
.greaterVal = true,
.convertionToBoolVal = true,
.convertionToIntVal = 20,
.convertionToUint32Val = 20u,
.convertionToUint64Val = 20ull,
.convertionToFloatVal = 20.0f,
.convertionToDoubleVal = 20.0,
//.convertionToHalfVal = 20;
};

Choose a reason for hiding this comment

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

what you could do is use xoroshiro64** or somethign similar to come up with 64bit patterns denoting individual lhs and rhs values, then runs same code on CPU and GPU for a few hundred/thousand "random" doubles and see if you match

Obviously the create with different data types, and handling of Inf and NaN in operators needs to be tested specially, but you get the flow.

The more of the operation/input matching code you can hoist to a common HLSL/C++ header the better.

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