@@ -31,8 +31,7 @@ namespace LinearAlgebra {
3131//
3232
3333enum class OpType : unsigned {
34- #define OP (SYMBOL, ARITY, DEFINE, SHADER_NAME, INPUT_SET_1, INPUT_SET_2 ) \
35- SYMBOL,
34+ #define OP (SYMBOL, ARITY, DEFINE, SHADER_NAME, INPUT_SET_1, INPUT_SET_2 ) SYMBOL,
3635#include " LinearAlgebraOps.def"
3736 NumOpTypes
3837};
@@ -47,8 +46,11 @@ struct Operation {
4746
4847static constexpr Operation Operations[] = {
4948#define OP (SYMBOL, ARITY, DEFINE, SHADER_NAME, INPUT_SET_1, INPUT_SET_2 ) \
50- {ARITY, DEFINE, SHADER_NAME, \
51- {InputSet::INPUT_SET_1, InputSet::INPUT_SET_2}, OpType::SYMBOL},
49+ {ARITY, \
50+ DEFINE, \
51+ SHADER_NAME, \
52+ {InputSet::INPUT_SET_1, InputSet::INPUT_SET_2}, \
53+ OpType::SYMBOL},
5254#include " LinearAlgebraOps.def"
5355};
5456
@@ -75,7 +77,7 @@ template <typename T> const DataType &getDataType() {
7577
7678#define DATA_TYPE (TYPE, HLSL_STRING, COMP_TYPE, HLSL_SIZE, IS_16BIT ) \
7779 template <> const DataType &getDataType<TYPE>() { \
78- static DataType DT{HLSL_STRING, COMP_TYPE, IS_16BIT, HLSL_SIZE}; \
80+ static DataType DT{HLSL_STRING, COMP_TYPE, IS_16BIT, HLSL_SIZE}; \
7981 return DT; \
8082 }
8183
@@ -106,9 +108,7 @@ struct ValidationConfig {
106108 return {Tol, ValidationType::Epsilon};
107109 }
108110
109- static ValidationConfig Ulp (double Tol) {
110- return {Tol, ValidationType::Ulp};
111- }
111+ static ValidationConfig Ulp (double Tol) { return {Tol, ValidationType::Ulp}; }
112112};
113113
114114// Default validation: ULP for floating point, exact for integers.
@@ -162,8 +162,7 @@ bool doValuesMatch(float A, float B, double Tolerance, ValidationType VType) {
162162 }
163163}
164164
165- bool doValuesMatch (double A, double B, double Tolerance,
166- ValidationType VType) {
165+ bool doValuesMatch (double A, double B, double Tolerance, ValidationType VType) {
167166 switch (VType) {
168167 case ValidationType::Epsilon:
169168 return CompareDoubleEpsilon (A, B, Tolerance);
@@ -222,9 +221,9 @@ std::vector<MatrixDims> getMatrixSizesToTest() {
222221// Build compiler options.
223222//
224223
225- std::string
226- getCompilerOptionsString ( const Operation &Op, const DataType &ElemType,
227- size_t Rows, size_t Cols, size_t KDim = 0 ) {
224+ std::string getCompilerOptionsString ( const Operation &Op,
225+ const DataType &ElemType, size_t Rows ,
226+ size_t Cols, size_t KDim = 0 ) {
228227 std::stringstream Options;
229228
230229 if (ElemType.Is16Bit )
@@ -317,7 +316,7 @@ std::vector<T> buildIdentityMatrix(size_t Rows, size_t Cols) {
317316
318317template <typename T>
319318InputSets<T> buildTestInputs (const Operation &Op, size_t Rows, size_t Cols,
320- size_t KDim) {
319+ size_t KDim) {
321320 InputSets<T> Inputs;
322321 const size_t NumElements = Rows * Cols;
323322
@@ -341,18 +340,17 @@ InputSets<T> buildTestInputs(const Operation &Op, size_t Rows, size_t Cols,
341340
342341template <typename T>
343342std::optional<std::vector<T>>
344- runLinAlgTest (ID3D12Device *D3DDevice, bool VerboseLogging,
345- const Operation &Op, const InputSets<T> &Inputs, size_t Rows,
346- size_t Cols, size_t KDim, size_t ExpectedOutputSize) {
343+ runLinAlgTest (ID3D12Device *D3DDevice, bool VerboseLogging, const Operation &Op,
344+ const InputSets<T> &Inputs, size_t Rows, size_t Cols, size_t KDim ,
345+ size_t ExpectedOutputSize) {
347346
348347 const DataType &ElemType = getDataType<T>();
349348
350349 std::string CompilerOptions =
351350 getCompilerOptionsString (Op, ElemType, Rows, Cols, KDim);
352351
353352 if (VerboseLogging)
354- hlsl_test::LogCommentFmt (L" Compiler Options: %S" ,
355- CompilerOptions.c_str ());
353+ hlsl_test::LogCommentFmt (L" Compiler Options: %S" , CompilerOptions.c_str ());
356354
357355 dxc::SpecificDllLoader DxilDllLoader;
358356 CComPtr<IStream> TestXML;
@@ -473,8 +471,7 @@ template <typename T> struct ExpectedBuilder<OpType::MatrixAccumulate, T> {
473471};
474472
475473// MatrixMul: multiply input matrix by identity.
476- template <typename T>
477- struct Op <OpType::MatrixMul, T> : DefaultValidation<T> {};
474+ template <typename T> struct Op <OpType::MatrixMul, T> : DefaultValidation<T> {};
478475
479476template <typename T> struct ExpectedBuilder <OpType::MatrixMul, T> {
480477 static std::vector<T> buildExpected (Op<OpType::MatrixMul, T> &,
@@ -546,11 +543,9 @@ class LinAlgTestClassCommon {
546543 WEX::TestExecution::RuntimeParameters::TryGetValue (L" VerboseLogging" ,
547544 VerboseLogging);
548545 if (VerboseLogging)
549- hlsl_test::LogCommentFmt (
550- L" Verbose logging is enabled for this test." );
546+ hlsl_test::LogCommentFmt (L" Verbose logging is enabled for this test." );
551547 else
552- hlsl_test::LogCommentFmt (
553- L" Verbose logging is disabled for this test." );
548+ hlsl_test::LogCommentFmt (L" Verbose logging is disabled for this test." );
554549
555550 bool FailIfRequirementsNotMet = false ;
556551#ifdef _HLK_CONF
@@ -614,22 +609,18 @@ class LinAlgTestClassCommon {
614609class DxilConf_SM610_LinearAlgebra : public LinAlgTestClassCommon {
615610public:
616611 BEGIN_TEST_CLASS (DxilConf_SM610_LinearAlgebra)
617- TEST_CLASS_PROPERTY (
618- " Kits.TestName" ,
619- " D3D12 - Shader Model 6.10 - Linear Algebra Tests" )
612+ TEST_CLASS_PROPERTY (" Kits.TestName" ,
613+ " D3D12 - Shader Model 6.10 - Linear Algebra Tests" )
620614 TEST_CLASS_PROPERTY (" Kits.TestId" , " a1b2c3d4-e5f6-7890-abcd-ef1234567890" )
621- TEST_CLASS_PROPERTY (
622- " Kits.Description" ,
623- " Validates SM 6.10 linear algebra matrix operations" )
615+ TEST_CLASS_PROPERTY (" Kits.Description" ,
616+ " Validates SM 6.10 linear algebra matrix operations" )
624617 TEST_CLASS_PROPERTY (
625618 " Kits.Specification" ,
626619 " Device.Graphics.D3D12.DXILCore.ShaderModel610.CoreRequirement" )
627620 TEST_METHOD_PROPERTY (L" Priority" , L" 0" )
628621 END_TEST_CLASS ()
629622
630- TEST_CLASS_SETUP (setupClass) {
631- return LinAlgTestClassCommon::setupClass ();
632- }
623+ TEST_CLASS_SETUP (setupClass) { return LinAlgTestClassCommon::setupClass (); }
633624 TEST_METHOD_SETUP (setupMethod) {
634625 return LinAlgTestClassCommon::setupMethod ();
635626 }
0 commit comments