Skip to content

Commit 1810dfd

Browse files
committed
Workaround an issue where the TensorPrimitives net8 tests are not running on net8
1 parent 61a327b commit 1810dfd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/libraries/System.Numerics.Tensors/tests/Net8Tests/System.Numerics.Tensors.Net8.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PropertyGroup>
1111
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
1212
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
13+
<DefineConstants>$(DefineConstants);SNT_NET8_TESTS</DefineConstants>
1314
</PropertyGroup>
1415

1516
<ItemGroup>

src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,12 @@ public static IEnumerable<object[]> SpanDestinationFunctionsToTest()
386386
yield return Create(TensorPrimitives.Reciprocal, f => T.One / f);
387387
yield return Create(TensorPrimitives.ReciprocalEstimate, T.ReciprocalEstimate, T.CreateTruncating(Helpers.DefaultToleranceForEstimates));
388388
yield return Create(TensorPrimitives.ReciprocalSqrt, f => T.One / T.Sqrt(f));
389+
390+
#if !SNT_NET8_TESTS
391+
// Avoid running with the net8 tests due to: https://github.com/dotnet/runtime/issues/101846
389392
yield return Create(TensorPrimitives.ReciprocalSqrtEstimate, T.ReciprocalSqrtEstimate, T.CreateTruncating(Helpers.DefaultToleranceForEstimates));
393+
#endif
394+
390395
yield return Create(TensorPrimitives.Round, T.Round);
391396
yield return Create(TensorPrimitives.Sin, T.Sin, trigTolerance);
392397
yield return Create(TensorPrimitives.Sinh, T.Sinh, Helpers.DetermineTolerance<T>(doubleTolerance: 1e-14));

0 commit comments

Comments
 (0)