Skip to content
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

Vector512 Support for Enumerable<int>.Min/Max #93369

Merged
merged 9 commits into from
Oct 16, 2023

Conversation

Spacefish
Copy link
Contributor

@Spacefish Spacefish commented Oct 11, 2023

Use the new Vector512 type introduced in NET 8, when

  • enough elements
  • hardware support is present

to calculate Enumerable.Min() and Enumerable.Max()

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 11, 2023
@ghost
Copy link

ghost commented Oct 11, 2023

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

Issue Details

Use the new Vector512 type introduced in NET 8, when

  • enought elements
  • hardware support is present
  • we are executing in .NET 8

to calculate Enumerable.Min() and Enumerable.Max()

Author: Spacefish
Assignees: -
Labels:

area-System.Linq, community-contribution

Milestone: -

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

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

@Spacefish
Copy link
Contributor Author

Spacefish commented Oct 14, 2023

@eiriktsarpalis i increased them to 65, so we are at least 1 element wider even for byte than the Vector512.

This lead to problems with the sybte type, as the test internally does source.Max(x => x + T.One) which leads to an overflow in sbyte and adds a "-128" element.
The .Max function behaves correctly and return the element "1272 as the max element but the Test Assertion compares it to the now wrongly overflown expected value of "-128".

I therefore added some code to not generate any testdata for the sybte type which is larger than 126 (length < sybte.MaxValue).

@eiriktsarpalis eiriktsarpalis merged commit cccdc1d into dotnet:main Oct 16, 2023
109 checks passed
@BruceForstall BruceForstall added the avx512 Related to the AVX-512 architecture label Oct 16, 2023
@BruceForstall
Copy link
Member

cc @dotnet/avx512-contrib

@ghost ghost locked as resolved and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Linq avx512 Related to the AVX-512 architecture community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants