Skip to content

Commit

Permalink
Standardize to NotSupportedException in TensorPrimitives operators (d…
Browse files Browse the repository at this point in the history
…otnet#98162)

Most of them use NotSupportedException on code paths that shouldn't be used, but a few were using NotImplementedException. Just for consistency, standardize on the former.
  • Loading branch information
stephentoub authored Feb 8, 2024
1 parent 0976796 commit 7a3223a
Showing 1 changed file with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18368,9 +18368,9 @@ internal readonly struct RoundFallbackOperator<T>(int digits, MidpointRounding m
public static bool Vectorizable => false; // TODO: vectorize for float

public static int Invoke(T x) => T.ILogB(x);
public static Vector128<int> Invoke(Vector128<T> x) => throw new NotImplementedException();
public static Vector256<int> Invoke(Vector256<T> x) => throw new NotImplementedException();
public static Vector512<int> Invoke(Vector512<T> x) => throw new NotImplementedException();
public static Vector128<int> Invoke(Vector128<T> x) => throw new NotSupportedException();
public static Vector256<int> Invoke(Vector256<T> x) => throw new NotSupportedException();
public static Vector512<int> Invoke(Vector512<T> x) => throw new NotSupportedException();
}

/// <summary>double.ILogB(x)</summary>
Expand All @@ -18379,9 +18379,9 @@ internal readonly struct RoundFallbackOperator<T>(int digits, MidpointRounding m
public static bool Vectorizable => false; // TODO: vectorize

public static int Invoke(double x) => double.ILogB(x);
public static Vector128<int> Invoke(Vector128<double> lower, Vector128<double> upper) => throw new NotImplementedException();
public static Vector256<int> Invoke(Vector256<double> lower, Vector256<double> upper) => throw new NotImplementedException();
public static Vector512<int> Invoke(Vector512<double> lower, Vector512<double> upper) => throw new NotImplementedException();
public static Vector128<int> Invoke(Vector128<double> lower, Vector128<double> upper) => throw new NotSupportedException();
public static Vector256<int> Invoke(Vector256<double> lower, Vector256<double> upper) => throw new NotSupportedException();
public static Vector512<int> Invoke(Vector512<double> lower, Vector512<double> upper) => throw new NotSupportedException();
}

/// <summary>T.CreateChecked(x)</summary>
Expand All @@ -18390,9 +18390,9 @@ internal readonly struct RoundFallbackOperator<T>(int digits, MidpointRounding m
public static bool Vectorizable => false;

public static TTo Invoke(TFrom x) => TTo.CreateChecked(x);
public static Vector128<TTo> Invoke(Vector128<TFrom> x) => throw new NotImplementedException();
public static Vector256<TTo> Invoke(Vector256<TFrom> x) => throw new NotImplementedException();
public static Vector512<TTo> Invoke(Vector512<TFrom> x) => throw new NotImplementedException();
public static Vector128<TTo> Invoke(Vector128<TFrom> x) => throw new NotSupportedException();
public static Vector256<TTo> Invoke(Vector256<TFrom> x) => throw new NotSupportedException();
public static Vector512<TTo> Invoke(Vector512<TFrom> x) => throw new NotSupportedException();
}

/// <summary>T.CreateSaturating(x)</summary>
Expand All @@ -18401,9 +18401,9 @@ internal readonly struct RoundFallbackOperator<T>(int digits, MidpointRounding m
public static bool Vectorizable => false;

public static TTo Invoke(TFrom x) => TTo.CreateSaturating(x);
public static Vector128<TTo> Invoke(Vector128<TFrom> x) => throw new NotImplementedException();
public static Vector256<TTo> Invoke(Vector256<TFrom> x) => throw new NotImplementedException();
public static Vector512<TTo> Invoke(Vector512<TFrom> x) => throw new NotImplementedException();
public static Vector128<TTo> Invoke(Vector128<TFrom> x) => throw new NotSupportedException();
public static Vector256<TTo> Invoke(Vector256<TFrom> x) => throw new NotSupportedException();
public static Vector512<TTo> Invoke(Vector512<TFrom> x) => throw new NotSupportedException();
}

/// <summary>T.CreateTruncating(x)</summary>
Expand All @@ -18412,9 +18412,9 @@ internal readonly struct RoundFallbackOperator<T>(int digits, MidpointRounding m
public static bool Vectorizable => false;

public static TTo Invoke(TFrom x) => TTo.CreateTruncating(x);
public static Vector128<TTo> Invoke(Vector128<TFrom> x) => throw new NotImplementedException();
public static Vector256<TTo> Invoke(Vector256<TFrom> x) => throw new NotImplementedException();
public static Vector512<TTo> Invoke(Vector512<TFrom> x) => throw new NotImplementedException();
public static Vector128<TTo> Invoke(Vector128<TFrom> x) => throw new NotSupportedException();
public static Vector256<TTo> Invoke(Vector256<TFrom> x) => throw new NotSupportedException();
public static Vector512<TTo> Invoke(Vector512<TFrom> x) => throw new NotSupportedException();
}

/// <summary>(uint)float</summary>
Expand Down Expand Up @@ -19058,9 +19058,9 @@ static Vector512<uint> SingleToHalfAsWidenedUInt32(Vector512<float> value)
public static bool Vectorizable => false; // TODO: vectorize

public static (T, T) Invoke(T x) => T.SinCos(x);
public static (Vector128<T> First, Vector128<T> Second) Invoke(Vector128<T> x) => throw new NotImplementedException();
public static (Vector256<T> First, Vector256<T> Second) Invoke(Vector256<T> x) => throw new NotImplementedException();
public static (Vector512<T> First, Vector512<T> Second) Invoke(Vector512<T> x) => throw new NotImplementedException();
public static (Vector128<T> First, Vector128<T> Second) Invoke(Vector128<T> x) => throw new NotSupportedException();
public static (Vector256<T> First, Vector256<T> Second) Invoke(Vector256<T> x) => throw new NotSupportedException();
public static (Vector512<T> First, Vector512<T> Second) Invoke(Vector512<T> x) => throw new NotSupportedException();
}

/// <summary>T.SinCosPi(x)</summary>
Expand All @@ -19069,9 +19069,9 @@ static Vector512<uint> SingleToHalfAsWidenedUInt32(Vector512<float> value)
public static bool Vectorizable => false; // TODO: vectorize

public static (T, T) Invoke(T x) => T.SinCosPi(x);
public static (Vector128<T> First, Vector128<T> Second) Invoke(Vector128<T> x) => throw new NotImplementedException();
public static (Vector256<T> First, Vector256<T> Second) Invoke(Vector256<T> x) => throw new NotImplementedException();
public static (Vector512<T> First, Vector512<T> Second) Invoke(Vector512<T> x) => throw new NotImplementedException();
public static (Vector128<T> First, Vector128<T> Second) Invoke(Vector128<T> x) => throw new NotSupportedException();
public static (Vector256<T> First, Vector256<T> Second) Invoke(Vector256<T> x) => throw new NotSupportedException();
public static (Vector512<T> First, Vector512<T> Second) Invoke(Vector512<T> x) => throw new NotSupportedException();
}

/// <summary>Operator that takes one input value and returns a single value.</summary>
Expand Down

0 comments on commit 7a3223a

Please sign in to comment.