lanl / ports-of-call

Performance Portability Utilities
https://lanl.github.io/ports-of-call/
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Adding generic copy functions to portability header file. #21

Closed dholladay00 closed 1 year ago

dholladay00 commented 1 year ago

PR Summary

This creates portable functions to copy host memory to device and device memory to host, or a simple copy if no portability strategy specified.

This should provide the functionality necessary to address https://github.com/lanl/spiner/issues/54 and #20

PR Checklist

dholladay00 commented 1 year ago

Are the 2-sided const necessary?

The benefit of east const is that it more clearly specifies what is in fact const. The double-sided means that both the pointer is const and the underlying data are const. I'm not sure that it is a strict restriction but this operation should not be modifying either the allocation (underlying pointer) or the data of the from pointer.

Yurlungur commented 1 year ago

I quite like this actually and I'd be supportive of putting it in to ports-of-call as a solution to the generic code in spiner. I think the emphasis on pointers fits nicely with our understanding of what ports-of-call should be.

Curious to hear @chadmeyer 's thoughts too.

dholladay00 commented 1 year ago

I still need to add documentation.

dholladay00 commented 1 year ago

👍 pending added docs

done @Yurlungur