Can/Should I run this code of a statistical application on a GPU?

后端 未结 5 762
猫巷女王i
猫巷女王i 2021-01-30 04:24

I\'m working on a statistical application containing approximately 10 - 30 million floating point values in an array.

Several methods performing different, but independen

5条回答
  •  醉话见心
    2021-01-30 04:48

    Is it possible (and does it make sense) to utilize a GPU to speed up such calculations?

    • Definitely YES, this kind of algorithm is typically the ideal candidate for massive data-parallelism processing, the thing GPUs are so good at.

    If yes: Does anyone know any tutorial or got any sample code (programming language doesn't matter)?

    • When you want to go the GPGPU way you have two alternatives : CUDA or OpenCL.

      CUDA is mature with a lot of tools but is NVidia GPUs centric.

      OpenCL is a standard running on NVidia and AMD GPUs, and CPUs too. So you should really favour it.

    • For tutorial you have an excellent series on CodeProject by Rob Farber : http://www.codeproject.com/Articles/Rob-Farber#Articles

    • For your specific use-case there is a lot of samples for histograms buiding with OpenCL (note that many are image histograms but the principles are the same).

    • As you use C# you can use bindings like OpenCL.Net or Cloo.

    • If your array is too big to be stored in the GPU memory, you can block-partition it and rerun your OpenCL kernel for each part easily.

提交回复
热议问题