Exemplo n.º 1
0
    public void BlinqSelect_int(
        [ValueSource(typeof(SelectValues), nameof(SelectValues.Values))] int[] sourceArr
        )
    {
        var src = new NativeArray <int>(sourceArr, Allocator.Persistent);

        MakeMeasurement("Blinq_int", () => Blinq.RunAverage(src, IntTo_int)).Run();
        src.Dispose();
    }
Exemplo n.º 2
0
    public void Blinq_double(
        [ValueSource(typeof(Values_double), nameof(Values_double.Values))] double[] sourceArr
        )
    {
        var src = new NativeArray <double>(sourceArr, Allocator.Persistent);

        MakeMeasurement("Blinq_double", () => Blinq.RunAverage(src)).Run();
        src.Dispose();
    }
Exemplo n.º 3
0
    public void Blinq_float(
        [ValueSource(typeof(Values_float), nameof(Values_float.Values))] float[] sourceArr
        )
    {
        var src = new NativeArray <float>(sourceArr, Allocator.Persistent);

        MakeMeasurement("Blinq_float", () => Blinq.RunAverage(src)).Run();
        src.Dispose();
    }
Exemplo n.º 4
0
 public void BlinqShouldEqualLinqNativeArrayRunAverageSelector_int(
     [ValueSource(typeof(Values_int), nameof(Values_int.Values))] int[] sourceArr
     )
 {
     using (var srcNativeArray = new NativeArray <int>(sourceArr, Allocator.Persistent))
     {
         var expected = ExceptionAndValue(() => Linq.Average(srcNativeArray, SelectSelf <int>().Invoke));
         if (expected.Item1 != null)
         {
             return; // Exceptions are not supported in Burst
         }
         var actual = ExceptionAndValue(() => Blinq.RunAverage(srcNativeArray, SelectSelf <int>()));
         AssertAreEqual(expected, actual);
     }
 }
Exemplo n.º 5
0
 public void BlinqShouldEqualLinqNativeArrayRunAverage_double(
     [ValueSource(typeof(Values_double), nameof(Values_double.Values))] double[] sourceArr
     )
 {
     using (var srcNativeArray = new NativeArray <double>(sourceArr, Allocator.Persistent))
     {
         var expected = ExceptionAndValue(() => Linq.Average(srcNativeArray));
         if (expected.Item1 != null)
         {
             return; // Exceptions are not supported in Burst
         }
         var actual = ExceptionAndValue(() => Blinq.RunAverage(srcNativeArray));
         AssertAreEqual(expected, actual);
     }
 }