You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently pyamgx.Vector has the method download( ) for numpy arrays, and download_raw( ) for raw pointers (possibly on GPU?) Raw pointers are rather difficult to use. I hope that a generic interface can be implemented for the Vector.download( ) method, which can download data either to a numpy array variable, or a cupy array variable, just like the Vector.upload( ) method and the Matrix.upload( ) method. Many thanks!
The text was updated successfully, but these errors were encountered:
A single API for copying to both host and device is a bit confusing. What do you think about distinct download_host and download_device functions?
classVector:
defdownload_host(self, out: np.ndarray=None):
"""Copies the contents of the vector to the given NumPy array `out`. If `out` is not given, a new NumPy array is returned """passdefdownload_device(self, out: cp.ndarray=None):
"""Copies the contents of the vector to the given CuPy array `out`. If `out` is not given, a new CuPy array is returned """pass
Yes, this should work. Thanks a lot!
I agree that a single download for both host and device is confusing. The current download_raw is a bit primitive.
On Mar 1, 2021, at 6:36 PM, Ashwin Srinath <[email protected]> wrote:
A single API for both host and device is a bit confusing. What do you think about distinct download_host and download_device functions?
class Vector:
def download_host(self, out: np.ndarray=None):
"""Copies the contents of the vector to the given NumPy array `out`.
If `out` is not given, a new NumPy array is returned
"""
pass
def download_device(self, out: cp.ndarray=None):
"""Copies the contents of the vector to the given CuPy array `out`.
If `out` is not given, a new CuPy array is returned
"""
pass
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#26 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA75WFFG44FA6BVY7Z6S7ILTBQQHHANCNFSM4XJPT2IQ>.
Currently pyamgx.Vector has the method download( ) for numpy arrays, and download_raw( ) for raw pointers (possibly on GPU?) Raw pointers are rather difficult to use. I hope that a generic interface can be implemented for the Vector.download( ) method, which can download data either to a numpy array variable, or a cupy array variable, just like the Vector.upload( ) method and the Matrix.upload( ) method. Many thanks!
The text was updated successfully, but these errors were encountered: