|
|
|
@ -16,10 +16,10 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests |
|
|
|
public class FeatureTestRunnerTests |
|
|
|
{ |
|
|
|
public static TheoryData<HwIntrinsics, string[]> Intrinsics => |
|
|
|
new TheoryData<HwIntrinsics, string[]> |
|
|
|
new() |
|
|
|
{ |
|
|
|
{ HwIntrinsics.DisableAES | HwIntrinsics.AllowAll, new string[] { "EnableAES", "AllowAll" } }, |
|
|
|
{ HwIntrinsics.DisableSIMD | HwIntrinsics.DisableHWIntrinsic, new string[] { "FeatureSIMD", "EnableHWIntrinsic" } }, |
|
|
|
{ HwIntrinsics.DisableHWIntrinsic, new string[] { "EnableHWIntrinsic" } }, |
|
|
|
{ HwIntrinsics.DisableSSE42 | HwIntrinsics.DisableAVX, new string[] { "EnableSSE42", "EnableAVX" } } |
|
|
|
}; |
|
|
|
|
|
|
|
@ -55,18 +55,6 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests |
|
|
|
HwIntrinsics.AllowAll); |
|
|
|
} |
|
|
|
|
|
|
|
#if !NET7_0_OR_GREATER
|
|
|
|
// COMPlus_EnableSIMD isn't thing anymore.
|
|
|
|
// https://github.com/dotnet/runtime/issues/66206
|
|
|
|
[Fact] |
|
|
|
public void CanLimitHwIntrinsicSIMDFeatures() |
|
|
|
{ |
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature( |
|
|
|
() => Assert.False(Vector.IsHardwareAccelerated), |
|
|
|
HwIntrinsics.DisableSIMD); |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SUPPORTS_RUNTIME_INTRINSICS
|
|
|
|
[Fact] |
|
|
|
public void CanLimitHwIntrinsicBaseFeatures() |
|
|
|
@ -105,13 +93,6 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests |
|
|
|
|
|
|
|
switch ((HwIntrinsics)Enum.Parse(typeof(HwIntrinsics), intrinsic)) |
|
|
|
{ |
|
|
|
#if !NET7_0_OR_GREATER
|
|
|
|
// COMPlus_EnableSIMD isn't thing anymore.
|
|
|
|
// https://github.com/dotnet/runtime/issues/66206
|
|
|
|
case HwIntrinsics.DisableSIMD: |
|
|
|
Assert.False(Vector.IsHardwareAccelerated); |
|
|
|
break; |
|
|
|
#endif
|
|
|
|
#if SUPPORTS_RUNTIME_INTRINSICS
|
|
|
|
case HwIntrinsics.DisableHWIntrinsic: |
|
|
|
Assert.False(Sse.IsSupported); |
|
|
|
@ -214,13 +195,6 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests |
|
|
|
|
|
|
|
switch ((HwIntrinsics)Enum.Parse(typeof(HwIntrinsics), intrinsic)) |
|
|
|
{ |
|
|
|
#if !NET7_0_OR_GREATER
|
|
|
|
// COMPlus_EnableSIMD isn't thing anymore.
|
|
|
|
// https://github.com/dotnet/runtime/issues/66206
|
|
|
|
case HwIntrinsics.DisableSIMD: |
|
|
|
Assert.False(Vector.IsHardwareAccelerated, nameof(Vector.IsHardwareAccelerated)); |
|
|
|
break; |
|
|
|
#endif
|
|
|
|
#if SUPPORTS_RUNTIME_INTRINSICS
|
|
|
|
case HwIntrinsics.DisableHWIntrinsic: |
|
|
|
Assert.False(Sse.IsSupported); |
|
|
|
|