Skip to content

Commit 106f381

Browse files
Fixes float truncation and coordinate calculation in LinAlg exec tests
1 parent fe26157 commit 106f381

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tools/clang/unittests/HLSLExec/LinAlgTests.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ static void runSplatStore(ID3D12Device *Device,
505505
const size_t BufferSize = Params.totalBytes();
506506

507507
std::stringstream ExtraDefs;
508-
ExtraDefs << "-DFILL_VALUE=" << FillValue;
508+
ExtraDefs << std::showpoint << "-DFILL_VALUE=" << FillValue;
509509

510510
std::string Args = buildCompilerArgs(Params, ExtraDefs.str().c_str());
511511

@@ -624,7 +624,7 @@ static const char ElementAccessShader[] = R"(
624624
// flatten the 2D index into a 1D index then scale by element size
625625
// Always store row-major and work it out in the test runner
626626
uint coordToByteOffset(uint2 coord) {
627-
return (coord.y * M_DIM + coord.x) * ELEM_SIZE;
627+
return (coord.x * N_DIM + coord.y) * ELEM_SIZE;
628628
}
629629
630630
[WaveSize(4, 64)]
@@ -935,6 +935,7 @@ static void runMatMatMul(ID3D12Device *Device,
935935
const size_t BufferSize = Params.totalBytes();
936936

937937
std::stringstream ExtraDefs;
938+
ExtraDefs << std::showpoint;
938939
ExtraDefs << " -DK_DIM=" << K;
939940
ExtraDefs << " -DA_FILL=" << AFill;
940941
ExtraDefs << " -DB_FILL=" << BFill;
@@ -1017,6 +1018,7 @@ static void runMatMatMulAccum(ID3D12Device *Device,
10171018
const size_t BufferSize = Params.totalBytes();
10181019

10191020
std::stringstream ExtraDefs;
1021+
ExtraDefs << std::showpoint;
10201022
ExtraDefs << " -DK_DIM=" << K;
10211023
ExtraDefs << " -DA_FILL=" << AFill;
10221024
ExtraDefs << " -DB_FILL=" << BFill;
@@ -1094,6 +1096,7 @@ static void runMatAccum(ID3D12Device *Device,
10941096
const size_t BufferSize = Params.totalBytes();
10951097

10961098
std::stringstream ExtraDefs;
1099+
ExtraDefs << std::showpoint;
10971100
ExtraDefs << " -DLHS_FILL=" << LHSFill;
10981101
ExtraDefs << " -DRHS_FILL=" << RHSFill;
10991102

@@ -1551,6 +1554,7 @@ static void runStoreMemory(ID3D12Device *Device,
15511554
const size_t BufferSize = Params.totalBytes();
15521555

15531556
std::stringstream ExtraDefs;
1557+
ExtraDefs << std::showpoint;
15541558
ExtraDefs << " -DOFFSET=" << 0;
15551559
ExtraDefs << " -DFILL_VALUE=" << FillValue;
15561560

@@ -1631,6 +1635,7 @@ static void runAccumulateMemory(ID3D12Device *Device,
16311635
const size_t BufferSize = Params.totalBytes();
16321636

16331637
std::stringstream ExtraDefs;
1638+
ExtraDefs << std::showpoint;
16341639
ExtraDefs << " -DOFFSET=" << 0;
16351640
ExtraDefs << " -DFILL_VALUE=" << FillValue;
16361641

0 commit comments

Comments
 (0)