[Mlir-commits] [mlir] [TosaToTensor] Fix a warning (PR #86703)

Kazu Hirata llvmlistbot at llvm.org
Tue Mar 26 10:26:12 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/86703

This patch fixes:

  mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp:76:46: error:
  'multiplies' may not intend to support class template argument
  deduction [-Werror,-Wctad-maybe-unsupported]


>From 3480e5e573ec53b82de1db5cea8c59f7efff7657 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 26 Mar 2024 09:22:59 -0700
Subject: [PATCH] [TosaToTensor] Fix a warning

This patch fixes:

  mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp:76:46: error:
  'multiplies' may not intend to support class template argument
  deduction [-Werror,-Wctad-maybe-unsupported]
---
 mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
index 11ba98ddf352b4..cd6da355824691 100644
--- a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
+++ b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
@@ -73,7 +73,7 @@ TensorType inferReshapeExpandedType(TensorType inputType,
     // Calculate the product of all elements in 'newShape' except for the -1
     // placeholder, which we discard by negating the result.
     int64_t totalSizeNoPlaceholder = -std::accumulate(
-        newShape.begin(), newShape.end(), 1, std::multiplies());
+        newShape.begin(), newShape.end(), 1, std::multiplies<int64_t>());
 
     // If there is a 0 component in 'newShape', resolve the placeholder as 0.
     if (totalSizeNoPlaceholder == 0)



More information about the Mlir-commits mailing list