@chadmeyer noticed that GetOnDevice on an empty DataBox causes an assertion error related to array sizes. I think this was indicating an edge case in GetOnDevice: the edge case being being that GetOnDevice was attempting to copy memory to device even for unallocated DataBoxes containing no memory.
This PR simply adds a little default code making GetOnDevice a no-op for empty DataBoxes.
PR Checklist
[x] Code is formatted. (You can use the format_spiner make target.)
[x] Adds a test for any bugs fixed. Adds tests for new features.
[ ] If preparing for a new release, update the version in cmake.
PR Summary
@chadmeyer noticed that
GetOnDevice
on an emptyDataBox
causes an assertion error related to array sizes. I think this was indicating an edge case inGetOnDevice
: the edge case being being thatGetOnDevice
was attempting to copy memory to device even for unallocatedDataBox
es containing no memory.This PR simply adds a little default code making
GetOnDevice
a no-op for emptyDataBox
es.PR Checklist