-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Vector<T> should have a ctor that accepts ReadOnlySpan<T> #26763
Comments
I updated the proposal with |
Perhaps we should add above APIs to HWIntrinsics |
Where can I see the Vector(Span) constructor? The one available in System.Numerics.Vectors 4.1.4.0 does have only the T[]-based constructors :( |
THIS NEADS TO HAPPEN! |
@GrabYourPitchforks also suggested these APIs: public struct Vector<T> {
/* new ctor overload proposal */
public Vector(ReadOnlySpan<byte> values);
/* new instance method proposals */
public void CopyTo(Span<byte> destination);
public bool TryCopyTo(Span<byte> destination);
} This would avoid consumers having to re-interpret case the spans. We don't know what happens when the |
I also checked out the |
Currently the vector type has the following span-based ctor overload.
We should add a readonly span-based ctor overload so that vectors can be read from immutable data buffers, such as a
ReadOnlySpan<char>
backed by aString
. This will make it easier to vectorize text processing APIs without falling back to the dangerousUnsafe
orMemoryMarshal
classes.The text was updated successfully, but these errors were encountered: