Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 855
Chiron Avatar asked Dec 17 '22 15:12

Chiron


1 Answers

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.

like image 122
virtuallinux Avatar answered Dec 25 '22 04:12

virtuallinux