55
edits
Changes
no edit summary
Most compilers nowadays do not yet support this feature. Probably the only compiler that can already make use of these policies is the Intel C++ Compiler, which was used to perform the tests below.
== Installing PSTL ==
You need:
* C++11 compiler (preferrably Intel C++ Compiler)
* Intel Thread Building Blocks (TBB)
The PSTL is part of the Intel Parallel Studio XE and Intel System Studio.
Set up the environment variables
* On Linux, run <pre>source /opt/intel/pstl/bin/pstlvars.sh bash</pre>
* Include '''pstl/execution''' in the code, as well as '''pstl/algorithm''', '''pstl/numeric''', or '''pstl/memory''', if you need them.
When compiling:
* Add the include directory to the compiler include path. For example: '''-I"/opt/intel/pstl/include"'''
* Enable OpenMP: '''-qopenmp'''
* Enable TBB: '''-tbb'''
== Tests ==
Here are the tests performed: we compared the speed of the four execution policies above for six algorithms: **sort**, **count\_if**, **for_each**, **reduce**, **transform**, and **copy**, using three different data structures: **array**, **vector**, and **list**. We used the Intel C++ Compiler on Windows, on an x86 64 machine with 8 cores. The programs were compiled with **O3** optimization, including the Intel TBB (Thread Building Blocks) library and OpenMP. The purpose of these tests was to see how the elapsed time would change with different execution policies and different data structures.