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

Open
wants to merge 5 commits into
base: master
from
Open

Simd #13262

wants to merge 5 commits into from

Conversation

@FIVIL
Copy link

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 the new-content label Jul 24, 2019
@mairaw mairaw added this to the July 2019 milestone Jul 24, 2019
@mairaw mairaw requested a review from rpetrusha Jul 24, 2019
@mairaw

This comment has been minimized.

Copy link
Contributor

mairaw commented Sep 16, 2019

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


# Overview

SIMD (Single instruction, multiple data) provides the functionality to do multiple processes on a single core to achieve peak performance. In .NET there is set of SIMD-enabled types under <xref:System.Numerics> namespace. SIMD operations can be parallelized at the hardware level. That increases the throughput of the vectorized computations, which are common in mathematical, scientific, and graphics apps.

This comment has been minimized.

Copy link
@tannergooding

tannergooding Jan 6, 2020

Member

This first sentence could be reworded.

Maybe something like:

SIMD (Single instruction, multiple data) provides hardware support for performing an operation on multiple pieces of data, in parallel, using a single instruction.


# Overview

SIMD (Single instruction, multiple data) provides the functionality to do multiple processes on a single core to achieve peak performance. In .NET there is set of SIMD-enabled types under <xref:System.Numerics> namespace. SIMD operations can be parallelized at the hardware level. That increases the throughput of the vectorized computations, which are common in mathematical, scientific, and graphics apps.

This comment has been minimized.

Copy link
@tannergooding

tannergooding Jan 6, 2020

Member

It is probably worthwhile to callout both the System.Numerics types and the System.Runtime.Intrinsics namespaces.
The former provides SIMD accelerated functions (in Vector2/3/4 and other types) and more direct SIMD access (Vector<T>) which may have a software fallback on some platforms (such as arm32).

The latter provides direct hardware access and no software fallback; so support must be explicitly queried and fallbacks need to be provided by the developer.

This comment has been minimized.

Copy link
@FIVIL

FIVIL Jan 7, 2020

Author

Actually, I have just started to work with new System.Runtime.Intrinsic in .net core 3 and I will complete these documents based on this blog post of yours, very soon


## .NET SIMD-enabled types

The .NET SIMD-enabled types include the following:

This comment has been minimized.

Copy link
@tannergooding

tannergooding Jan 6, 2020

Member

I'm not sure saying they are SIMD-enabled is correct. Its that certain exposed APIs on the types may be SIMD accelerated.

## 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>.

This comment has been minimized.

Copy link
@tannergooding

tannergooding Jan 6, 2020

Member

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).

This comment has been minimized.

Copy link
@FIVIL

FIVIL Jan 7, 2020

Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.