Fix 1738438 chunseok/1737438
authorChunseok Lee <chunseok.lee@samsung.com>
Thu, 7 Mar 2024 07:55:55 +0000 (16:55 +0900)
committerChunseok Lee <chunseok.lee@samsung.com>
Fri, 8 Mar 2024 01:41:14 +0000 (10:41 +0900)
compute/cker/include/cker/operation/Helper/MatmulBCast.h
runtime/libs/benchmark/src/Result.cpp
runtime/onert/core/src/dumper/dot/OperandNode.cc

index b80ccc0..b7d6394 100644 (file)
@@ -62,13 +62,13 @@ public:
     if (!_batch_bcast->IsValid())
       return;
 
-    auto x_reshaped = _batch_bcast->x_reshape();
-    auto y_reshaped = _batch_bcast->y_reshape();
+    const auto &x_reshaped = _batch_bcast->x_reshape();
+    const auto &y_reshaped = _batch_bcast->y_reshape();
     auto output_shape = _batch_bcast->output_shape();
 
     _x_batch_size = std::accumulate(x_reshaped.cbegin(), x_reshaped.cend(), INT32_C(1),
                                     std::multiplies<int32_t>());
-    _y_batch_size = std::accumulate(x_reshaped.cbegin(), x_reshaped.cend(), INT32_C(1),
+    _y_batch_size = std::accumulate(y_reshaped.cbegin(), y_reshaped.cend(), INT32_C(1),
                                     std::multiplies<int32_t>());
     _output_shape.ReplaceWith(output_shape.size(), output_shape.data());
     _output_batch_size = _output_shape.FlatSize();
index 04925f4..8c1e2d2 100644 (file)
@@ -157,16 +157,16 @@ namespace benchmark
 
 Result::Result(const Phases &phases)
 {
-  const auto option = phases.option();
+  const auto &option = phases.option();
   {
     for (int i = PhaseEnum::MODEL_LOAD; i <= PhaseEnum::PREPARE; ++i)
     {
-      auto phase = phases.at(gPhaseStrings[i]);
+      const auto &phase = phases.at(gPhaseStrings[i]);
       time[i][FigureType::MEAN] = averageTimeMs(phase);
     }
 
     int i = PhaseEnum::EXECUTE;
-    auto exec_phase = phases.at(gPhaseStrings[i]);
+    const auto &exec_phase = phases.at(gPhaseStrings[i]);
     time[i][FigureType::MEAN] = averageTimeMs(exec_phase);
     time[i][FigureType::MAX] = maxTimeMs(exec_phase);
     time[i][FigureType::MIN] = minTimeMs(exec_phase);
index 88f5254..49319d5 100644 (file)
@@ -35,7 +35,7 @@ Operand::Operand(const ir::OperandIndex &index, Type type)
   : Node{"operand" + std::to_string(index.value())}
 {
   {
-    auto type_to_shape = [](Type type) {
+    auto type_to_shape = [](Type type) -> const auto & {
       switch (type)
       {
         case Type::MODEL_INPUT: