Skip to content
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

Restore getActiveBasePointer #303

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ The format of this file is based on [Keep a Changelog](http://keepachangelog.com
- Now respects allocators passed to ManagedArray constructors when CHAI\_DISABLE\_RM=TRUE.

### Removed
- Removes ManagedArray::getActiveBasePointer method.
- Removes deprecated ManagedArray::getPointer method. Use ManagedArray::data instead.
- Removes ManagedArray::incr and ManagedArray::decr methods. Use ManagedArray::pick and ManagedArray::set instead.
- Removes optional support for implicitly casting between raw pointers and ManagedArrays (CHAI\_ENABLE\_IMPLICIT\_CONVERSIONS). Use makeManagedArray and ManagedArray::data to perform explicit conversions instead.
Expand Down
12 changes: 12 additions & 0 deletions src/chai/ManagedArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ class ManagedArray : public CHAICopyable
template <typename Idx>
CHAI_HOST_DEVICE T& operator[](const Idx i) const;

/*!
* \brief get access to m_active_base_pointer
* @return a copy of m_active_base_pointer
*/
CHAI_HOST_DEVICE T* getActiveBasePointer() const;

/*!
* \brief get access to m_active_pointer
* @return a copy of m_active_pointer
Expand Down Expand Up @@ -474,6 +480,12 @@ ManagedArray<T> makeManagedArray(T* data,
return array;
}

template <typename T>
CHAI_HOST_DEVICE T* ManagedArray<T>::getActiveBasePointer() const
{
return m_active_base_pointer;
}

template <typename T>
CHAI_HOST_DEVICE T* ManagedArray<T>::getActivePointer() const
{
Expand Down