vendredi 22 novembre 2013

OpenMP support in different compiler.

OpenMP is a powerful and useful standard supported by many compiler to introduce parallelism (multi-threading) in your C/C++ source code with “minimal effort.

But, depending of your developing environment, you may face some problems and the 1st from my POV is that if you compile the same source code with GCC/G++ and Visual Studio C++ compiler you cannot use the complete and last OpenMP functionnalities.

The reason is that VS' C/C++ compiler (even the last version VS’2013) only support OpenMP 2.0. It’s an old version released in March 2002.

While OpenMp support in VS was frozen since its 1st introduction in VS’2005, GCC/G++ support evolve and a recent GCC version like v4.9 support the last OpenMP v4.0 (July 2013).

You can consul that page to find which version of OpenMP is supported in the GCC version you used to build.

Note that CLang also provide OpenMP support but only for the v3.1.

---------------------------------

So, to conclude if you develop for several compiler and want to share your source code you should choose to keep using the ‘old’ v2.0. It’s a bit silly because the 3.1 and v4 introduce a lot of new functionalities like task, simd, device, etc …

Aucun commentaire :

Enregistrer un commentaire