Skip to content

Commit 3db2db0

Browse files
clang-format
1 parent 3c92b66 commit 3db2db0

2 files changed

Lines changed: 26 additions & 28 deletions

File tree

tools/clang/unittests/HLSLExec/CoopVec.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,29 @@ struct LinAlgHeaderIncludeHandler : public IDxcIncludeHandler {
6060
};
6161

6262
namespace CoopVecHelpers {
63-
template <typename EltTy>
64-
static std::vector<uint8_t> CreateAllOnesInputMatrix(uint32_t Width,
65-
uint32_t Height) {
66-
std::vector<EltTy> inputMatrix(Width * Height);
67-
for (uint32_t i = 0; i < Width * Height; i++) {
68-
if constexpr (std::is_same_v<EltTy, uint8_t> ||
69-
std::is_same_v<EltTy, int8_t>) {
70-
inputMatrix[i] = 1;
71-
} else if constexpr (std::is_same_v<EltTy, DirectX::PackedVector::HALF>) {
72-
inputMatrix[i] = ConvertFloat32ToFloat16(1.0f);
73-
} else if constexpr (std::is_same_v<EltTy, float>) {
74-
inputMatrix[i] = 1.0f;
75-
} else {
76-
WEX::Logging::Log::Error(L"Unsupported input type");
77-
break;
78-
}
63+
template <typename EltTy>
64+
static std::vector<uint8_t> CreateAllOnesInputMatrix(uint32_t Width,
65+
uint32_t Height) {
66+
std::vector<EltTy> inputMatrix(Width * Height);
67+
for (uint32_t i = 0; i < Width * Height; i++) {
68+
if constexpr (std::is_same_v<EltTy, uint8_t> ||
69+
std::is_same_v<EltTy, int8_t>) {
70+
inputMatrix[i] = 1;
71+
} else if constexpr (std::is_same_v<EltTy, DirectX::PackedVector::HALF>) {
72+
inputMatrix[i] = ConvertFloat32ToFloat16(1.0f);
73+
} else if constexpr (std::is_same_v<EltTy, float>) {
74+
inputMatrix[i] = 1.0f;
75+
} else {
76+
WEX::Logging::Log::Error(L"Unsupported input type");
77+
break;
7978
}
79+
}
8080

81-
// Convert to uint8_t vector
82-
std::vector<uint8_t> uint8InputMatrix(inputMatrix.size() * sizeof(EltTy));
83-
std::memcpy(uint8InputMatrix.data(), inputMatrix.data(),
84-
inputMatrix.size() * sizeof(EltTy));
85-
return uint8InputMatrix;
81+
// Convert to uint8_t vector
82+
std::vector<uint8_t> uint8InputMatrix(inputMatrix.size() * sizeof(EltTy));
83+
std::memcpy(uint8InputMatrix.data(), inputMatrix.data(),
84+
inputMatrix.size() * sizeof(EltTy));
85+
return uint8InputMatrix;
8686
}
8787

8888
template <typename EltTy>
@@ -280,8 +280,8 @@ namespace CoopVecHelpers {
280280

281281
// This type is used in generated HLSL source to represent the vector type
282282
// for the given data type.
283-
static std::wstring GetHlslDataTypeForDataType(
284-
D3D12_LINEAR_ALGEBRA_DATATYPE DataType) {
283+
static std::wstring
284+
GetHlslDataTypeForDataType(D3D12_LINEAR_ALGEBRA_DATATYPE DataType) {
285285
switch (DataType) {
286286
case D3D12_LINEAR_ALGEBRA_DATATYPE_SINT16:
287287
return L"int16_t";
@@ -353,4 +353,4 @@ namespace CoopVecHelpers {
353353
return D3D12_LINEAR_ALGEBRA_DATATYPE_FLOAT32;
354354
}
355355
}
356-
};
356+
}; // namespace CoopVecHelpers

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12296,11 +12296,9 @@ void main(uint threadIdx : SV_GroupThreadID)
1229612296
CoopVecHelpers::GetNumPackedElementsForInputDataType(
1229712297
MulProps.InputInterpretation);
1229812298
const std::wstring InputDataType =
12299-
CoopVecHelpers::GetHlslDataTypeForDataType(
12300-
MulProps.InputType);
12299+
CoopVecHelpers::GetHlslDataTypeForDataType(MulProps.InputType);
1230112300
const std::wstring AccumDataType =
12302-
CoopVecHelpers::GetHlslDataTypeForDataType(
12303-
MulProps.BiasInterpretation);
12301+
CoopVecHelpers::GetHlslDataTypeForDataType(MulProps.BiasInterpretation);
1230412302
const std::wstring MatrixDataTypeEnum =
1230512303
CoopVecHelpers::GetHlslInterpretationForDataType(
1230612304
MulProps.MatrixInterpretation);

0 commit comments

Comments
 (0)