Skip to content

Commit 1275bd1

Browse files
Rename creatAllOnesTestMatrix to createSimpleTestMatrix to reflect its current implementation
1 parent 44b1ce9 commit 1275bd1

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

tools/clang/unittests/HLSLExec/CoopVec.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,9 @@ class TestVector {
597597
}
598598

599599
static TestVector
600-
createAllOnesTestMatrix(size_t NumVectors, size_t VectorSize,
601-
D3D12_LINEAR_ALGEBRA_DATATYPE DataInterpretation,
602-
std::mt19937 &Rnd) {
600+
createSimpleTestMatrix(size_t NumVectors, size_t VectorSize,
601+
D3D12_LINEAR_ALGEBRA_DATATYPE DataInterpretation,
602+
std::mt19937 &Rnd) {
603603
const size_t ElementSize =
604604
::CoopVecHelpers::GetMatrixElementSize(DataInterpretation);
605605

@@ -611,12 +611,18 @@ class TestVector {
611611
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT16:
612612
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT32:
613613
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT32:
614+
// The CPU reference matrix is always int8 for all integer
615+
// interpretations. The GPU version will be converted to the destination
616+
// format by ConvertLinearAlgebraMatrix.
614617
Vec.FillSimpleMatrixTestData<int8_t>(Rnd);
615618
break;
616619
case D3D12_LINEAR_ALGEBRA_DATATYPE_FLOAT_E4M3:
617620
case D3D12_LINEAR_ALGEBRA_DATATYPE_FLOAT_E5M2:
618621
case D3D12_LINEAR_ALGEBRA_DATATYPE_FLOAT16:
619622
case D3D12_LINEAR_ALGEBRA_DATATYPE_FLOAT32:
623+
// The CPU reference matrix is always FP32 for all FP interpretations.
624+
// The GPU version will be converted to the destination format by
625+
// ConvertLinearAlgebraMatrix.
620626
Vec.FillSimpleMatrixTestData<float>(Rnd);
621627
break;
622628
default:

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12420,12 +12420,12 @@ void ExecutionTest::runCoopVecMulSubtest(
1242012420
for (size_t I = 0; I < Config.NumLayers - 1; ++I) {
1242112421
// Each layer except the last is InputPerThread x InputPerThread
1242212422
InputMatrices.push_back(
12423-
::CoopVecHelpers::TestVector::createAllOnesTestMatrix(
12423+
::CoopVecHelpers::TestVector::createSimpleTestMatrix(
1242412424
Config.InputPerThread, Config.InputPerThread,
1242512425
MulProps.MatrixInterpretation, Rnd));
1242612426
}
1242712427
// Last layer, matrix size is OutputPerThread x InputPerThread
12428-
InputMatrices.push_back(::CoopVecHelpers::TestVector::createAllOnesTestMatrix(
12428+
InputMatrices.push_back(::CoopVecHelpers::TestVector::createSimpleTestMatrix(
1242912429
Config.OutputPerThread, Config.InputPerThread,
1243012430
MulProps.MatrixInterpretation, Rnd));
1243112431

0 commit comments

Comments
 (0)