Skip to content

Update LongVector Execution tests to now use XML #7393

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

Open
wants to merge 34 commits into
base: staging-sm6.9
Choose a base branch
from

Conversation

alsepkow
Copy link
Contributor

@alsepkow alsepkow commented Apr 28, 2025

This change is mainly focused on swapping to use the XML and statically defined values. Opting to stage this for review in smaller chunk while I iterate on adding the additional test cases.

  1. Update the LongVector exec tests to use the ShaderOpArithTable.xml TAEF table file for test entry points. This aligns with existing HLK tests.
  2. Some light code cleanup.
  3. Hard coded value sets in LongVectorTestData.h. Value sets give us a simple way to generate larger arrays from a smaller set of statically defined values. At a later point we can add logic to produce value sets at build time in this same header by consuming from a YAML file used in the offload test suite.

Copy link
Contributor

github-actions bot commented Apr 28, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@damyanp
Copy link
Member

damyanp commented Apr 29, 2025

I'm guessing that the submodule changes aren't meant to be a part of this change?

@alsepkow
Copy link
Contributor Author

I'm guessing that the submodule changes aren't meant to be a part of this change?

They are not. Accidentally grabbed those when I added the clang-format. Will fix.

LongVectorOpType_Clamp,
LongVectorOpType_Initialize,
LongVectorOpType_UnInitialized
enum LongVectorBinaryOpType {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just want to note here that for subsequent PR's that add more tests cases I'm going to split these enums up by category instead of unary vs binary.
HLSLOperators, trigonometric, math, etc. And then I'll also have some child classes that inherit from LongVectorTestConfig for these various categories to help split out the logic by category and avoid large switch statements.

@@ -3,6 +3,8 @@
find_package(TAEF REQUIRED)
find_package(D3D12 REQUIRED) # Used for ExecutionTest.cpp.

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see why we couldn't break things into multiple cpp files that we could copy over for the HLK test (like we do for ShaderOpTest.cpp). This ExecutionTest.cpp has gotten a bit out of hand!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll take a look into doing that. Originally this code was more coupled with other helper code in ExecutionTest.cpp.

A few thoughts come to mind though:

  1. How much time to we want to spend trying to clean this up right now vs getting long vector exec tests in.
  2. We might do a refactoring/re-writing of a bunch of this in the not-too-distant future.
  3. "We'll do this later" often just turns into never 😔.

But I'll still take a closer look and see what I could easily break up. I think it will make reviews easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd need to factor out some of the ShaderOpTest* code starting on line 3531 with the ShaderOpTestResultStruct. Seems reasonable to put that into ShaderOpTest.h/cpp. And the TableParameter/TableParameterHandler stuff would need to be factored out. That could probably also go in its own appropriately named header/cpp file.

Both seem like reasonable updates I could make to help clean this file up a little. Think its worth doing that?

BinaryOpType_EnumValueCount
};

static const LongVectorOpTypeStringToEnumValue BinaryOpTypeStringToEnumMap[] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't these be a std::map?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to have a static assert on the size to have a compile error if you forget to add to this enum value when adding an *OpType. Even declaring the std::map as static const still wouldn't allow a static assert on the size.

Open to ideas if you think some other pattern is cleaner though.

Copy link
Collaborator

@bob80905 bob80905 left a comment

Choose a reason for hiding this comment

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

Just some nits, take em or leave em

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

4 participants