Exemplo n.º 1
0
        public void MaxAbsUTest(int test, float expected)
        {
            float[] src    = (float[])testArrays[test].Clone();
            var     actual = CpuMathUtils.MaxAbs(src, src.Length);

            Assert.Equal(expected, actual, 2);
        }
Exemplo n.º 2
0
        public void MaxAbsUTest(string mode, string test, Dictionary <string, string> environmentVariables)
        {
            RemoteExecutor.RemoteInvoke((arg0, arg1) =>
            {
                CheckProperFlag(arg0);
                float[] src = (float[])_testArrays[int.Parse(arg1)].Clone();
                var actual  = CpuMathUtils.MaxAbs(src);

                float expected = 0;
                for (int i = 0; i < src.Length; i++)
                {
                    float abs = Math.Abs(src[i]);
                    if (abs > expected)
                    {
                        expected = abs;
                    }
                }

                Assert.Equal(expected, actual, 2);
                return(RemoteExecutor.SuccessExitCode);
            }, mode, test, new RemoteInvokeOptions(environmentVariables));
        }
Exemplo n.º 3
0
 public float MaxAbsU()
 => CpuMathUtils.MaxAbs(src.AsSpan(0, _smallInputLength));
Exemplo n.º 4
0
 public float ManagedMaxAbsUPerf() => CpuMathUtils.MaxAbs(src, LEN);