-
Notifications
You must be signed in to change notification settings - Fork 860
[SM 6.10][LinAlg] Fixes float truncation and coordinate calculation in LinAlg exec tests #8420
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
Changes from all commits
106f381
e8f988b
b5c6442
cc624bd
6c7e20a
23cc309
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,10 @@ | |
| #include <optional> | ||
| #include <sstream> | ||
| #include <string> | ||
|
|
||
| #define STREAM_FLOAT(stream, name, value) \ | ||
| stream << std::showpoint << " -D" << name << "=" << value << "F" \ | ||
| << std::noshowpoint | ||
| #include <variant> | ||
| #include <vector> | ||
|
|
||
|
|
@@ -505,7 +509,7 @@ static void runSplatStore(ID3D12Device *Device, | |
| const size_t BufferSize = Params.totalBytes(); | ||
|
|
||
| std::stringstream ExtraDefs; | ||
| ExtraDefs << "-DFILL_VALUE=" << FillValue; | ||
| STREAM_FLOAT(ExtraDefs, "FILL_VALUE", FillValue); | ||
|
|
||
| std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); | ||
|
|
||
|
|
@@ -624,7 +628,7 @@ static const char ElementAccessShader[] = R"( | |
| // flatten the 2D index into a 1D index then scale by element size | ||
| // Always store row-major and work it out in the test runner | ||
| uint coordToByteOffset(uint2 coord) { | ||
| return (coord.y * M_DIM + coord.x) * ELEM_SIZE; | ||
| return (coord.x * N_DIM + coord.y) * ELEM_SIZE; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. It sure can be confusing for
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was also vague in the spec until very recently. Thanks for the fix! |
||
| } | ||
|
|
||
| [WaveSize(4, 64)] | ||
|
|
@@ -936,8 +940,8 @@ static void runMatMatMul(ID3D12Device *Device, | |
|
|
||
| std::stringstream ExtraDefs; | ||
| ExtraDefs << " -DK_DIM=" << K; | ||
| ExtraDefs << " -DA_FILL=" << AFill; | ||
| ExtraDefs << " -DB_FILL=" << BFill; | ||
| STREAM_FLOAT(ExtraDefs, "A_FILL", AFill); | ||
| STREAM_FLOAT(ExtraDefs, "B_FILL", BFill); | ||
|
|
||
| std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); | ||
|
|
||
|
|
@@ -1018,9 +1022,9 @@ static void runMatMatMulAccum(ID3D12Device *Device, | |
|
|
||
| std::stringstream ExtraDefs; | ||
| ExtraDefs << " -DK_DIM=" << K; | ||
| ExtraDefs << " -DA_FILL=" << AFill; | ||
| ExtraDefs << " -DB_FILL=" << BFill; | ||
| ExtraDefs << " -DC_FILL=" << CFill; | ||
| STREAM_FLOAT(ExtraDefs, "A_FILL", AFill); | ||
| STREAM_FLOAT(ExtraDefs, "B_FILL", BFill); | ||
| STREAM_FLOAT(ExtraDefs, "C_FILL", CFill); | ||
|
|
||
| std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); | ||
|
|
||
|
|
@@ -1094,8 +1098,8 @@ static void runMatAccum(ID3D12Device *Device, | |
| const size_t BufferSize = Params.totalBytes(); | ||
|
|
||
| std::stringstream ExtraDefs; | ||
| ExtraDefs << " -DLHS_FILL=" << LHSFill; | ||
| ExtraDefs << " -DRHS_FILL=" << RHSFill; | ||
| STREAM_FLOAT(ExtraDefs, "LHS_FILL", LHSFill); | ||
| STREAM_FLOAT(ExtraDefs, "RHS_FILL", RHSFill); | ||
|
|
||
| std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); | ||
|
|
||
|
|
@@ -1552,7 +1556,7 @@ static void runStoreMemory(ID3D12Device *Device, | |
|
|
||
| std::stringstream ExtraDefs; | ||
| ExtraDefs << " -DOFFSET=" << 0; | ||
| ExtraDefs << " -DFILL_VALUE=" << FillValue; | ||
| STREAM_FLOAT(ExtraDefs, "FILL_VALUE", FillValue); | ||
|
|
||
| std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); | ||
|
|
||
|
|
@@ -1632,7 +1636,7 @@ static void runAccumulateMemory(ID3D12Device *Device, | |
|
|
||
| std::stringstream ExtraDefs; | ||
| ExtraDefs << " -DOFFSET=" << 0; | ||
| ExtraDefs << " -DFILL_VALUE=" << FillValue; | ||
| STREAM_FLOAT(ExtraDefs, "FILL_VALUE", FillValue); | ||
|
|
||
| std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str()); | ||
|
|
||
|
|
||
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.
While this is fine, I feel like the name makes it sound more generic, as if it might be defined like so:
And used like so:
ExtraDefs << "-DFILL_VALUE=" << STREAM_FLOAT(FillValue);