-
Notifications
You must be signed in to change notification settings - Fork 780
Long Vector Execution Tests: Merge unary and binary op tests to main #7549
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
Long Vector Execution Tests: Merge unary and binary op tests to main #7549
Conversation
Remove half and bool types for less code to review right now
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.
Just one minor comment regarding double denorms that could probably be addressed in a follow up.
return std::isnan(Ref); | ||
} | ||
|
||
if (Mode == hlsl::DXIL::Float32DenormMode::Any) { |
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.
Just FYI: denorms are required to be preserved for double-precision DXIL operations. So either this should default to Float32DenormMode::Preserve
, or we should just remove this branch.
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 can address in this PR. Conflicts is this file will be trivial in the diff for merging the rest.
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.
There are a couple files that don't have a new line at EOF you might consider adding.
if (!Initialized) { | ||
Initialized = true; | ||
|
||
HMODULE Runtime = LoadLibraryW(L"d3d12.dll"); |
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.
Where is this library freed?
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.
Good question, I wondered the same. This setup code is copied from
ExecutionTest.cpp and has the note below to not call FreeLibrary on the handle.
Which I now realize has a typo from the naming update. I'll do a little digging
and report back - this is worth understanding to make sure we aren't leaking the
library handle.
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.
There is no explicit FreeLibrary anywhere in this code. The library is
implicilty freed on process exit. This isn't inherently bad....but this is
generally considered bad practice. I think the original author was probably just
lazy. I dont see a good reason for why we shouldn't store this handle as a
member variable and call FreeLibrary on it in cleanup. I'll create an issue to
address that in a subsequent PR.
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.
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.
Well, I was trying the 'github pull requests' plugin for vscode out. Looks like its reply to comments just submits new comments. Pasting them here.
Good question, I wondered the same. This setup code is copied from
ExecutionTest.cpp and has the note below to not call FreeLibrary on the handle.
Which I now realize has a typo from the naming update. I'll do a little digging
and report back - this is worth understanding to make sure we aren't leaking the
library handle.
Summary
Adds infrastructure for long vector execution tests. This code and additional test cases were already added to the staging-sm6.9 branch. This is the second of several PRs to bring these changes into main. That being said, reviews of this code should treat it as brand new. Resolves #7545
Includes:
LongVector::OpTest
inLongVectors.h/cpp
, still part of theExecHLSLTests.dll
binary.ShaderOpArith.xml
to leverage the existing exec test framework for shader compilation and execution.LongVectorOpTable.xml
defining long vector test cases.LongVectorTestData.h
for statically defined input values, includingHLSLHalf_t
andHLSLBool_t
. This avoids duplicating values across test cases.Template Handling
To support template instantiation across translation units,
LongVectors.tpp
contains full template definitions included byLongVectors.h
. These were originally required when tests lived inExecutionTests.cpp
. Now that the tests are isolated, the plan is to move the definitions back intoLongVectors.cpp
after merging the long vector tests fromstaging-sm6.9
to simplify the manual merge.Utilities
HlslTestUtils.h
includes minor updates to support the new test scenarios.