Chiron
Chiron

Reputation: 20245

What can we do with OpenCL?

I have been reading about OpenCL and I found this line:

OpenCL gives any application access to the Graphics Processing Unit for non-graphical computing.

Lets say I need to execute a a CPU intensive operation or an algorithm in Java or Clojure (or even maybe running Hadoop MapReduce), could I execute the operation in GPU using OpenCL? if yes, why I would do that?

If we have CPU, why to use GPU?

What are the scenarios of OpenCL applications?

I read that OpenCL provides parallel programming, does this mean it will partition a target job across the CPU and the GPU? or across the GPU alone?

Upvotes: 4

Views: 2683

Answers (3)

SeanVN
SeanVN

Reputation: 1

Intel are certainly less than enthusiastic about openCL. I don't think I will be able to install the drivers on my linux system, they have made it so awkward. There are other technologies such as the Digital Signal Processing chips from Texas Instruments. I would use openCL if I could. However there are some advantages to using say a cluster of cheap ARM boards for quite a lot application. Ease of programming being very important rather than something being hypothetically there but never actually used.

Upvotes: 0

Rick-Rainer Ludwig
Rick-Rainer Ludwig

Reputation: 2401

OpenCL was developed after scientist found out that the GPU architecture was able to perform Linear Algebra calculations very efficiently.

Linear Algebra problems tend to be very easily to parallelize and to be quite simple on the single elements. In most vector and matrix operations one only needs the four basic mathematical functions +, -, / and *. Additionally, some comparisons for Max and Min searches and one is able to do a lot of work in a parallel environment. If the problem size is large enough that the additional time of data copy from RAM to GPU and back is much smaller than the speed gain of the GPU, one reaches large performance increases.

The techniques were developed since than. The first calculations were performed by converting the problems into graphical problems and back. OpenCL was developed to provide a clean interface for calculations.

OpenCL is suitable for problems which can be run in parallel without too much dependencies and which need a lot of calculation power. Linear Algebra, search algorithms, transformations of signals and 3D scenes and colission checks are classic examples.

Upvotes: 5

virtuallinux
virtuallinux

Reputation: 1006

OpenCL provides a portable interface for programming on parallel machines. OpenCL programs can be run on the CPU or the GPU. I've not seen technology that will run the code across both the CPU and the GPU at once.

Use of GPUs for general purpose computing leverages the fact that GPUs are actually built from hundreds or even thousands of simple, small processing elements (PEs). For some tasks, this architecture may be able to complete the task in a fraction of the time required by the CPU.

One drawback of GPUs is that they are really mutant SIMD (Single Instruction Multiple Data) machines; thus large groups of the PEs are constrained to be executing the same operation at the same time, but on different data. This constraint makes designing the program a little bit more difficult.

GPUs are very good for any task that can be parallelized without requiring much communication between different threads. Technologies like NVIDIAs CUDA and OpenCL have begun to see significant amounts of use in scientific applications and High-Performance Computing, both of which exploit parallelism rather heavily.

Upvotes: 7

Related Questions