[VecOps] Fix #10297. Teach Rvec's to swap small and adopting vectors#10325
[VecOps] Fix #10297. Teach Rvec's to swap small and adopting vectors#10325ikabadzhov merged 5 commits intoroot-project:masterfrom
Conversation
|
Starting build on |
2706247 to
2c1b66e
Compare
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
2c1b66e to
4815719
Compare
|
Starting build on |
eguiraud
left a comment
There was a problem hiding this comment.
The new tests are amazing, thank you very much! The fix looks good to me as well.
Not necessarily for this PR, but it would be good to parameterize the new unit tests so they are all executed once with std::swap and once with swap. It could be done e.g. by writing the test cases value-parameterized tests and implementing, in the fixture, a method or a pointer to function data-member that points to swap or std::swap depending on the true/false value of the parameter.
Some more minor comments below that would be nice to address before merging.
4815719 to
02b520b
Compare
|
Starting build on |
02b520b to
3b600cd
Compare
|
Starting build on |
3b600cd to
70f5fd1
Compare
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Starting build on |
|
Build failed on windows10/cxx14. Errors:
|
There was one combination of vectors that was braking the Rvec's `swap` previously - small and adopting vectors. This case is now fixed.
1a252ca to
9c60bbb
Compare
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Build failed on windows10/cxx14. Errors:
|
|
Build failed on mac11/cxx17. Failing tests: |
Introduce ROOT::Detail::VecOps::IsSmall(v) and ROOT::Detail::VecOps::IsAdopting(v) to check whether an RVec is small and owning its memory respectively.
Possible combinations of vectors to swap: 1. small <-> small 2. regular <-> regular (not small, not adopting) 3. adopting <-> adopting 4. small <-> regular (and vice versa) 5. small <-> adopting (and vice versa) 6. regular <-> adopting (and vice versa)
Added unit test fixture to test both `ROOT::VecOps::swap` and `std::swap`. Co-authored-by: Bernhard Manfred Gruber <[email protected]>
9c60bbb to
d8628e3
Compare
|
Starting build on |
|
Starting build on |
|
Note that every time you make a push the CI build is restarted, I'm not sure if the previous windows build keeps running or gets interrupted. |
It gets interrupted and re-started. And note that it is now successful 🙂 |
Changes or fixes:
Checklist:
This PR fixes #10297