Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Delphi to take advantage of GPGPU technology?

GPGPU is the principle of using the parallel processors on video cards for massive increases in performance.

Does anyone have any ideas about using GPGPU in Delphi, using either OpenCL or CUDA? CUDA was/is NVidia only, but they have also adopted the OpenCL "standard".

I found a few Delphi samples from Google searches but they either crash or don't compile/run.

The ultimate instruction sample would be:

  1. Download and install the OpenCL DLLs from here.
  2. Download the OpenCL SDK from from here.
  3. Download this sample Delphi project from here.
  4. Open and compile the Delphi project. If all goes to plan it will do "whatever it is supposed to do"

At that stage I can then start researching the OpenCL SDK and writing/compiling DLLs to call from any Delphi app.

This sort of stuff is really starting to take off. Embarcadero do not have to do anything themselves at this stage (unless they want to), but if there were a tutorial and samples for Delphi available it would be great. Many samples are available for other languages, but we do also need a good and simple Delphi example to show how easy it is to use Delphi for GPGPU apps.

like image 338
TallGuy Avatar asked Dec 20 '09 04:12

TallGuy


People also ask

Should I use CUDA or OpenCL?

The general consensus is that if your app of choice supports both CUDA and OpenCL, go with CUDA as it will generate better performance results. The main reason for this is that Nvidia provide top quality support to app developers who choose to use CUDA acceleration, therefore the integration is always fantastic.

Is CUDA faster than OpenCL?

A study that directly compared CUDA programs with OpenCL on NVIDIA GPUs showed that CUDA was 30% faster than OpenCL.

Does OpenCL use GPU?

OpenCL™ (Open Computing Language) is a low-level API for heterogeneous computing that runs on CUDA-powered GPUs. Using the OpenCL API, developers can launch compute kernels written using a limited subset of the C programming language on a GPU.

What is CUDA good for?

CUDA® is a parallel computing platform and programming model that enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU).


1 Answers

CUDA is still nVidia only, and that won't change. OpenCL is a true standard in this case, not only limited to GPGPU.

As for using it in Delphi, all I know of is how to use it in Free Pascal. However, there's quite some chance that the code will be portable, here's a link to updated headers:

FreePascal Mantis RFE OpenCL

As for DLL's, if you use nVidia, they can be found here.

Here however we have a sample project in Delphi.

like image 109
Kornel Kisielewicz Avatar answered Oct 03 '22 20:10

Kornel Kisielewicz