lanl / spiner

Performance portable routines for generic, tabulated, multi-dimensional data
https://lanl.github.io/spiner
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

resolve get on device edge case #82

Closed Yurlungur closed 11 months ago

Yurlungur commented 11 months ago

PR Summary

@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