Comments (5)
Hi. First of all, I'm happy to hear that you had good success with Vc. And I understand that you want to make use of the portability promise now and sadly it isn't there. 😞 The reason is that it became too expensive to maintain more SIMD variants without C++17 (constexpr-if is immensely helpful) and without making much more use of GCC vector builtins, which are not available on MSVC. Once I took that step, the implementation had to be very different. Which is why there's no way to merge the std-simd code back to Vc 1.4.
std-simd is a complete implementation (modulo bugs) of the Parallelism TS 2 simd specification. It's a different feature set from Vc 1.4. But it certainly misses some of the high level APIs. The API is stable (it's an ISO specification...) but the ABI not necessarily. For most use cases this means it is stable. Of course you can install std-simd at a different location than the libstdc++ path. The latter is just to make it work out-of-the-box as would be expected from a TS implementation.
abs
and exp
should work without namespace qualification for std-simd. Though exp
is not vectorized in std-simd yet. iif
is not part of the TS because I hope to use operator?:
instead. Writing your own iif is hard if you require full generality, but making it work for your own codebase is simple. Just implement it using where
.
The replacements for Vc::Zero
and Vc::One
are simply 0
and 1
. Compilers are smart enough now to optimize it properly. Vc::Allocator
is almost unnecessary with C++17 since new
doesn't ignore overalignment anymore.
Documentation is an issue, yes. Did you find https://en.cppreference.com/w/cpp/experimental/simd ? Feel free to bug me for filling in missing documentation.
from std-simd.
Thank you for the explanations. Now I know what I will use in my future projects 😃
The reference "skeleton" that you linked was helpful. I approached my existing code base with a quick-and dirty wrapper such that I can now switch between Vc and std-simd depending on the compiler. At first, std-simd was slower than Vc despite the AVX-512, but then I noticed that we have a lot of exp and log calls. After numerically approximating them accurately enough using arithmetic (Taylor), it's now nice and fast 🚀
from std-simd.
Right, exp
and log
are next on my list for vectorization in std-simd. Note however that I'll have to implement them with high precision in the complete input range. So there's still be room for performance improvement with your own implementation (reduced input range and reduced output precision are the most relevant parameters).
from std-simd.
I just pushed hmin
and hmax
. I have an exp
implementation waiting in another dev branch; I still need to benchmark it. It's precise with a max error of 1ULP.
from std-simd.
Thank you for implementing hmin
/ hmax
, I just pulled it into our codebase.
from std-simd.
Related Issues (20)
- MacOS - fatal error: numeric_traits.h: No such file or directory HOT 5
- sin and cos of std::simd come out wrong with clang++ HOT 1
- unittest failed by math_avx512_ldouble_float_double_schar_ HOT 3
- building error and warning
- Two questions for clarification HOT 3
- Reduce to a bigger type.
- clang++: abs of float vector comes out zero
- Are the benchmarks still executable?
- Add SVE2 instructions to SIMD. HOT 2
- installation issue HOT 3
- sync std-simd and libstdc++ std::experimental::simd code HOT 1
- Inconsistency with n4808
- Support for `std::byte`
- Make `simd` and `simd_mask` ranges
- How to cast simd_mask of type T to another type? HOT 3
- Is this Out-of-bounds access? HOT 1
- Is the reference returned by operator[] to restrictive? HOT 1
- Examples in README.md are not equivalent
- Question about simd_abi::max_fixed_size HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from std-simd.