Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions tools/clang/unittests/HLSLExec/LongVectorTestData.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ struct HLSLHalf_t {
return FromHALF((DirectX::PackedVector::XMConvertFloatToHalf(A + B)));
}

HLSLHalf_t &operator+=(const HLSLHalf_t &Other) {
return *this = *this + Other;
}

HLSLHalf_t operator-(const HLSLHalf_t &Other) const {
const float A = DirectX::PackedVector::XMConvertHalfToFloat(Val);
const float B = DirectX::PackedVector::XMConvertHalfToFloat(Other.Val);
Expand Down
8 changes: 6 additions & 2 deletions tools/clang/unittests/HLSLExec/LongVectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,10 +1048,14 @@ template <typename T> struct ExpectedBuilder<OpType::Dot, T> {
const InputSets<T> &Inputs,
uint16_t ScalarInputFlags) {
UNREFERENCED_PARAMETER(ScalarInputFlags);
T DotProduct = T();

// Accumulate in fp32 to improve precision.
float DotProduct = 0.0f;
Comment on lines +1052 to +1053
Copy link
Member

Choose a reason for hiding this comment

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

I think there's more a story to this than just wanting to improve precision in the tests? Doesn't this mean we likely need to clarify something in the spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think we should clarify. I wasn't sure exactly where that clarification belongs though. Will follow up on that discussion with the team.


for (size_t I = 0; I < Inputs[0].size(); ++I) {
DotProduct += Inputs[0][I] * Inputs[1][I];
const float A = Inputs[0][I];
const float B = Inputs[1][I];
DotProduct += A * B;
}

std::vector<T> Expected;
Expand Down