NanoVDB: default Mask's copy constructor - #2310
Merged
kmuseth merged 1 commit intoSep 3, 2026
Merged
Conversation
Mask's only data member is uint64_t mWords[WORD_COUNT], and the hand-written copy constructor's loop copies exactly that range, so it duplicates the implicit memberwise copy. Defaulting it leaves the semantics unchanged and makes Mask trivially copyable, matching the copy assignment operator defaulted immediately below it. Signed-off-by: Efty Sifakis <esifakis@nvidia.com>
sifakis
marked this pull request as ready for review
September 2, 2026 22:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mask's only data member isuint64_t mWords[WORD_COUNT], and the hand-written copyconstructor's loop copies exactly that range — so it duplicates the implicit memberwise copy.
Defaulting it leaves the semantics unchanged and makes
Masktrivially copyable.sizeofandstandard-layout are unaffected.
Note:
= default; this just finishesthe pair.
nanovdb::cuda::Buffer<T, R>requiresstd::is_trivially_copyable<T>, soMaskcurrentlycannot be a buffer element type. With this change, mask sidecars can be held in a typed
Buffer<Mask<N>>rather than aBuffer<std::byte>plus a cast.Verification
is_trivially_copyablebecomes true forMask<3>/Mask<4>/Mask<5>;sizeof(64/512/4096)and
is_standard_layoutare unchanged.implicitly
__host__ __device__, as the already-defaultedoperator=beside it relies on).