Skip to content

Commit 3c92b66

Browse files
Address comment feedback in CoopVec.h
1 parent 19ea49f commit 3c92b66

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

tools/clang/unittests/HLSLExec/CoopVec.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct LinAlgHeaderIncludeHandler : public IDxcIncludeHandler {
5959
}
6060
};
6161

62-
struct CoopVecHelpers {
62+
namespace CoopVecHelpers {
6363
template <typename EltTy>
6464
static std::vector<uint8_t> CreateAllOnesInputMatrix(uint32_t Width,
6565
uint32_t Height) {
@@ -72,6 +72,9 @@ struct CoopVecHelpers {
7272
inputMatrix[i] = ConvertFloat32ToFloat16(1.0f);
7373
} else if constexpr (std::is_same_v<EltTy, float>) {
7474
inputMatrix[i] = 1.0f;
75+
} else {
76+
WEX::Logging::Log::Error(L"Unsupported input type");
77+
break;
7578
}
7679
}
7780

@@ -104,6 +107,7 @@ struct CoopVecHelpers {
104107
inputVector[TID * EltsPerThread + 1] = 1.0f;
105108
} else {
106109
WEX::Logging::Log::Error(L"Unsupported input type");
110+
break;
107111
}
108112
}
109113

@@ -277,9 +281,7 @@ struct CoopVecHelpers {
277281
// This type is used in generated HLSL source to represent the vector type
278282
// for the given data type.
279283
static std::wstring GetHlslDataTypeForDataType(
280-
D3D12_LINEAR_ALGEBRA_DATATYPE DataType,
281-
D3D12_LINEAR_ALGEBRA_DATATYPE InputInterpretation) {
282-
UNREFERENCED_PARAMETER(InputInterpretation);
284+
D3D12_LINEAR_ALGEBRA_DATATYPE DataType) {
283285
switch (DataType) {
284286
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT16:
285287
return L"int16_t";

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12297,10 +12297,10 @@ void main(uint threadIdx : SV_GroupThreadID)
1229712297
MulProps.InputInterpretation);
1229812298
const std::wstring InputDataType =
1229912299
CoopVecHelpers::GetHlslDataTypeForDataType(
12300-
MulProps.InputType, MulProps.InputInterpretation);
12300+
MulProps.InputType);
1230112301
const std::wstring AccumDataType =
12302-
CoopVecHelpers::GetHlslDataTypeForDataType(MulProps.BiasInterpretation,
12303-
MulProps.BiasInterpretation);
12302+
CoopVecHelpers::GetHlslDataTypeForDataType(
12303+
MulProps.BiasInterpretation);
1230412304
const std::wstring MatrixDataTypeEnum =
1230512305
CoopVecHelpers::GetHlslInterpretationForDataType(
1230612306
MulProps.MatrixInterpretation);
@@ -12901,11 +12901,10 @@ void main(uint threadIdx : SV_GroupThreadID)
1290112901
CoopVecHelpers::GetNumPackedElementsForInputDataType(
1290212902
AccumulateProps.InputType);
1290312903
const std::wstring InputDataType =
12904-
CoopVecHelpers::GetHlslDataTypeForDataType(AccumulateProps.InputType,
12905-
AccumulateProps.InputType);
12904+
CoopVecHelpers::GetHlslDataTypeForDataType(AccumulateProps.InputType);
1290612905
const std::wstring AccumDataType =
1290712906
CoopVecHelpers::GetHlslDataTypeForDataType(
12908-
AccumulateProps.AccumulationType, AccumulateProps.AccumulationType);
12907+
AccumulateProps.AccumulationType);
1290912908
const std::wstring MatrixDataTypeEnum =
1291012909
CoopVecHelpers::GetHlslInterpretationForDataType(
1291112910
AccumulateProps.AccumulationType);

0 commit comments

Comments
 (0)