Can OpenMP be extended to include GPUs?

I read in OpenMP and other threads related to parallel processing and found that many of them argue that CUDA or OpenCL will be the future of such systems. However, I like to think that some modified version of OpenMP would be a better solution and see no reason why GPUs should not run threads.

So my question is, can GPUs run threads in the same way as processors, and extend OpenMP to support GPUs? Is there some theoretical problem with this?

I've read that the most recent OpenMP standard supports GPUs, but no implementation exists. If there is an implementation, how would it be better or worse than the kernel model used by OpenCL?

+3


source to share


2 answers


can GPUs run threads in the same way as CPUs

A GPU thread and the typical definition of a modern multi-core CPU thread differ significantly in their behavior and capabilities. GPU threads have all the necessary functionality to support threads to some degree, but trying to impose a processor style threading model on a GPU thread usually results in poor performance on the GPU. GPU threads must work in sequential groups in order to achieve high performance. As a result of this (see below), the OpenMP4 accelerator model tends to look different from the traditional OpenMP directives for multi-core processor acceleration.

OPENMP can be extended to support GPUs.

OpenMP 4 has the accelerator model directive (new feature in OMP4). So it is of course possible (in theory) to extend OpenMP style acceleration to accelerators (GPU, Xeon Phi, etc.).



For GPUs, at least this OpenMP directive capability will often be markedly different from the type of directive annotation that would be used for normal / traditional OpenMP usage for multi-core processors.

no implementation exists there.

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

Also note that OpenMP is an evolving standard and the accelerator model is quite new, so it is likely to change / evolve to some extent in the future, at least in the accelerator model.

+6


source


Graphics processors are generally different from multiprocessor processor models. General processor SIMD SMP tool , so each processor core can execute independent of other kernel code and work with independent data. However, GPUS usually implements the SIMD model , which means that basically, Cores can only execute one sequence of instructions in a dataset.



OpenMP is well suited for the SISD model, but SIMD has some limitations and because of them, special libraries such as OpenCL or CUDA have been developed

-1


source







All Articles