Skip to content

Conversation

@dpgrote
Copy link
Contributor

@dpgrote dpgrote commented May 2, 2025

Previously, setitem was only checking for numpy arrays, which was causing errors on a GPU when a cupy array was passed in. This fix makes it more flexible, so now lists can also be used for example.

Also, when using GPU, the input value must be converted to a cupy array before the copy can be done.

A minor cleanup of _get_field is also done, simplifying the code.

@dpgrote dpgrote changed the title In MultiFab setattr, check if input is a scalar Fixes in MultiFab setitem May 2, 2025
@RevathiJambunathan
Copy link
Contributor

Thank you @dpgrote for this PR!!

@atmyers atmyers merged commit 4328ede into AMReX-Codes:development May 3, 2025
17 checks passed
@dpgrote dpgrote deleted the fix_multifab_setattr_gpu branch May 5, 2025 17:12
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