TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Expressive Vector Engine – SIMD in C++

76 点作者 klaussilveira4 个月前

6 条评论

vblanco4 个月前
Interesting library, but i see it falls back into what happens to almost all SIMD libraries, which is that they hardcode the vector target completely and you cant mix&#x2F;match feature levels within a build. The documentation recommends writing your kernels into DLLs and dynamic-loading them which is a huge mess <a href="https:&#x2F;&#x2F;jfalcou.github.io&#x2F;eve&#x2F;multiarch.html" rel="nofollow">https:&#x2F;&#x2F;jfalcou.github.io&#x2F;eve&#x2F;multiarch.html</a><p>Meanwhile xsimd (<a href="https:&#x2F;&#x2F;github.com&#x2F;xtensor-stack&#x2F;xsimd">https:&#x2F;&#x2F;github.com&#x2F;xtensor-stack&#x2F;xsimd</a>) has the feature level as a template parameter on its vector objects, which lets you branch at runtime between simd levels as you wish. I find its a far better way of doing things if you actually want to ship the simd code to users.
评论 #42633625 未加载
评论 #42635795 未加载
评论 #42633491 未加载
评论 #42637553 未加载
评论 #42636358 未加载
Conscat4 个月前
EVE is personally my favorite SIMD library in any programming language. It&#x27;s the only one I&#x27;ve tried that provides masked lane operations in a declarative style, aside from SPMD languages like CUDA or OpenMP. The [] syntax for that is admittedly pretty exotic C++, but I think the usefulness of the feature is worth it. I wish the documentation was better, though. When I first started, I struggled to figure out how to simply make a 4-lane float vector that I can pass into shaders, because almost all of the examples are written for the &quot;wide&quot; native-SIMD size.
thrtythreeforty4 个月前
This library&#x27;s eve::soa_vector is the first attempt I&#x27;ve seen at dealing with the &quot;SOA problem,&quot; which is that if you write good, parallel-friendly code, all your types go to hell and never come back because the language can&#x27;t express concepts like &quot;my object is made from element 7 of each of these 6 pointers.&quot; Instead you write really FORTRAN-looking array processing code with no types or methods in sight.<p>Does anyone know of other libraries that help a C++ programmer deal with struct-of-arrays?
评论 #42646378 未加载
nickpsecurity4 个月前
I also found this looking for portable SIMD:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;highway">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;highway</a>
dyaroshev4 个月前
Hi!<p>Thanks for your interest in the library.<p>Here is a godbolt example: <a href="https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;bEGd7Tnb3" rel="nofollow">https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;bEGd7Tnb3</a> Here is a bunch of simple examples: <a href="https:&#x2F;&#x2F;github.com&#x2F;jfalcou&#x2F;eve&#x2F;blob&#x2F;fb093a0553d25bb8114f1396cced329ad99949f5&#x2F;examples&#x2F;start_here.cpp#L16">https:&#x2F;&#x2F;github.com&#x2F;jfalcou&#x2F;eve&#x2F;blob&#x2F;fb093a0553d25bb8114f1396...</a><p>I personally think we have the following strenghs:<p>* Algorithms. Writing SIMD loops is very hard. We give you a lot of ready to go loops. (find, search, remove, set_intersection to name a few). * zip and SOA support out of the box. * High quality codegen. I haven&#x27;t seen other libraries care about unrolling&#x2F;aligning data accesses - meanwhile these give you substantial improvements. * Supporting more than transform&#x2F;reduce. We have really decent compress implemented for sse&#x2F;avx&#x2F;neon implemented for example.<p>The following weaknesses:<p>* We don&#x27;t support runtime sized sve&#x2F;rvv (only fixed size). We tried really hard, but unfortunately just the C++ language refuses to play ball there. Here is a discussion about that <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;73210512&#x2F;arm-sve-wrapping-runtime-sized-register" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;73210512&#x2F;arm-sve-wrappin...</a><p>If this is something you need we recommend compiling a few dynamic libraries with the correct fixed lengths. Google Highway manage to pull it off but the trade off is a variadics interface that I personally find very difficult.<p>* Runtime dispatch based on arch.<p>We again recommend dlls for this. The problem here is ODR. I believe there is a solution based on preprocessor and namespaces I could use but it breaks as soon as modules become a thing. So - in the module world - we don&#x27;t have an option. I&#x27;m happy for suggestions.<p>* No MSVC support<p>C++20 and MSVC is still not a thing enough. And each new version breaks something that was already working. Sad times.<p>* Just tricky to get started.<p>I don&#x27;t know what to do about that. I&#x27;m happy to just write examples for people. If you wanna try a library - please create an issue&#x2F;discussion or smth - I&#x27;m happy to take some time and try to solve your case.<p>We talked about the library at CppCon: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;WZGNCPBMInI?si=buFteQB1e1vXRT5M" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;WZGNCPBMInI?si=buFteQB1e1vXRT5M</a><p>If you want to learn how SIMD algorithms work, here are a couple of talks I gave: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;PHZRTv3erlA?si=b87DBYMDskvzYcq1" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;PHZRTv3erlA?si=b87DBYMDskvzYcq1</a> <a href="https:&#x2F;&#x2F;youtu.be&#x2F;vGcH40rkLdA?si=WL2e5gYQ7pSie9bd" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;vGcH40rkLdA?si=WL2e5gYQ7pSie9bd</a><p>Feel free to ask any questions.
评论 #42643770 未加载
shadowpho4 个月前
Wait what about AMD? They only claim support for intel and arm
评论 #42637564 未加载
评论 #42636851 未加载