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

Remove uses of ManagedArray::getActiveBasePointer #312

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

adayton1
Copy link
Member

@adayton1 adayton1 commented Feb 6, 2025

ManagedArray::getActiveBasePointer will be removed from CHAI soon, so preparing for that update.

@adayton1 adayton1 requested review from liu15 and dtaller February 6, 2025 19:24
if (size > 1) {
// Bounds checking is only available with the resource manager because the ManagedArray::size() is not
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 no longer true - ManagedArray::size() always works now.

bool warned = false;

if (dataSize < size) {
const char* dataName = CHAICallback::getName(dataRecord);
Copy link
Member Author

Choose a reason for hiding this comment

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

The name isn't that important now that we have a backtrace.

warned = true;
}

if (!inPlace) {
const chai::PointerRecord* outDataRecord = chai::ArrayManager::getInstance()->getPointerRecord((void *)outData.data(chai::ExecutionSpace::CPU, false));
int outDataSize = dataRecord->m_size/sizeof(T);
Copy link
Member Author

Choose a reason for hiding this comment

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

Also note that outDataSize was actually wrong (it should have been pulled from outDataRecord).

@adayton1 adayton1 merged commit 3777d4e into develop Feb 6, 2025
7 checks passed
@adayton1 adayton1 deleted the feature/dayton8/rm_functions branch February 6, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants