Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Tai78641 committed Sep 9, 2024
1 parent 04d0d40 commit 45bdc50
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace tosa {
namespace {

// create a tosa rescale op and return its result value
Value buildRescale(PatternRewriter& rewriter, Location loc,
Value buildRescale(PatternRewriter &rewriter, Location loc,
ShapedType outputType, Value inputVal, int32_t multiplier,
int32_t shift, int64_t inputZp, int64_t outputZp,
bool doubleRound, bool scale32, bool perChannel) {
Expand All @@ -58,7 +58,7 @@ Value buildRescale(PatternRewriter& rewriter, Location loc,
}

// Creates TOSA rescale op with int32 output
Value buildRescaleToInt32(PatternRewriter& rewriter, Location loc,
Value buildRescaleToInt32(PatternRewriter &rewriter, Location loc,
Value inputVal, double inputScale, int64_t inputZp) {
auto inputType = cast<ShapedType>(inputVal.getType());
auto outputType = inputType.clone(rewriter.getI32Type());
Expand All @@ -76,7 +76,7 @@ Value buildRescaleToInt32(PatternRewriter& rewriter, Location loc,
}

// Creates TOSA rescale op with int32 input
Value buildRescaleFromInt32(PatternRewriter& rewriter, Location loc,
Value buildRescaleFromInt32(PatternRewriter &rewriter, Location loc,
ShapedType outputType, Value inputVal,
double outputScale, int64_t outputZp) {
// Input should be int32 type
Expand Down Expand Up @@ -315,22 +315,22 @@ LogicalResult matchAndRewriteOp(stablehlo::SubtractOp op,
}

LogicalResult matchAndRewriteOp(stablehlo::MulOp op,
PatternRewriter& rewriter) {
PatternRewriter &rewriter) {
return matchAndRewriteBinaryOp(op, rewriter, GetMulDivRescaleScales);
}

LogicalResult matchAndRewriteOp(stablehlo::DivOp op,
PatternRewriter& rewriter) {
PatternRewriter &rewriter) {
return matchAndRewriteBinaryOp(op, rewriter, GetMulDivRescaleScales);
}

LogicalResult matchAndRewriteOp(stablehlo::MinOp op,
PatternRewriter& rewriter) {
PatternRewriter &rewriter) {
return matchAndRewriteBinaryOp(op, rewriter, GetMinMaxRescaleScales);
}

LogicalResult matchAndRewriteOp(stablehlo::MaxOp op,
PatternRewriter& rewriter) {
PatternRewriter &rewriter) {
return matchAndRewriteBinaryOp(op, rewriter, GetMinMaxRescaleScales);
}

Expand Down Expand Up @@ -404,15 +404,15 @@ struct QuantizedStablehloOpConversion
: public OpRewritePattern<StablehloOpType> {
using OpRewritePattern<StablehloOpType>::OpRewritePattern;
LogicalResult matchAndRewrite(StablehloOpType op,
PatternRewriter& rewriter) const override {
PatternRewriter &rewriter) const override {
return matchAndRewriteOp(op, rewriter);
}
};

struct StablehloQuantLegalizeToTosaRescalePass
: impl::StablehloQuantLegalizeToTosaRescalePassBase<
StablehloQuantLegalizeToTosaRescalePass> {
LogicalResult initialize(MLIRContext* ctx) override {
LogicalResult initialize(MLIRContext *ctx) override {
RewritePatternSet patternList(ctx);
populateStablehloQuantLegalizeToTosaRescalePatterns(&patternList, ctx);
patterns = std::move(patternList);
Expand All @@ -434,7 +434,7 @@ struct StablehloQuantLegalizeToTosaRescalePass
} // namespace

void populateStablehloQuantLegalizeToTosaRescalePatterns(
RewritePatternSet* patterns, MLIRContext* context) {
RewritePatternSet *patterns, MLIRContext *context) {
// unary ops
patterns->addWithLabel<QuantizedStablehloOpConversion<stablehlo::AbsOp>>(
{"StablehloQuantAbsOp"}, context);
Expand Down

0 comments on commit 45bdc50

Please sign in to comment.