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

Simd #13262

Merged
merged 9 commits into from
Apr 28, 2020
Merged

Simd #13262

merged 9 commits into from
Apr 28, 2020

Conversation

FIVIL
Copy link
Contributor

@FIVIL FIVIL commented Jul 6, 2019

This PR contains a simple tutorial and examples for SIMD-enabled types in .NET.
fixes #12660

/cc @rpetrusha

@mairaw mairaw added this to the July 2019 milestone Jul 24, 2019
@mairaw mairaw requested a review from rpetrusha July 24, 2019 06:58
@BillWagner BillWagner added the ✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository label Sep 16, 2019
@mairaw
Copy link
Contributor

mairaw commented Sep 16, 2019

Also tagging @tannergooding and @ViktorHofer for a technical review.

@BillWagner BillWagner added doc-idea Indicates issues that are suggestions for new topics [org][type][category] and removed new-content labels Nov 19, 2019
@BillWagner BillWagner modified the milestones: July 2019, January 2020 Jan 2, 2020
docs/standard/simd.md Outdated Show resolved Hide resolved
docs/standard/simd.md Outdated Show resolved Hide resolved
docs/standard/simd.md Outdated Show resolved Hide resolved

## How to use SIMD?

Before executing custom SIMD algorithms, it is possible to check if the host machine supports SIMD using <xref:System.Numerics.Vector.IsHardwareAccelerated?displayProperty=nameWithType>, which returns a <xref:System.Boolean>.
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be explained that IsHardwareAccelerated returning true only indicates that some functionality may be hardware accelerated. It doesn't provide any guarantees of what functions are accelerated (you may even end up in a scenario where one function is accelerated but another function is not).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes sense, I will make some changes.
@tannergooding Tnx for your suggestions, I will make some changes based on your review

@tdykstra
Copy link
Contributor

@FIVIL Do you still plan to address the feedback on this PR?

@FIVIL
Copy link
Contributor Author

FIVIL commented Feb 20, 2020

@tdykstra Sure, I am currently testing new Intrinsics API in .Net Core 3+. And as soon as I grasp a deep understanding of all the new APIS I will complete this tutorial and address the issues mentioned in the feedback

@BillWagner BillWagner modified the milestones: January 2020, March 2020 Mar 3, 2020
@Thraka Thraka reopened this Mar 31, 2020
- Updated the date
- Changed terms from **SIMD-enabled** to **SIMD-accelerated**
- Fixed any spelling errors
- Fixed code spacing
- Adjusted markdown structure
- Brought acro score from 77 to 92
@Thraka Thraka requested a review from gewarren as a code owner March 31, 2020 16:51
@Thraka
Copy link
Contributor

Thraka commented Mar 31, 2020

@tannergooding @FIVIL

Please re-review. I've updated the submission with the following changes:

  • Updated the date
  • Changed terms from SIMD-enabled to SIMD-accelerated
  • Fixed any spelling errors
  • Fixed code spacing
  • Adjusted markdown structure
  • Brought acro score from 77 to 92 with minor grammar changes

@Thraka Thraka requested review from tannergooding and removed request for rpetrusha March 31, 2020 16:52
@BillWagner BillWagner modified the milestones: March 2020, April 2020 Mar 31, 2020

## Remarks

SIMD is more likely to remove one bottleneck and expose the next, for example memory throughput. In general the performance benefit of using SIMD varies depending on the specific scenario, and in some cases it can even perform worse than simpler non-SIMD equivalent code.
Copy link
Member

Choose a reason for hiding this comment

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

End with a note that users should benchmark and profile their code to identify hot spots and ensure that changes are meeting their performance goals/needs?

Can we link to https://github.com/dotnet/BenchmarkDotNet?

@tannergooding
Copy link
Member

Overall this looks really good, thanks for investing the time into this. I just had a couple minor questions/feedback items 😄

@Thraka Thraka assigned Thraka and FIVIL and unassigned FIVIL Apr 14, 2020
@Thraka
Copy link
Contributor

Thraka commented Apr 14, 2020

@tannergooding

I tried working on rewording it but I feel like I'll misrepresent the details. Can you submit a suggestion where you want changes? This way you can reword them easily without having to fork and submit a huge update Just click the icon shown below when making a comment on a specific line

image

@Thraka
Copy link
Contributor

Thraka commented Apr 28, 2020

@tannergooding Ping on my last comment :)


## How to use SIMD?

Before executing custom SIMD algorithms, it is possible to check if the host machine supports SIMD using <xref:System.Numerics.Vector.IsHardwareAccelerated?displayProperty=nameWithType>, which returns a <xref:System.Boolean>.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Before executing custom SIMD algorithms, it is possible to check if the host machine supports SIMD using <xref:System.Numerics.Vector.IsHardwareAccelerated?displayProperty=nameWithType>, which returns a <xref:System.Boolean>.
Before executing custom SIMD algorithms, it is possible to check if the host machine supports SIMD using <xref:System.Numerics.Vector.IsHardwareAccelerated?displayProperty=nameWithType>, which returns a <xref:System.Boolean>. However, this does not indicate all members are accelerated just that some members may be. Which members are accelerated are hardware dependent.

Thraka and others added 3 commits April 28, 2020 12:31
Co-Authored-By: Tanner Gooding <[email protected]>
Co-Authored-By: Tanner Gooding <[email protected]>
Copy link
Contributor

@Thraka Thraka left a comment

Choose a reason for hiding this comment

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

Something is going on with github. I can't accept suggestions and I see old versions when trying to review. I did a lot of rewrite work about a month ago and maybe that is causing problems? I think it's good to go though.

@Thraka Thraka merged commit ad57962 into dotnet:master Apr 28, 2020
@Thraka Thraka unassigned Thraka and FIVIL May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-idea Indicates issues that are suggestions for new topics [org][type][category] ✨ 1st-time docs contributor! Indicates PRs from new contributors to the docs repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIMD docs
7 participants