diff --git a/Directory.Packages.props b/Directory.Packages.props
index 20962c6c74..514e430eaa 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -74,6 +74,7 @@
+
diff --git a/Robust.Benchmarks/NumericsHelpers/AddBenchmark.cs b/Robust.Benchmarks/NumericsHelpers/AddBenchmark.cs
index 100ad64942..6be5f3de6a 100644
--- a/Robust.Benchmarks/NumericsHelpers/AddBenchmark.cs
+++ b/Robust.Benchmarks/NumericsHelpers/AddBenchmark.cs
@@ -1,17 +1,19 @@
-using BenchmarkDotNet.Attributes;
+using System.Numerics.Tensors;
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
using Robust.Shared.Analyzers;
namespace Robust.Benchmarks.NumericsHelpers;
[Virtual]
+[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByMethod)]
+[MemoryDiagnoser]
+[DisassemblyDiagnoser]
public class AddBenchmark
{
- [Params(32, 128)]
+ [Params(32, 128, 256, 512, 1024, 2048, 4096, 8192, 16384)]
public int N { get; set; }
- [Params(1,2)]
- public int T { get; set; }
-
private float[] _inputA = default!;
private float[] _inputB = default!;
private float[] _output = default!;
@@ -25,8 +27,14 @@ public class AddBenchmark
}
[Benchmark]
- public void Bench()
+ public void BenchNumericsHelpers()
{
Shared.Maths.NumericsHelpers.Add(_inputA, _inputB, _output);
}
+
+ [Benchmark]
+ public void BenchTensor()
+ {
+ TensorPrimitives.Add(_inputA, _inputB, _output);
+ }
}
diff --git a/Robust.Benchmarks/Robust.Benchmarks.csproj b/Robust.Benchmarks/Robust.Benchmarks.csproj
index 7e114649cc..f47c475bc9 100644
--- a/Robust.Benchmarks/Robust.Benchmarks.csproj
+++ b/Robust.Benchmarks/Robust.Benchmarks.csproj
@@ -22,6 +22,8 @@
+
+
diff --git a/Robust.Shared/ContentPack/Sandbox.yml b/Robust.Shared/ContentPack/Sandbox.yml
index ed1982870b..04088b22f6 100644
--- a/Robust.Shared/ContentPack/Sandbox.yml
+++ b/Robust.Shared/ContentPack/Sandbox.yml
@@ -687,6 +687,8 @@ Types:
IUnaryNegationOperators`2: { All: True }
IUnaryPlusOperators`2: { All: True }
IUnsignedNumber`1: { All: True }
+ System.Numerics.Tensors:
+ TensorPrimitives: { All: True }
System.Reflection:
Assembly:
Methods:
diff --git a/Robust.Shared/Robust.Shared.csproj b/Robust.Shared/Robust.Shared.csproj
index 424cc81c66..cdd7bf9746 100644
--- a/Robust.Shared/Robust.Shared.csproj
+++ b/Robust.Shared/Robust.Shared.csproj
@@ -13,6 +13,7 @@
+