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
Expose IsSupported
properties on the vector types
#69036
Comments
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics Issue DetailsSummaryThere are currently several scenarios where we may be dealing with a generic type and want to vectorize it if vectorization support exists. However, those checks are currently sometimes hard to do, may not cover future changes to what One such example of this is in #68183 where we currently have to limit the vectorization paths after checking for specific cases of Users would be expected to check both API Proposalnamespace System.Numerics
{
public partial struct Vector<T>
{
public static bool IsSupported { get; }
}
}
namespace System.Runtime.Intrinsics
{
public partial struct Vector64<T>
{
public static bool IsSupported { get; }
}
public partial struct Vector128<T>
{
public static bool IsSupported { get; }
}
public partial struct Vector256<T>
{
public static bool IsSupported { get; }
}
}
|
CC. @stephentoub |
namespace System.Numerics;
public partial struct Vector<T>
{
public static bool IsSupported { get; }
} namespace System.Runtime.Intrinsics;
public partial struct Vector64<T>
{
public static bool IsSupported { get; }
}
public partial struct Vector128<T>
{
public static bool IsSupported { get; }
}
public partial struct Vector256<T>
{
public static bool IsSupported { get; }
} |
Summary
There are currently several scenarios where we may be dealing with a generic type and want to vectorize it if vectorization support exists. However, those checks are currently sometimes hard to do, may not cover future changes to what
T
is supported, and may not be constant folded by the JIT.One such example of this is in #68183 where we currently have to limit the vectorization paths after checking for specific cases of
T
.Users would be expected to check both
Vector128<T>.IsSupported && Vector128.IsHardwareAccelerated
to determine if the usage ofT
is expected to be performant.API Proposal
The text was updated successfully, but these errors were encountered: