Vc
Vc copied to clipboard
Could you add more basic examples?
Thanks a lot for this great work!
I have a humble request for more examples. I found getting started a bit difficult because, despite making SIMD programming much simpler, Vc's examples and documentation assume already a certain level of SIMD-awareness.
I would very much cherish some examples that are targeting novice users. I.e., a common use case may be a simple numerical operation on two std::vectors. Starting from a non-SIMD implementation:
std::vector<float> AddVectors(std::vector<float>& First, std::vector<float>& Second) {
std::vector<float> Result(First.size());
for(size_t vIdx = 0; vIdx < First.size(); ++vIdx)
Result[vIdx] = First[vIdx] + Second[vIdx];
return Result;
}
how would this translate to a Vc-implementation?
Specifically it would be great if the example could highlight:
- How would the most simple implementation in Vc look like?
- How does one deal with sizes that are not multiples of the SIMD width?
- How would one implement the method if the signature does not use Vc-types? Is it possible to pass std::vector
with the right alignment, or is it required to use Vc's types?
In my humble opinion, having a few such basic examples would open many more programmers the door to write their every day code SIMD-aware.