From bf24e452e5da0c35f5aa1ac8dd5ef3d065a43889 Mon Sep 17 00:00:00 2001 From: Djordje Ramic Date: Thu, 14 Nov 2024 14:39:22 +0000 Subject: [PATCH] Correct clang-format --- .../Rock/Tuning/QuickTuningPerfconfigs.inc | 1 + .../Dialect/Rock/Tuning/GridwiseGemmParams.cpp | 18 +++++++++--------- .../performance/analysis/quickTuningGen.py | 6 +++++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mlir/include/mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc b/mlir/include/mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc index 110184127e63..87108f23834b 100644 --- a/mlir/include/mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc +++ b/mlir/include/mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc @@ -1,6 +1,7 @@ // THIS IS AN AUTOGENERATED FILE. // DO NOT EDIT THIS FILE DIRECTLY! +// clang-format off #ifdef NonAccel_DEFINITIONS_GEN // BEGIN_GEMM_NonAccel_f32_DEFS diff --git a/mlir/lib/Dialect/Rock/Tuning/GridwiseGemmParams.cpp b/mlir/lib/Dialect/Rock/Tuning/GridwiseGemmParams.cpp index 84e0e535ea4b..87e16edaa675 100644 --- a/mlir/lib/Dialect/Rock/Tuning/GridwiseGemmParams.cpp +++ b/mlir/lib/Dialect/Rock/Tuning/GridwiseGemmParams.cpp @@ -37,9 +37,9 @@ llvm::raw_ostream &mlir::rock::operator<<(llvm::raw_ostream &os, /// Non-xdlops // clang-format off - #define NonAccel_DEFINITIONS_GEN - #include "mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc" - #undef NonAccel_DEFINITIONS_GEN +#define NonAccel_DEFINITIONS_GEN +#include "mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc" +#undef NonAccel_DEFINITIONS_GEN // clang-format on PopulateParamsInfo PopulateParamsInfo::fromOp(RockGemmWrapperInterface op) { @@ -409,9 +409,9 @@ PopulateParamsAccel::obtainTuningParameters(RockGemmWrapperInterface op, /// Xdlops acceleration // clang-format off - #define XDL_DEFINITIONS_GEN - #include "mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc" - #undef XDL_DEFINITIONS_GEN +#define XDL_DEFINITIONS_GEN +#include "mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc" +#undef XDL_DEFINITIONS_GEN // clang-format on LogicalResult PopulateParamsXDL::isValidBlockwiseGemm( @@ -611,9 +611,9 @@ PopulateParamsXDL::getGemmParamsAttr(OpBuilder &builder, /// Wmma acceleration // clang-format off - #define Wmma_DEFINITIONS_GEN - #include "mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc" - #undef Wmma_DEFINITIONS_GEN +#define Wmma_DEFINITIONS_GEN +#include "mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc" +#undef Wmma_DEFINITIONS_GEN // clang-format on LogicalResult PopulateParamsWmma::isValidBlockwiseGemm( diff --git a/mlir/utils/performance/analysis/quickTuningGen.py b/mlir/utils/performance/analysis/quickTuningGen.py index 73b52813a4ff..d8c2da10627d 100644 --- a/mlir/utils/performance/analysis/quickTuningGen.py +++ b/mlir/utils/performance/analysis/quickTuningGen.py @@ -96,6 +96,7 @@ def init_inc_file(self, file_path): with open(file_path, 'w') as file: file.write("// THIS IS AN AUTOGENERATED FILE.\n") file.write("// DO NOT EDIT THIS FILE DIRECTLY!\n\n") + file.write("// clang-format off\n") for instrction_type, datatypes in instruction_types_to_datatypes.items(): file.write(f"#ifdef {instrction_type}_DEFINITIONS_GEN\n\n") for datatype in datatypes: @@ -357,7 +358,10 @@ def print_results(result): def main(args=None): - + """ + usage: quickTunerGen.py [-h] --input-dir INPUT_DIR --op {gemm,conv} [--th TH] --arch ARCH [--update] [--no-splitK] + usage exsample: python3 quickTunerGen.py --input-dir tunedData --op conv --arch gfx90a --update --no-splitK + """ if args is None: args = sys.argv[1:]