Proposed C++ SIMD extensions

516 views
Skip to first unread message

Simon Byrne

unread,
May 27, 2016, 4:17:53 AM5/27/16
to julia-dev
I recently saw a talk by Mathias Gaunard on the proposed SIMD extensions for C++ (of which he is one of the main developers). There were some interesting ideas there, which I thought might be of interest to others in the Julia community, so here are his slides (posted with his permission).
Gaunard-simd.pdf

Kenta Sato

unread,
May 27, 2016, 1:12:36 PM5/27/16
to julia-dev
I really want to see `datapar<T,N>` type in Julia. This will greatly improve the performance of pariwise sequence alignment algorithms in bioinformatics. I've ever written such a SIMD algorithm in C++ and called it from Julia through a C wrapper. Will `VecElement{T}` make it possible?

Erik Schnetter

unread,
May 27, 2016, 1:22:11 PM5/27/16
to juli...@googlegroups.com
There is a SIMD package <https://github.com/eschnett/SIMD.jl> for Julia. It offers a type Vec{N,T}, which is internally represented as (sequence of) SIMD vectors, by using the respective LLVM instructions. Today, the Travis and Appveyor tests for SIMD finally went green for the master branch of Julia, after a long struggle to add certain features to Julia and circumvent certain bugs in LLVM (thanks, @ArchRobison!).

The Vec{N,T} looks very much like NTuple{N,T}, with the addition of element-wise arithmetic operations, and mechanisms to load/store Vecs from arrays.

I've used the equivalent of the SIMD package on C++ for a few years to improve performance for the Einstein Toolkit <https://einsteintoolkit.org>. I haven't looked at the slides yet, but if they contain new ideas I'd be happy to add them to SIMD.

-erik

Páll Haraldsson

unread,
Jul 13, 2016, 9:33:14 AM7/13/16
to julia-dev


On Friday, May 27, 2016 at 8:17:53 AM UTC, Simon Byrne wrote:
I recently saw a talk by Mathias Gaunard on the proposed SIMD extensions for C++ (of which he is one of the main developers). There were some interesting ideas there, which I thought might be of interest to others in the Julia community, so here are his slides (posted with his permission).

Interesting, e.g. slide 4 on where "Future C++ Standard" fits in. Not it (C++ and C) has [more explicit] intrinsics (and inline assembly, or is that only C [in GCC]?).

Would you say that Julia has (@simd) at a similar level? E.g. already ahead* of C++ (while yes, Julia isn't standardized in any way..)? Is C++ practically ahead, just using non-standardized ways? [I know of e.g. ParallelAccelerator and what is possible (and what is possible additionally with GPUs), that is of course not used in Julia benchmarks on it homepage, but didn't look if @simd is used there..].


* I guess this answers that (and Vc library):

https://github.com/NumScale/boost.simd "Portable SIMD computation library - To be proposed as a Boost library"

in other words: practically C++ is good, using libraries, that are not standardized, not even for Boost yet, but work portably.. (but not to Windows, at least this library?)


Question: C (but not Fortran), assumed aliasing, and restrict keyword to get fast, C++ has similar. Doesn't Julia in general assume no aliasing (or it's your problem if you make it happen..), e.g. has nothing similar to the restrict keyword, and doesn't need it. [I know @simd, allows slightly changed semantics.]

--
Palli.

Reply all
Reply to author
Forward
0 new messages