@@ -60,29 +60,29 @@ struct LinAlgHeaderIncludeHandler : public IDxcIncludeHandler {
6060};
6161
6262namespace 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
0 commit comments