Skip to content

Vectorize more TensorPrimitives conversions - #136777

Merged
stephentoub merged 1 commit into
mainfrom
stephentoub-tensor-conversion-simd
Nov 3, 2026
Merged

stephentoub merged 1 commit into
mainfrom
stephentoub-tensor-conversion-simd

Conversation

@stephentoub

@stephentoub stephentoub commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Reuse the existing vector conversion, widening, and saturating narrowing APIs in more TensorPrimitives conversions. Preserve custom-number fallbacks and fix in-place narrowing tail handling.

On .NET 10 x64/AVX2, converting 1,024 elements went from 1,978 to 73 ns for saturating float → int, 968 to 32 ns for saturating short → sbyte, and 470 to 70 ns for ushort → float. Some four-element cases cost a few extra nanoseconds.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics-tensors
See info in area-owners.md if you want to be subscribed.

@stephentoub
stephentoub merged commit 595eaac into main Nov 3, 2026
85 of 87 checks passed
@stephentoub
stephentoub deleted the stephentoub-tensor-conversion-simd branch November 3, 2026 17:32
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants