New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deep_copy(UnorderedMap) acts like assignment from create_mirror_view_and_copy #5924
Comments
@PhilMiller: I think I see how to rewrite the UnorderedMap deep copy specialization. Just to confirm we're on the same page: for the handful of UnorderedMap internal members that are of type Kokkos::View, the UnorderedMap deep copy specialization must allocate new views before calling deep copy on those internal members, correct? |
No it is kinda weird that it does. I can somewhat understand why since the unordered map grows somewhat dynamically internally, but the idea is to make it behave more like normal views. |
In For I propose that we address this bug as follows:
|
Language-wise, the signature for a copy constructor is So instead of copy constructors, I assume you mean four templated constructors to do the copying, sometimes calling the actual copy constructor (when the source and destination template parameters match, assuming the signature takes it by I think we are just clearer with named functions. Mixing templated and non-templated functions, especially constructors, is error-prone. |
From today's meeting, one possibility considered was to introduce a new name for the current functionality, reflecting that it's more complicated than other The tension this issue faces is the incongruity between a consistency that users expect, of "I modified a data structure in one memory space, and I need the modified contents in another, so I'll The ultimate conclusion was that more consideration is necessary to decide how to move forward, but the current functionality definitely needs to be available. |
@ajpowelsnl, @PhilMiller, @nliber, @crtrott: Thanks for bringing this discussion up again and noting it here.
Does this mean that it was decided to not deprecate the behavior of Having thought about this more now I vote for:
|
@e10harvey - your approach sounds good. In particular, please focus on these steps: TODO:
|
Hi @e10harvey - I added this issue to the Kokkos Planning Board. Can you update the issue, and perhaps guesstimate and ETA ? |
@tcclevenger -- any updates on this fix / improvement? |
@ajpowelsnl PR #6812 open but needs more reviews. |
Describe the bug
For most Kokkos container types,
deep_copy
between instances expects arguments of equal size, copes the contents from the source to the destination, and makes no changes to metadata or allocations. The specialization forUnorderedMap
breaks this practice, by assigning new underlying View instances into place in the destination, and then copying into those.The text was updated successfully, but these errors were encountered: