News for hackers. Stuff that matters.
Re:C++: The Most Important Complexities by csjh on Thursday November 16, 2023 @02:03AM (#38286517)
Never heard of `execution`, great tip. Is there some big caveat or just generally unknown?
Re:C++: The Most Important Complexities by harrid on Thursday November 16, 2023 @02:34AM (#38286701)
You need to be aware that these invocations are going to blast your cores full throttle as you obviously don't have fine grained control. But as long as your data is easily parallelized on a vector with computations that don't depend on each other, it's a game changer. I use it all the time to multithread things with literally a single line of code.
Re:C++: The Most Important Complexities by lionkor on Thursday November 16, 2023 @02:56AM (#38286834)
I looked into it (my video, probably too long https://youtu.be/9oh66SF91LA?si=azDCSOAJKA9Gpzim), and the general result was that they make sense for non-small datasets and are a solid way to to parallelize something without having to pull in OpenMP or something.
Re:C++: The Most Important Complexities by coffeeaddict1 on Thursday November 16, 2023 @03:54AM (#38287144)
They're only supported in MSVC and GCC (for the latter you need to link against Intel's TBB to make it work). Support in libc++ (Clang) is work in progress.
Re:C++: The Most Important Complexities by pca006132 on Thursday November 16, 2023 @04:01AM (#38287182)
Clang does support parallel stl already (requires either TBB or OpenMP). Our project https://github.com/elalish/manifold made use of this to speed up mesh processing algorithms a lot.
Re:C++: The Most Important Complexities by coffeeaddict1 on Thursday November 16, 2023 @04:04AM (#38287199)
Does it? You mean if you link against libstdc++ instead of libc++?
Re:C++: The Most Important Complexities by pca006132 on Thursday November 16, 2023 @04:10AM (#38287244)
I remember it works for libc++ (partially, see https://libcxx.llvm.org/Status/PSTL.html), but forgot when I linked against libc++ last time...
Re:C++: The Most Important Complexities by cyber_kinetist on Thursday November 16, 2023 @09:12AM (#38289699)
Incomplete support from Clang’s STL (especially in Apple Clang).