On 09/02/2017 21:54, Oswin Krause via Boost wrote:
On 2017-02-09 19:24, Joel FALCOU via Boost wrote:
Can Boost.SIMD please be added to the review queue? Michael Caisse has volunteered to act as the review manager.
Boost.SIMD is an efficient modern C++ wrapper for SIMD instructiosn sets and computations that aims at providing a standard way to write code taking advantages of SIMD enabled hardwares.
Boost.SIMD repository https://github.com/NumScale/boost.simd
Documentation https://developer.numscale.com/boost.simd/documentation/develop/
Thanks in advance
Joel Falcou - CTO @ NumScale
Hi,
nice work! I have waited to see this going into review. I would be happy to try this out on my code that currently uses compiler vectorization.
Thanks for your interest.
The documentation looks good. May I ask one or two things?
1. Is simd::pack a POD? i.e. can aligned memory be cast into a pack?
float* aligned_memory=...; simd::pack<float>* packed_memory = (simd::pack<float>*) aligned_memory;
(this would make my experiment a two-line change)
It is. We however advise using our load/aligned_load functions so you can access more fine-tuned operations and we can guarantee that the proper intrinsic are emitted. We had cases where such reintrepret_cast lead to subtle bugs on some compilers/arch combination or sub-optimal performances.
2. Is there a difference between the allocators in boost/align and what simd offers?
The one we provide are just wrapper around Boost.Alignment so that their default status is compatible with current architecture SIMD alignment constraints, ie a boost::simd::allocator<float> will auto-align on the proper alignment for your CPU without having to remember it. We tried to move as much as we can of our alignment handling to Boost.Align where it belongs. This is the same for Boost.Predef that contains the SIMD macro detection.