NumCpp
NumCpp copied to clipboard
Does NumCpp generates vectorized instructions (AVX512)?
Does NumCpp generates vectorized instructions (e.g. AVX512) after compiling with proper flags?
NumPy is able to leverage performance benefits from SIMD (vectorized) instruction set as per this link.
I'd like to know the answer too.
I'm considering putting NumCpp into production. And I'm facing a situation where performance really matters.
And also, does this project welcome PRs? What instructions should I follow if I want to contribute?
The short answer is that the NumCpp library does not do anything special to assure vectorized instructions are generated. The element-wise operations are for the most part built on top of the standard <algorithm> algorithms. If you compile with the NUMCPP_USE_MULTITHREAD option then they will default to using the std::par_unseq execution policy. So depending on your compiler and standard library implementation it can/may generate vectorized instructions.