Exemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                CudafyModes.DeviceId     = 0;
                CudafyModes.Architecture = CudafyHost.GetDevice(eGPUType.Cuda, CudafyModes.DeviceId).GetArchitecture();  //eArchitecture.sm_35; // *** Change this to the architecture of your target board ***
                CudafyModes.Target       = CompilerHelper.GetGPUType(CudafyModes.Architecture);

                if (CudafyModes.Target != eGPUType.OpenCL)
                {
                    CURANDTests.Basics();
                }

                StringTests st = new StringTests();
                CudafyUnitTest.PerformAllTests(st);

                BasicFunctionTests bft = new BasicFunctionTests();
                CudafyUnitTest.PerformAllTests(bft);

                GMathUnitTests gmu = new GMathUnitTests();
                CudafyUnitTest.PerformAllTests(gmu);

                MultithreadedTests mtt = new MultithreadedTests();
                CudafyUnitTest.PerformAllTests(mtt);

                CopyTests1D ct1d = new CopyTests1D();
                CudafyUnitTest.PerformAllTests(ct1d);

                GPGPUTests gput = new GPGPUTests();
                CudafyUnitTest.PerformAllTests(gput);

                if (CudafyHost.GetDeviceCount(CudafyModes.Target) > 1)
                {
                    MultiGPUTests mgt = new MultiGPUTests();
                    CudafyUnitTest.PerformAllTests(mgt);
                }

                if (CudafyModes.Architecture == eArchitecture.sm_35)
                {
                    Compute35Features c35f = new Compute35Features();
                    CudafyUnitTest.PerformAllTests(c35f);
                }

                Console.WriteLine("Done");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                CudafyModes.DeviceId = 0;
                GPGPU gpu = CudafyHost.GetDevice(eGPUType.Cuda, CudafyModes.DeviceId);
                CudafyModes.Architecture = gpu.GetArchitecture(); //eArchitecture.sm_35; // *** Change this to the architecture of your target board ***
                CudafyModes.Target       = CompilerHelper.GetGPUType(CudafyModes.Architecture);
                Console.WriteLine("{0}: Arch: {1}, Type: {2}, ID: {3}", gpu.GetDeviceProperties(false).Name, CudafyModes.Architecture, CudafyModes.Target, CudafyModes.DeviceId);

                if (CudafyModes.Target == eGPUType.Cuda)
                {
                    CURANDTests.Basics();
                }

                SIMDFunctionTests sft = new SIMDFunctionTests();
                CudafyUnitTest.PerformAllTests(sft);

                StringTests st = new StringTests();
                CudafyUnitTest.PerformAllTests(st);

                BasicFunctionTests bft = new BasicFunctionTests();
                CudafyUnitTest.PerformAllTests(bft);

                GMathUnitTests gmu = new GMathUnitTests();
                CudafyUnitTest.PerformAllTests(gmu);

                MultithreadedTests mtt = new MultithreadedTests();
                CudafyUnitTest.PerformAllTests(mtt);

                CopyTests1D ct1d = new CopyTests1D();
                CudafyUnitTest.PerformAllTests(ct1d);

                GPGPUTests gput = new GPGPUTests();
                CudafyUnitTest.PerformAllTests(gput);

                if (CudafyHost.GetDeviceCount(CudafyModes.Target) > 1)
                {
                    MultiGPUTests mgt = new MultiGPUTests();
                    CudafyUnitTest.PerformAllTests(mgt);
                }

                if (CudafyModes.Architecture >= eArchitecture.sm_30 && CudafyModes.Target == eGPUType.Cuda)
                {
                    WarpShuffleTests wst = new WarpShuffleTests();
                    CudafyUnitTest.PerformAllTests(wst);
                }

                if (CudafyModes.Architecture >= eArchitecture.sm_35 && CudafyModes.Target == eGPUType.Cuda)
                {
                    Compute35Features c35f = new Compute35Features();
                    CudafyUnitTest.PerformAllTests(c35f);
                }

                Console.WriteLine("Done");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.ReadLine();
            }
        }