diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/TensorPrimitives.netcore.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/TensorPrimitives.netcore.cs index 0eaa0681036eb1..085419207b6c08 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/TensorPrimitives.netcore.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/TensorPrimitives.netcore.cs @@ -1099,12 +1099,6 @@ private static Vector512 FusedMultiplyAdd(Vector512 x, Vector512 Invoke(Vector512 x, Vector512 y) => x - y; #endif - - public static float Invoke(Vector128 x) => throw new NotSupportedException(); - public static float Invoke(Vector256 x) => throw new NotSupportedException(); -#if NET8_0_OR_GREATER - public static float Invoke(Vector512 x) => throw new NotSupportedException(); -#endif } private readonly struct SubtractSquaredOperator : IBinaryOperator @@ -1134,12 +1128,6 @@ public static Vector512 Invoke(Vector512 x, Vector512 y) return tmp * tmp; } #endif - - public static float Invoke(Vector128 x) => throw new NotSupportedException(); - public static float Invoke(Vector256 x) => throw new NotSupportedException(); -#if NET8_0_OR_GREATER - public static float Invoke(Vector512 x) => throw new NotSupportedException(); -#endif } private readonly struct MultiplyOperator : IBinaryOperator @@ -1195,12 +1183,6 @@ public static float Invoke(Vector512 x) #if NET8_0_OR_GREATER public static Vector512 Invoke(Vector512 x, Vector512 y) => x / y; #endif - - public static float Invoke(Vector128 x) => throw new NotSupportedException(); - public static float Invoke(Vector256 x) => throw new NotSupportedException(); -#if NET8_0_OR_GREATER - public static float Invoke(Vector512 x) => throw new NotSupportedException(); -#endif } private readonly struct NegateOperator : IUnaryOperator @@ -1294,14 +1276,18 @@ private interface IUnaryOperator private interface IBinaryOperator { static abstract float Invoke(float x, float y); - static abstract Vector128 Invoke(Vector128 x, Vector128 y); - static abstract float Invoke(Vector128 x); static abstract Vector256 Invoke(Vector256 x, Vector256 y); - static abstract float Invoke(Vector256 x); #if NET8_0_OR_GREATER static abstract Vector512 Invoke(Vector512 x, Vector512 y); - static abstract float Invoke(Vector512 x); +#endif + + // Operations for aggregating all lanes in a vector into a single value. + // These are not supported on most implementations. + static virtual float Invoke(Vector128 x) => throw new NotSupportedException(); + static virtual float Invoke(Vector256 x) => throw new NotSupportedException(); +#if NET8_0_OR_GREATER + static virtual float Invoke(Vector512 x) => throw new NotSupportedException(); #endif }