-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Vectorize TensorPrimitives shift and rotate operators #97361
Conversation
This adds a new IStatefulUnaryOperator interface, which differs from IUnaryOperator simply in that its Invoke members are instance rather than static. It then copies the existing InvokeSpanIntoSpan into a new helper that's then tweaked to accept an instance of an IStatefulUnaryOperator, calling its instance members instead of its static. That helper is then used to implement new ShiftLeftOperator, ShiftRightLogicalOperator, ShiftRightArithmeticOperator, RotateLeftOperator, and RotateRightOperator, which utilize methods on VectorXx to accelerate their implementation. It also adds ScaleBOperator, RootNOperator, and RoundOperator implementations used with the same helper, but these currently only have scalar implementations.
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsThis adds a new IStatefulUnaryOperator interface, which differs from IUnaryOperator simply in that its Invoke members are instance rather than static. It then copies the existing InvokeSpanIntoSpan into a new helper that's then tweaked to accept an instance of an IStatefulUnaryOperator, calling its instance members instead of its static. That helper is then used to implement new ShiftLeftOperator, ShiftRightLogicalOperator, ShiftRightArithmeticOperator, RotateLeftOperator, and RotateRightOperator, which utilize methods on VectorXx to accelerate their implementation. It also adds ScaleBOperator, RootNOperator, and RoundOperator implementations used with the same helper, but these currently only have scalar implementations. Contributes to #97193
|
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Outdated
Show resolved
Hide resolved
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Show resolved
Hide resolved
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Outdated
Show resolved
Hide resolved
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Outdated
Show resolved
Hide resolved
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Outdated
Show resolved
Hide resolved
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Outdated
Show resolved
Hide resolved
...ries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.netcore.cs
Outdated
Show resolved
Hide resolved
Thanks. Feedback addressed. |
This adds a new IStatefulUnaryOperator interface, which differs from IUnaryOperator simply in that its Invoke members are instance rather than static. It then copies the existing InvokeSpanIntoSpan into a new helper that's then tweaked to accept an instance of an IStatefulUnaryOperator, calling its instance members instead of its static.
That helper is then used to implement new ShiftLeftOperator, ShiftRightLogicalOperator, ShiftRightArithmeticOperator, RotateLeftOperator, and RotateRightOperator, which utilize methods on VectorXx to accelerate their implementation.
It also adds ScaleBOperator, RootNOperator, and RoundOperator implementations used with the same helper, but these currently only have scalar implementations.
Contributes to #97193