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); }
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)); }
public float MaxAbsU() => CpuMathUtils.MaxAbs(src.AsSpan(0, _smallInputLength));
public float ManagedMaxAbsUPerf() => CpuMathUtils.MaxAbs(src, LEN);