MAOS
Multithreaded Adaptive Optics Simulator
Loading...
Searching...
No Matches
Gpu< T > Class Template Reference
Inheritance diagram for Gpu< T >:
Collaboration diagram for Gpu< T >:

Public Member Functions

void * operator new[] (size_t size)
void operator delete[] (void *p)

Static Public Member Functions

static void Zero (T *p, size_t size, cudaStream_t stream=0)
static void Copy (T *pout, const T *pin, long size, cudaStream_t stream=0)
template<typename S>
static void Copy (T *pout, const S *pin, long size, cudaStream_t stream=0)
static void Write (T *p, long nx, long ny, const char *keywords, file_t *fp, cudaStream_t stream=0)
static void Write (T *p, long nx, long ny, const char *keywords, const char *format,...)

Member Function Documentation

◆ operator new[]()

template<typename T>
void * Gpu< T >::operator new[] ( size_t size)

Allocate zero initialized device memory.

Parameters
[in]sizeNumber of bytes.
Returns
Allocated memory. Freed with delete[].

◆ operator delete[]()

template<typename T>
void Gpu< T >::operator delete[] ( void * p)

Free device memory.

Parameters
[in]pMemory to free.

◆ Zero()

template<typename T>
void Gpu< T >::Zero ( T * p,
size_t size,
cudaStream_t stream = 0 )
static

Zero device memory asynchronously.

Parameters
[out]pMemory to zero. Nothing is done if NULL.
[in]sizeNumber of elements.
[in]streamStream to run in.

◆ Copy() [1/2]

template<typename T>
void Gpu< T >::Copy ( T * pout,
const T * pin,
long size,
cudaStream_t stream = 0 )
static

Copy device memory asynchronously.

Parameters
[out]poutDestination.
[in]pinSource.
[in]sizeNumber of elements.
[in]streamStream to run in.

◆ Copy() [2/2]

template<typename T>
template<typename S>
void Gpu< T >::Copy ( T * pout,
const S * pin,
long size,
cudaStream_t stream = 0 )
static

Copy device memory with type conversion. See copy_do().

Parameters
[out]poutDestination.
[in]pinSource.
[in]sizeNumber of elements.
[in]streamStream to run in.

◆ Write() [1/2]

template<typename T>
void Gpu< T >::Write ( T * p,
long nx,
long ny,
const char * keywords,
file_t * fp,
cudaStream_t stream = 0 )
static

Copy device array to host and write it to file. Synchronizes stream.

Parameters
[in]pDevice array of nx*ny.
[in]nxNumber of rows.
[in]nyNumber of columns.
[in]keywordsHeader keywords. May be NULL.
[in,out]fpFile to write to.
[in]streamStream to copy in.

◆ Write() [2/2]

template<typename T>
void Gpu< T >::Write ( T * p,
long nx,
long ny,
const char * keywords,
const char * format,
... )
static

Copy device array to host and write it to a file named by format.

Parameters
[in]pDevice array of nx*ny.
[in]nxNumber of rows.
[in]nyNumber of columns.
[in]keywordsHeader keywords. May be NULL.
[in]formatprintf style format of the file name, followed by arguments.

The documentation for this class was generated from the following file:
  • cuda/math/types.h