Add non-copying Variables-VectorImpl conversion#7086
Add non-copying Variables-VectorImpl conversion#7086nilsdeppe merged 4 commits intosxs-collaboration:developfrom
Conversation
|
I am at a loss on the CI linker errors: |
|
I have managed to reproduce this in codespaces. To correct my previous comment: this does affect multiple files, it's just that the linker gives up after the first failing one. My best guess as to what's going on at this point is that old gcc versions are miscompiling some piece of code (something with large TaggedTuples, possibly the Tensors in Variables) by failing to either inline or emit this constructor, and just happened to decide to emit it for the Variables data and hide the issue. The best workaround I've found is to add a completely unused unique_ptr in the Variables class, which the compiler apparently decides to emit a default constructor for. |
| CHECK(transferred_back.number_of_grid_points() == num_points); | ||
| CHECK(transferred_back.size() == | ||
| num_points * Vars::number_of_independent_components); | ||
| CHECK(get<TestHelpers::Tags::Scalar<VectorType>>(vars) == orig_scalar); |
There was a problem hiding this comment.
Sorry, I'm confused. Shouldn't this fail because it was moved from on line 1368? I naively would've guessed this is transferred_back instead of vars. Does that mean release is not reseting the pointers inside Tensors? If the code is correct, I think adding a comment as to why would be good.
There was a problem hiding this comment.
This was a copy-paste error. I have corrected it and added a new commit fixing the bug that caused the test to incorrectly pass ("Fix bugs when reducing a Variables's size to 0").
| CHECK(transferred_back.data() != transferred_data); | ||
| CHECK(transferred_back.number_of_grid_points() == 1); | ||
| CHECK(transferred_back.size() == Vars::number_of_independent_components); | ||
| CHECK(get<TestHelpers::Tags::Scalar<VectorType>>(vars) == orig_scalar); |
4c45e88 to
30631b9
Compare
Copies (and allocates in one direction) for single-point variables because of the Variables small-vector optimization, but should otherwise be effectively free.
30631b9 to
f8fd40a
Compare
|
Rebased to pick up CI fixes. |
Proposed changes
Upgrade instructions
Code review checklist
make docto generate the documentation locally intoBUILD_DIR/docs/html.Then open
index.html.code review guide.
bugfixornew featureif appropriate.Further comments