Skip to content

Commit 21d37a4

Browse files
[CoopVec] Check for minimum support set (#7457)
This change refactors the CoopVec test config selection to enforce running the minimum support set. Drivers that do not report all required data formats and interpretations will fail the test. The handling of `D3D12EnableExperimentalFeatures` is also refactored to apply only to the CoopVec tests, without the use of `-p:CooperativeVectorExperimental=*`.
1 parent 83ff8a0 commit 21d37a4

2 files changed

Lines changed: 278 additions & 97 deletions

File tree

tools/clang/unittests/HLSLExec/CoopVec.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ GetStrideMultiplierForMatrixDataType(D3D12_LINEAR_ALGEBRA_DATATYPE DataType) {
215215
return 2;
216216
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT32:
217217
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT32:
218+
case D3D12_LINEAR_ALGEBRA_DATATYPE_FLOAT32:
218219
return 4;
219220
default:
220221
VERIFY_FAIL(L"Unsupported matrix data type");
@@ -240,6 +241,10 @@ static size_t GetNumPackedElementsForInputDataType(
240241
static std::wstring
241242
GetHlslDataTypeForDataType(D3D12_LINEAR_ALGEBRA_DATATYPE DataType) {
242243
switch (DataType) {
244+
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT8_T4_PACKED:
245+
return L"int8_t4_packed";
246+
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT8_T4_PACKED:
247+
return L"uint8_t4_packed";
243248
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT16:
244249
return L"int16_t";
245250
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT16:
@@ -332,6 +337,8 @@ GetVectorElementSize(D3D12_LINEAR_ALGEBRA_DATATYPE DataType,
332337
return sizeof(int16_t);
333338
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT32:
334339
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT32:
340+
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT8_T4_PACKED:
341+
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT8_T4_PACKED:
335342
if (DataInterpretation == D3D12_LINEAR_ALGEBRA_DATATYPE_SINT8_T4_PACKED ||
336343
DataInterpretation == D3D12_LINEAR_ALGEBRA_DATATYPE_UINT8_T4_PACKED) {
337344
return sizeof(int8_t);
@@ -564,9 +571,11 @@ class TestVector {
564571
TestVector Vec(NumVectors, VectorSize, ElementSize);
565572
switch (DataType) {
566573
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT8:
574+
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT8_T4_PACKED:
567575
Vec.fillSimpleTestData<int8_t>(MatrixInterpretation, Rnd);
568576
break;
569577
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT8:
578+
case D3D12_LINEAR_ALGEBRA_DATATYPE_UINT8_T4_PACKED:
570579
Vec.fillSimpleTestData<uint8_t>(MatrixInterpretation, Rnd);
571580
break;
572581
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT16:

0 commit comments

Comments
 (0)