Parallel calculation using Geforce Cuda

Asked

Viewed 75 times

1

I have the following method that calculates the value of PI in a serial way:

        public static double CalculoPISerie()
        {
            double integral = 0;
            double h = 1.0 / NUMERO;

            for (int i = 0; i <= NUMERO; i++)
            {
                if (i == 0 || i == NUMERO)
                    integral += (4.0 / (1.0 + Math.Pow(i * h, 2)));
                else
                    integral += (2 * ((4.0 / (1.0 + Math.Pow(i * h, 2)))));
            }

            return integral * h / 2;
        }

I would like to do this in parallel using Geforce’s CUDA. How can I do ?

  • And only you use a thread

  • How I do this method with threads ?

  • have you ever installed a compiler for CUDA? Start here: http://www.nvidia.com/content/cuda/cuda-toolkit.html

  • I installed everything already. I don’t know now how to implement this method in parallel

  • Here the documentation threads http://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__THREAD__DEPRECATED.html#group__CUDART__THREAD__DEPRECATED

  • 1

    I believe that in addition to the CUDA Toolkit, you will need a wrapper to access unmanaged code from C#. Option of lib for this: http://kunzmi.github.io/managedCuda/

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.