Add experimental HostArrayManager#351
Merged
Merged
Conversation
liu15
approved these changes
Jan 23, 2026
dtaller
reviewed
Jan 23, 2026
dtaller
approved these changes
Jan 23, 2026
This was referenced Jun 4, 2026
Closed
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.
This class is the experimental replacement for the thin host only logic contained in ManagedArray.
This class manages a host array. It is designed for use with ManagedArrayPointer.
HostArrayManager performs value initialization of each array element. That is to say, numeric types will be initialized to zero and nontrivial types will be default constructed. In the future, this behavior may change to default initialization for performance reasons, such that numeric types will be left in an indeterminate state and nontrivial types will be default constructed.
HostArrayManager does not rely on ContextManager, so it will behave differently than other array managers. The major difference is that when used with ManagedArrayPointer, the ManagedArrayPointer does not need the update method called or to be copy constructed before it can be used on the host. Since it will not respect the current Context, be extra careful to avoid using it on the device.
Also note that the implementation of ManagedArrayPointer changed slightly since it was determined that the managers need to be templated on ElementType (for correct initialization of the underlying arrays).
Another slight change is that one of the ManagedArrayPointer constructors changed from taking a pointer to taking the Manager by value. If used with temporaries, no deep copies will be performed.
Also adds a factory function called
maketo ManagedArrayPointer.