Comments (6)
@DenisYaroshevskiy thank you, indeed so, again from https://en.cppreference.com/w/cpp/algorithm/copy:
In practice, implementations of std::copy avoid multiple assignments and use bulk copy functions such as std::memmove if the value type is TriviallyCopyable and the iterator types satisfy LegacyContiguousIterator.
But actually I see a contradiction in the standard because they preserve a well-defined behaviour for trivially copyable POD types as a special case but warn about everything else to be copied with undefined result. They'd better call memcpy from my point of view to conform their rules and also possibly increase performance. Of course, if they did that they would definitely need to introduce a new algo for copying overlapping objects and memory
Nevertheless, it is quite beside the point of our initial talk
from eve.
Why eve doesn't call memmove
We could but then: a) we loose all the tuning abilities. b) memmove is great, just use memmove.
Generally speaking I wouldn't use eve::algo::copy
for just bytes copying.
PSS: Also, be aware, that everything is compiled in -march=native mode that enables everything up to avx512 including
If you use avx512 - I'd recommend to think about frequency scaling https://jfalcou.github.io/eve/freqscale.html - you might get more perf.
from eve.
@DenisYaroshevskiy I didn't talk about memmove, though :) Is there misundestanding?)
from eve.
std::copy is calling memmove under the hood, sorry for misunderstaning.
from eve.
@DenisYaroshevskiy are you sure? I do not think so, it must not. The ranges must not overlap, but memmove works with possibly overlapping memory. I think std::copy assumes that a source does not intersect a destination.
From https://en.cppreference.com/w/cpp/algorithm/copy
Copies all elements in the range [first, last) starting from first and proceeding to last.
If d_first is in [first, last), the behavior is undefined. In this case, std::copy_backward may be used instead.
Correct me if I am wrong
from eve.
I believe you are, they can overlap one way. And copy_backward are allowed to overlap the other way
from eve.
Related Issues (20)
- [BUG] References Documentation link is broken HOT 1
- [BUG] Doxygen missing docs (highlighted) HOT 1
- [BUG] RETARGET(cpu_) equivalent for new callalbe apis HOT 2
- [BUG] fix werror in doc.exe HOT 2
- [BUG] Links in README are broken HOT 7
- [BUG] fix doc for relaxed range
- [BUG] max has a bad error message HOT 5
- [BUG] eve::negate does not compile HOT 11
- [FEATURE] MSVC (unit.api.exe) for sse2
- [BUG] _mm256_cvtepu8_epi16 is missing
- [FEATURE] Add requires on multiple argument functions to ensure proper cardinal compatibility HOT 4
- [BENCH REPORT] Some stuff to investigate HOT 1
- Bazel support HOT 4
- [FEATURE] transform_copy_if and friends
- [FEATURE] SIMD-ed Heap HOT 6
- [BUG] CMake version variables not exported correctly HOT 2
- Split the largest unit tests HOT 3
- [FEATURE] Simplify as_register for better compiel time and extensibility
- sve and avx512 masked intrinsics and sve semi-scalar intrinsics HOT 2
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 eve.