user2277550
user2277550

Reputation: 621

Can OpenMP be extended to include graphics processors?

I was reading on OpenMP and other topics related to parallel processing and found a large number of them claiming that CUDA or OpenCL would be the future of such systems. However, I like to think that some modified version of OpenMP would be the best solution and don't see a reason why GPUs shouldn't run threads.

So my question is, can GPUs run threads just as well as CPUs and can OpenMP be extended to support GPUs? Is there some theoretical problem with this?

I read that the most recent OpenMP standard supports GPU but there doesn't exist an implementation of one. If there is an implementation, how would it be better or worse than the 'kernel' model used by OpenCL?

Upvotes: 3

Views: 399

Answers (2)

Robert Crovella
Robert Crovella

Reputation: 151789

can GPUs run threads just as well as CPU's

A GPU thread and the typical definition of a modern multicore CPU thread are substantially different in their behavior and capabilities. GPU threads to some degree have all the necessary features to support threads, but attempting to impose a CPU-style thread model on a GPU thread will generally result in poor performance on the GPU. GPU threads need to work in a consistent fashion in groups in order to achieve high performance. As a result of this, (see below) the OpenMP4 accelerator model tends to look different than the traditional OpenMP directives for multicore CPU acceleration.

can OPENMP be extended to support GPUs.

OpenMP 4 has accelerator-model directives capability (new feature in OMP4). So it's certainly possible (in theory) to extend OpenMP style acceleration to accelerators (GPUs, Xeon Phi, etc.)

For GPUs at least, this OpenMP directives capability will often look noticeably different than the type of directive annotation that would be used for ordinary/traditional OpenMP usage on multicore CPUs.

there doesnt exist any implementation of one.

The standard was published recently, and it will probably take some time for compiler vendors to implement the standard. The rose compiler is an example of a research-oriented compiler that was used to test the (early implementation of the) OpenMP 4 accelerator model. Recent versions of intel ICC may have some support for OpenMP 4 targetting Xeon Phi, and Cray compilers may have some support for OpenMP 4 targetting GPUs (in Cray systems).

Also note that OpenMP is an evolving standard, and the accelerator model is pretty new, so things are likely to change/evolve to some degree in the future, at least within the accelerator model.

Upvotes: 6

Lol4t0
Lol4t0

Reputation: 12547

GPUs usually implement different from CPUs multpiprocessing model. Common CPU implement SIMD SMP, so every processor core can execute independant from another core code and operate on the independant data. However GPUS usually implement SIMD model, which means basically that Cores can execute only same instructions sequence on the data array.

OpenMP good fits SISD model but SIMD implies some limitations, and because of them special libraries like OpenCL or CUDA have been developed

Upvotes: -1

Related Questions