Skip to content

Replace Array external buffer functionality with ArrayView#678

Merged
joshessman-llnl merged 19 commits intodevelopfrom
feature/essman/arrayview
Oct 27, 2021
Merged

Replace Array external buffer functionality with ArrayView#678
joshessman-llnl merged 19 commits intodevelopfrom
feature/essman/arrayview

Conversation

@joshessman-llnl
Copy link
Member

@joshessman-llnl joshessman-llnl commented Oct 13, 2021

Summary

  • This PR is a (refactoring, bugfix, feature, something else)
  • It does the following (modify list as needed):
    • Removes the external buffer constructors from axom::Array
    • Adds an ArrayView class that wraps a pointer with indexing functionality

Possible follow-ups:

  • Supporting "incomplete" indexing that returns an ArrayView - e.g.:
Array<int, 2> arr(3, 3); // 2D array aka matrix
ArrayView<int, 1> first_row = arr(0); // 1D array

@joshessman-llnl joshessman-llnl added the Core Issues related to Axom's 'core' component label Oct 13, 2021
@joshessman-llnl joshessman-llnl mentioned this pull request Oct 13, 2021
20 tasks
Copy link
Member

@kennyweiss kennyweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is coming along really nicely @joshessman-llnl

Apologies if I jumped the gun a bit on this review, but I wanted to add some high-level design thoughts while you're working on this

/// @}

/// \brief Swaps two ArrayBases
void swap(ArrayBase&) { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ArrayBase::swap() empty intentionally, or just not yet implemented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ArrayBase<T, 1> which has no member variables - in the general case though (implemented above) ArrayBase has m_dims and m_strides member variables that would need to be/are swapped.

@joshessman-llnl joshessman-llnl changed the title WIP: Replace Array external buffer functionality with ArrayView Replace Array external buffer functionality with ArrayView Oct 20, 2021
@kennyweiss kennyweiss self-requested a review October 25, 2021 21:26
Copy link
Member

@kennyweiss kennyweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joshessman-llnl !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Issues related to Axom's 'core' component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants