Intel's valarray implementation allows you to declare huge arrays for parallel processing. Improved implementation of valarray is tied up with calling the IPP libraries that are part of Intel® Integrated Performance Primitives (Intel® IPP).
To use valarrays in your source code, include the valarray header file, <valarray>. The <valarray> header file is located in the path <installdir>/perf_header.
The example code below shows a valarray addition operation (+) specialized through use of Intel's implementation of valarray:
#include <valarray>
void test( )
{
std::valarray<float> vi(N), va(N);
…
vi = vi + va; //array addition
…
}
To use the static merged library containing all CPU-specific optimized versions of the library code, you need to call the ippStaticInit function first, before any IPP calls. This ensures automatic dispatch to the appropriate version of the library code for Intel® processor and the generic version of the library code for non-Intel processors at runtime. If you do not call ippStaticInit first, the merged library will use the generic instance of the code. If you are using the dynamic version of the libraries, you do not need to call ippStaticInit.
Optimization Notice |
---|
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 |