public void ViennaHostProvider_AbsSum()
        {
            var provider = new VclHostTensorMath();

            var x = new ArraySlice<double>(10);
            for (int i = 0; i < x.Length; i++)
                x[i] = -i;

            var y = new ArraySlice<double>(10);
            double asum = provider.Asum(x);

            double cpu = 0;
            for (int i = 0; i < x.Length; i++)
                cpu += Math.Abs(x[i]);

            Assert.True(MathHelpers.Equality(cpu, asum));
        }
        public void ViennaHostProvider_AbsSumWithRollingArray()
        {
            var provider = new VclHostTensorMath();

            var x = new double[20];
            for (int i = 0; i < x.Length; i++)
                x[i] = -i;

            var results = new double[10];
            for (int i = 0; i < results.Length; i++)
            {
                var y = new ArraySlice<double> (x, i, results.Length);
                results[i] = provider.Asum(x);
            }

            double cpu = 0;
            for (int i = 0; i < 10; i++)
                cpu += Math.Abs(x[i]);

            Assert.All(results, r => MathHelpers.Equality(r, cpu));
        }