Esempio n. 1
0
        private static void TestKernels()
        {
            float[]        tmp  = new float[] { 1, 2, 3, 4, 4, 3, 2, 1, 0, 6, 4, 3, 1, 11, 14, 2 };
            ComplexFloat[] test = tmp.Convert();

            FFTParallelOptimised.omegas = OmegaCalculator.GenerateOmegas(4);
            stopwatch.Start();
            Print(FFTOptimisedKernels.Kernel16(tmp, ref FFTParallelOptimised.omegas), true);
            for (int i = 0; i < 1000; i++)
            {
                FFTOptimisedKernels.Kernel16(tmp, ref FFTParallelOptimised.omegas);
            }
            stopwatch.Stop();
            t1 = stopwatch.ElapsedTicks;

            Console.WriteLine();
            stopwatch.Restart();
            Print(FFTParallelOptimised.FFT(tmp, false), true);
            for (int i = 0; i < 1000; i++)
            {
                FFTParallelOptimised.FFT(tmp, false);
            }
            stopwatch.Stop();
            t2 = stopwatch.ElapsedTicks;
            Console.WriteLine();
            Console.WriteLine(t1 + "   " + t2 + "   " + t1 / (float)t2);
        }