ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
CudaMemWrapper< T > Class Template Reference

#include <cuda_mem_wrapper.h>

Collaboration diagram for CudaMemWrapper< T >:

Public Member Functions

 CudaMemWrapper ()=default
 CudaMemWrapper (const CudaMemWrapper &other)=delete
CudaMemWrapper & operator= (const CudaMemWrapper &other)=delete
 CudaMemWrapper (CudaMemWrapper &&other) noexcept
CudaMemWrapper & operator= (CudaMemWrapper &&other) noexcept
 CudaMemWrapper (size_t size, cudaStream_t stream=0, bool malloc_host=true)
 ~CudaMemWrapper ()
void copy_host_to_device_sync (size_t size)
void copy_host_to_device_sync ()
void copy_host_to_device_async (size_t size)
void copy_host_to_device_async ()
void copy_device_to_host_sync (size_t size)
void copy_device_to_host_sync ()
void copy_device_to_host_async (size_t size)
void copy_device_to_host_async ()
void memset_device_sync (const size_t size, const int value=0)
void memset_device_sync (const int value=0)
void memset_device_async (const size_t size, const int value=0)
void memset_device_async (const int value=0)
void memset_host (const size_t size, const int value=0)
void memset_host (const int value=0)
void free ()
T * get_device_ptr ()
T * get_host_ptr ()
const T * get_device_ptr () const
const T * get_host_ptr () const
size_t get_size () const

Private Attributes

T * device_ptr_ = nullptr
T * host_ptr_ = nullptr
size_t size_ = 0
bool malloc_host_ = false
cudaStream_t stream_ = 0

Constructor & Destructor Documentation

◆ CudaMemWrapper() [1/4]

template<typename T>
CudaMemWrapper< T >::CudaMemWrapper ( )
default
Here is the caller graph for this function:

◆ CudaMemWrapper() [2/4]

template<typename T>
CudaMemWrapper< T >::CudaMemWrapper ( const CudaMemWrapper< T > & other)
delete
Here is the call graph for this function:

◆ CudaMemWrapper() [3/4]

template<typename T>
CudaMemWrapper< T >::CudaMemWrapper ( CudaMemWrapper< T > && other)
inlinenoexcept
Here is the call graph for this function:

◆ CudaMemWrapper() [4/4]

template<typename T>
CudaMemWrapper< T >::CudaMemWrapper ( size_t size,
cudaStream_t stream = 0,
bool malloc_host = true )
inline

◆ ~CudaMemWrapper()

template<typename T>
CudaMemWrapper< T >::~CudaMemWrapper ( )
inline
Here is the call graph for this function:

Member Function Documentation

◆ copy_device_to_host_async() [1/2]

template<typename T>
void CudaMemWrapper< T >::copy_device_to_host_async ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_device_to_host_async() [2/2]

template<typename T>
void CudaMemWrapper< T >::copy_device_to_host_async ( size_t size)
inline
Here is the call graph for this function:

◆ copy_device_to_host_sync() [1/2]

template<typename T>
void CudaMemWrapper< T >::copy_device_to_host_sync ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_device_to_host_sync() [2/2]

template<typename T>
void CudaMemWrapper< T >::copy_device_to_host_sync ( size_t size)
inline
Here is the call graph for this function:

◆ copy_host_to_device_async() [1/2]

template<typename T>
void CudaMemWrapper< T >::copy_host_to_device_async ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_host_to_device_async() [2/2]

template<typename T>
void CudaMemWrapper< T >::copy_host_to_device_async ( size_t size)
inline
Here is the call graph for this function:

◆ copy_host_to_device_sync() [1/2]

template<typename T>
void CudaMemWrapper< T >::copy_host_to_device_sync ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_host_to_device_sync() [2/2]

template<typename T>
void CudaMemWrapper< T >::copy_host_to_device_sync ( size_t size)
inline
Here is the call graph for this function:

◆ free()

template<typename T>
void CudaMemWrapper< T >::free ( )
inline
Here is the caller graph for this function:

◆ get_device_ptr() [1/2]

template<typename T>
T * CudaMemWrapper< T >::get_device_ptr ( )
inline
Here is the caller graph for this function:

◆ get_device_ptr() [2/2]

template<typename T>
const T * CudaMemWrapper< T >::get_device_ptr ( ) const
inline

◆ get_host_ptr() [1/2]

template<typename T>
T * CudaMemWrapper< T >::get_host_ptr ( )
inline

◆ get_host_ptr() [2/2]

template<typename T>
const T * CudaMemWrapper< T >::get_host_ptr ( ) const
inline

◆ get_size()

template<typename T>
size_t CudaMemWrapper< T >::get_size ( ) const
inline

◆ memset_device_async() [1/2]

template<typename T>
void CudaMemWrapper< T >::memset_device_async ( const int value = 0)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ memset_device_async() [2/2]

template<typename T>
void CudaMemWrapper< T >::memset_device_async ( const size_t size,
const int value = 0 )
inline

◆ memset_device_sync() [1/2]

template<typename T>
void CudaMemWrapper< T >::memset_device_sync ( const int value = 0)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ memset_device_sync() [2/2]

template<typename T>
void CudaMemWrapper< T >::memset_device_sync ( const size_t size,
const int value = 0 )
inline

◆ memset_host() [1/2]

template<typename T>
void CudaMemWrapper< T >::memset_host ( const int value = 0)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ memset_host() [2/2]

template<typename T>
void CudaMemWrapper< T >::memset_host ( const size_t size,
const int value = 0 )
inline
Here is the call graph for this function:

◆ operator=() [1/2]

template<typename T>
CudaMemWrapper & CudaMemWrapper< T >::operator= ( const CudaMemWrapper< T > & other)
delete
Here is the call graph for this function:

◆ operator=() [2/2]

template<typename T>
CudaMemWrapper & CudaMemWrapper< T >::operator= ( CudaMemWrapper< T > && other)
inlinenoexcept
Here is the call graph for this function:

Member Data Documentation

◆ device_ptr_

template<typename T>
T* CudaMemWrapper< T >::device_ptr_ = nullptr
private

◆ host_ptr_

template<typename T>
T* CudaMemWrapper< T >::host_ptr_ = nullptr
private

◆ malloc_host_

template<typename T>
bool CudaMemWrapper< T >::malloc_host_ = false
private

◆ size_

template<typename T>
size_t CudaMemWrapper< T >::size_ = 0
private

◆ stream_

template<typename T>
cudaStream_t CudaMemWrapper< T >::stream_ = 0
private

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