Fix TensorPrimitives.MultiplyAddEstimate for integers by stephentoub · Pull Request #113047 · dotnet/runtime · GitHub
Skip to content

Fix TensorPrimitives.MultiplyAddEstimate for integers#113047

Merged
stephentoub merged 3 commits into
dotnet:mainfrom
stephentoub:fixmae
Mar 3, 2025
Merged

Fix TensorPrimitives.MultiplyAddEstimate for integers#113047
stephentoub merged 3 commits into
dotnet:mainfrom
stephentoub:fixmae

Conversation

@stephentoub

Copy link
Copy Markdown
Member

Fixes #112989
Introduced in #102181

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Overview

This PR fixes the MultiplyAddEstimate implementation for integer types by updating both the test cases and the low‐level implementation details.

  • Updated tests to use T.MultiplyAddEstimate instead of T.FusedMultiplyAdd.
  • Added a new suite of tests for Span, Span, Span destination scenarios.
  • Adjusted type checks in the MultiplyAddEstimate implementation to better differentiate float handling.

Reviewed Changes

File Description
src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs Updates tests to correctly use MultiplyAddEstimate and adds additional span destination tests
src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.MultiplyAddEstimate.cs Refines type-check conditions for vectorized operations

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

Comment thread src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs Outdated
@stephentoub stephentoub merged commit 12e0ad6 into dotnet:main Mar 3, 2025
@stephentoub stephentoub deleted the fixmae branch March 3, 2025 21:00
@stephentoub

Copy link
Copy Markdown
Member Author

/backport to release/9.0-staging

@dotnet dotnet deleted a comment from github-actions Bot Mar 3, 2025
@github-actions

github-actions Bot commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TensorPrimitives asymmetry between MultiplyAdd and MultiplyAddEstimate with trivial inputs

3 participants