OpenMP
OpenMP is an API that helps to take advantage of multi-core systems in a simple way.
OpenMP is a multi-platform API, so you can use the same code on WEC7, WEC2013, Linux and other operation systems.
For a good overview see the Wikipedia Article
Windows Embedded Compact 7
Visual Studio and Windows Embedded Compact 7 support OpenMP. However, not all versions of the WEC7 SKUs do allow to use the OpenMP. You need a C7G or a C7P (Professional) license. For more information see the WEC7 SKU comparison.
Windows Embedded Compact 2013
In WEC2013 OpenMP is an always on feature. See also the catalog changes from Compact 7 to Compact 2013.
Setup your Enviroment
- Set Compiler option /openmp
- You may need to set the path to "vcomp.lib" on your development PC.
(Got to Project->Properties->Linker->General->Additional Library Directories) - Add #include <omp.h> to your program file
- Make sure openmpce.dll is on the Colibri.
Limitations
The following OpenMP pragmas that are not supported by Windows Embedded Compact 7.
omp dynamic
omp threadprivate
See: http://msdn.microsoft.com/en-us/library/ee479345.aspx
Performance
In best case the use of openMP can close to double the performance on a dual core system. However, a few internal test showed that the first time you hit a #pragma omp, the system needs up to additional 250ms to initialize the openMP environmental, after that the overhead is much smaller (in our tests 13uS). It is recommended to test if openMP increases or decreases the performance of your application.