コード例 #1
0
        public FunctionPatcherTest()
        {
            _dummyFunctions = new DummyFunctions();
            _returnFive     = Wrapper.Create <DummyFunctions.ReturnNumberDelegate>((long)_dummyFunctions.ReturnFive);
            _returnSix      = Wrapper.Create <DummyFunctions.ReturnNumberDelegate>((long)_dummyFunctions.ReturnSix);
            _assembler      = new Assembler.Assembler();

            BuildRelativeJmp();
            BuildPushReturn();
        }
コード例 #2
0
        public FunctionPatcherTest()
        {
            _dummyFunctions = new DummyFunctions();
            _returnFive     = ReloadedHooks.Instance.CreateWrapper <DummyFunctions.ReturnNumberDelegate>((long)_dummyFunctions.ReturnFive, out _);
            _returnSix      = ReloadedHooks.Instance.CreateWrapper <DummyFunctions.ReturnNumberDelegate>((long)_dummyFunctions.ReturnSix, out _);
            _assembler      = new Assembler.Assembler();

            BuildRelativeJmp();
            BuildPushReturn();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: uzbekdev1/CUDAfy.NET
        static void Main(string[] args)
        {
            try
            {
                CudafyModes.Target        = eGPUType.Cuda;
                CudafyModes.DeviceId      = 0;
                CudafyTranslator.Language = CudafyModes.Target == eGPUType.OpenCL ? eLanguage.OpenCL : eLanguage.Cuda;

                Console.WriteLine("===================================\n          CudafyExamples\n         Hybrid DSP Systems\nCopyright © Hybrid DSP Systems 2011\n===================================");
                Console.WriteLine("\n* VS 2019 & .NET 4.8\n* optimization by RapidDev\n");

                ConsoleHeader(1, "ArrayBasicIndexing");
                ArrayBasicIndexing.Execute();
                ConsoleHeader(2, "ArrayMultidimensions");
                ArrayMultidimensions.Execute();

                if (CudafyModes.Target != eGPUType.OpenCL)
                {
                    ConsoleHeader(3, "Class examples");
                    CudafyClassExamples.Execute();
                    ConsoleHeader(4, "SIMDFunctions");
                    SIMDFunctions.Execute();
                    ConsoleHeader(5, "GlobalArrays");
                    GlobalArrays.Execute();
                    ConsoleHeader(6, "ComplexNumbersD");
                    ComplexNumbersD.Execute();
                    ConsoleHeader(7, "ComplexNumbersF");
                    ComplexNumbersF.Execute();
                    ConsoleHeader(8, "DummyFunctions");
                    DummyFunctions.Execute();

                    ConsoleHeader(9, "TextInsertion");
                    TextInsertion.Execute();


                    ConsoleHeader(10, "Voting.Ballot");
                    Voting.Ballot.Execute();
                    ConsoleHeader(11, "Voting.SyncThreadCount");
                    Voting.SyncThreadCount.Execute();

                    ConsoleHeader(12, "FinanceTest");
                    FinanceTest.Execute();
                    ConsoleHeader(13, "Timing");
                    Timing.Execute();
                    ConsoleHeader(14, "PinnedAsyncIO");
                    PinnedAsyncIO.Execute();
                }
                Console.WriteLine("Done!");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.ReadKey();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: deepakkumar1984/Cudafy.NET
        static void Main(string[] args)
        {
            try
            {
                CudafyModes.Target        = eGPUType.OpenCL;
                CudafyModes.DeviceId      = 0;
                CudafyTranslator.Language = CudafyModes.Target == eGPUType.OpenCL ? eLanguage.OpenCL : eLanguage.Cuda;

                Console.WriteLine("\r\nArrayBasicIndexing");
                ArrayBasicIndexing.Execute();
                Console.WriteLine("\r\nArrayMultidimensions");
                ArrayMultidimensions.Execute();

                if (CudafyModes.Target != eGPUType.OpenCL)
                {
                    Console.WriteLine("\r\nClass examples");
                    CudafyClassExamples.Execute();
                    Console.WriteLine("\r\nSIMDFunctions");
                    SIMDFunctions.Execute();
                    Console.WriteLine("\r\nGlobalArrays");
                    GlobalArrays.Execute();
                    Console.WriteLine("\r\nComplexNumbersD");
                    ComplexNumbersD.Execute();
                    Console.WriteLine("\r\nComplexNumbersF");
                    ComplexNumbersF.Execute();
                    Console.WriteLine("\r\nDummyFunctions");
                    DummyFunctions.Execute();

                    Console.WriteLine("\r\nTextInsertion");
                    TextInsertion.Execute();


                    Console.WriteLine("\r\nVoting.Ballot");
                    Voting.Ballot.Execute();
                    Console.WriteLine("\r\nVoting.SyncThreadCount");
                    Voting.SyncThreadCount.Execute();

                    Console.WriteLine("\r\nFinanceTest");
                    FinanceTest.Execute();
                    Console.WriteLine("\r\nTiming");
                    Timing.Execute();
                    Console.WriteLine("\r\nPinnedAsyncIO");
                    PinnedAsyncIO.Execute();
                }
                Console.WriteLine("Done!");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.ReadKey();
        }