Skip to content

[TosaToTensor] Fix a warning #86703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

kazutakahirata
Copy link
Contributor

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]

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]
@llvmbot llvmbot added the mlir label Mar 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Mar 26, 2024

@llvm/pr-subscribers-mlir

Author: Kazu Hirata (kazutakahirata)

Changes

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]


Full diff: https://github.com/llvm/llvm-project/pull/86703.diff

1 Files Affected:

  • (modified) mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp (+1-1)
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)

Copy link
Contributor

@rafaelubalmw rafaelubalmw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the issue right after merging, but didn't have time to address it. Thank you for taking care of this.

@kazutakahirata kazutakahirata merged commit 1eaef44 into llvm:main Mar 26, 2024
@kazutakahirata kazutakahirata deleted the pr_warning_TosaToTensor branch March 26, 2024 17:33
@kazutakahirata
Copy link
Contributor Author

kazutakahirata commented Mar 26, 2024

I noticed the issue right after merging, but didn't have time to address it. Thank you for taking care of this.

Thank you for quickly reviewing the patch!

bjacob added a commit to iree-org/llvm-project that referenced this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants