From 9dd6fa06c56e64c7b080abf23aad1594ccc6db50 Mon Sep 17 00:00:00 2001 From: Tom Bannink Date: Sun, 16 Jun 2024 15:56:27 +0200 Subject: [PATCH] Fix `lce_ops_options_test.cc` --- larq_compute_engine/mlir/ir/lce_ops.h | 2 +- .../mlir/tests/lce_ops_options_test.cc | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/larq_compute_engine/mlir/ir/lce_ops.h b/larq_compute_engine/mlir/ir/lce_ops.h index 26656e1bf..0293e1810 100644 --- a/larq_compute_engine/mlir/ir/lce_ops.h +++ b/larq_compute_engine/mlir/ir/lce_ops.h @@ -1,9 +1,9 @@ #ifndef LARQ_COMPUTE_ENGINE_MLIR_IR_LCE_OPS_H_ #define LARQ_COMPUTE_ENGINE_MLIR_IR_LCE_OPS_H_ +#include "mlir/Bytecode/BytecodeOpInterface.h" #include "mlir/Dialect/Quant/QuantTypes.h" #include "mlir/Interfaces/SideEffectInterfaces.h" -#include "mlir/Bytecode/BytecodeOpInterface.h" // clang-format off #include "larq_compute_engine/mlir/ir/lce_dialect.h.inc" diff --git a/larq_compute_engine/mlir/tests/lce_ops_options_test.cc b/larq_compute_engine/mlir/tests/lce_ops_options_test.cc index 381435b1a..c4cd08538 100644 --- a/larq_compute_engine/mlir/tests/lce_ops_options_test.cc +++ b/larq_compute_engine/mlir/tests/lce_ops_options_test.cc @@ -16,9 +16,9 @@ IntegerAttr getIntegerAttr(Builder builder, int value) { TEST(LCEOpsSerializationTest, QuantizeTest) { MLIRContext context; context.getOrLoadDialect(); - auto* op = Operation::create( - UnknownLoc::get(&context), OperationName("lq.Quantize", &context), - llvm::None, llvm::None, llvm::None, llvm::None, 0); + OperationState state(UnknownLoc::get(&context), + OperationName("lq.Quantize", &context)); + mlir::Operation* op = Operation::create(state); ASSERT_EQ(cast(op).buildCustomOptions().size(), 0); } @@ -26,9 +26,9 @@ TEST(LCEOpsSerializationTest, QuantizeTest) { TEST(LCEOpsSerializationTest, DequantizeTest) { MLIRContext context; context.getOrLoadDialect(); - auto* op = Operation::create( - UnknownLoc::get(&context), OperationName("lq.Dequantize", &context), - llvm::None, llvm::None, llvm::None, llvm::None, 0); + OperationState state(UnknownLoc::get(&context), + OperationName("lq.Dequantize", &context)); + mlir::Operation* op = Operation::create(state); ASSERT_EQ(cast(op).buildCustomOptions().size(), 0); } @@ -37,9 +37,9 @@ TEST(LCEOpsSerializationTest, BConv2dTest) { MLIRContext context; context.getOrLoadDialect(); Builder builder(&context); - auto op = Operation::create(UnknownLoc::get(&context), - OperationName("lq.Bconv2d", &context), llvm::None, - llvm::None, llvm::None, llvm::None, 0); + OperationState state(UnknownLoc::get(&context), + OperationName("lq.Bconv2d", &context)); + mlir::Operation* op = Operation::create(state); op->setAttr("channels_in", getIntegerAttr(builder, 64)); op->setAttr("dilation_height_factor", getIntegerAttr(builder, 3)); @@ -69,9 +69,9 @@ TEST(LCEOpsSerializationTest, BMaxPool2dTest) { MLIRContext context; context.getOrLoadDialect(); Builder builder(&context); - auto op = Operation::create( - UnknownLoc::get(&context), OperationName("lq.BMaxPool2d", &context), - llvm::None, llvm::None, llvm::None, llvm::None, 0); + OperationState state(UnknownLoc::get(&context), + OperationName("lq.BMaxPool2d", &context)); + mlir::Operation* op = Operation::create(state); op->setAttr("padding", builder.getStringAttr("SAME")); op->setAttr("stride_width", getIntegerAttr(builder, 2));