HMLP: High-performance Machine Learning Primitives
hmlp::DeviceMemory< T > Class Template Reference

Public Member Functions

 DeviceMemory ()
 
void CacheD (hmlp::Device *dev, size_t size)
 
void AllocateD (hmlp::Device *dev, size_t size)
 
void FreeD (hmlp::Device *dev, size_t size)
 
void PrefetchH2D (hmlp::Device *dev, int stream_id, size_t size, T *ptr_h)
 
void PrefetchD2H (hmlp::Device *dev, int stream_id, size_t size, T *ptr_h)
 
void FetchH2D (hmlp::Device *dev, size_t size, T *ptr_h)
 
void FetchD2H (hmlp::Device *dev, size_t size, T *ptr_h)
 
void Wait (hmlp::Device *dev, int stream_id)
 
template<bool OVERWRITE>
void Redistribute (hmlp::Device *dev)
 
bool is_up_to_date (hmlp::Device *dev)
 
T * device_data (hmlp::Device *dev)
 

Constructor & Destructor Documentation

template<class T >
hmlp::DeviceMemory< T >::DeviceMemory ( )
inline

allow other instance to access device_map

Member Function Documentation

template<class T >
void hmlp::DeviceMemory< T >::AllocateD ( hmlp::Device dev,
size_t  size 
)
inline

this will be the cache of target

template<class T >
void hmlp::DeviceMemory< T >::CacheD ( hmlp::Device dev,
size_t  size 
)
inline

request a new cache location on the device

template<class T >
void hmlp::DeviceMemory< T >::FreeD ( hmlp::Device dev,
size_t  size 
)
inline

free device memory, remove from the map and the distribution

template<class T >
void hmlp::DeviceMemory< T >::PrefetchD2H ( hmlp::Device dev,
int  stream_id,
size_t  size,
T *  ptr_h 
)
inline

if host does not have the latest copy

the host has the latest copy

template<class T >
void hmlp::DeviceMemory< T >::PrefetchH2D ( hmlp::Device dev,
int  stream_id,
size_t  size,
T *  ptr_h 
)
inline

TODO need to be careful about the definition here.

TODO: maybe update the distribution here?

the device has the latest copy

template<class T >
template<bool OVERWRITE>
void hmlp::DeviceMemory< T >::Redistribute ( hmlp::Device dev)
inline

Redistribute() changes the data distribution by adding an new device to the distribution or flushing the distribution if we force to OVERWRITE the distribution.


The documentation for this class was generated from the following file: