Exemplo n.º 1
0
        public void AddScaleCopyUTest(int test)
        {
            float[] src      = (float[])testArrays[test].Clone();
            float[] dst      = (float[])src.Clone();
            float[] result   = (float[])dst.Clone();
            float[] expected = (float[])dst.Clone();

            for (int i = 0; i < expected.Length; i++)
            {
                expected[i] *= (1 + DEFAULT_SCALE);
            }

            CpuMathUtils.AddScaleCopy(DEFAULT_SCALE, src, dst, result, dst.Length);
            var actual = result;

            Assert.Equal(expected, actual, comparer);
        }
Exemplo n.º 2
0
        public void AddScaleCopyUTest(string mode, string test, string scale, Dictionary <string, string> environmentVariables)
        {
            RemoteExecutor.RemoteInvoke((arg0, arg1, arg2) =>
            {
                CheckProperFlag(arg0);
                float defaultScale = float.Parse(arg2, CultureInfo.InvariantCulture);
                float[] src        = (float[])_testArrays[int.Parse(arg1)].Clone();
                float[] dst        = (float[])src.Clone();
                float[] result     = (float[])dst.Clone();
                float[] expected   = (float[])dst.Clone();

                for (int i = 0; i < expected.Length; i++)
                {
                    expected[i] *= (1 + defaultScale);
                }

                CpuMathUtils.AddScaleCopy(defaultScale, src, dst, result, dst.Length);
                var actual = result;
                Assert.Equal(expected, actual, _comparer);
                return(RemoteExecutor.SuccessExitCode);
            }, mode, test, scale, new RemoteInvokeOptions(environmentVariables));
        }
Exemplo n.º 3
0
 public void AddScaleCopyU()
 => CpuMathUtils.AddScaleCopy(DefaultScale, src, dst, result, _smallInputLength);
Exemplo n.º 4
0
 public void ManagedAddScaleCopyUPerf() => CpuMathUtils.AddScaleCopy(DEFAULT_SCALE, src, dst, result, LEN);