COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
CarmaHostObj< T_data > Class Template Reference

this class provides wrappers to the generic carma host object More...

#include <carma_host_obj.h>

Inheritance diagram for CarmaHostObj< T_data >:
Collaboration diagram for CarmaHostObj< T_data >:

Public Member Functions

 CarmaHostObj (const long *dims_data)
 
 CarmaHostObj (const long *dims_data, MemAlloc malloc_type)
 
 CarmaHostObj (const CarmaHostObj< T_data > *obj)
 
 CarmaHostObj (const CarmaHostObj< T_data > *obj, MemAlloc malloc_type)
 
 CarmaHostObj (const long *dims_data, const T_data *data)
 
 CarmaHostObj (const long *dims_data, const T_data *data, MemAlloc malloc_type)
 
 CarmaHostObj (const long *dims_data, int nb_streams)
 
 CarmaHostObj (const long *dims_data, MemAlloc malloc_type, int nb_streams)
 
 CarmaHostObj (const CarmaHostObj< T_data > *obj, int nb_streams)
 
 CarmaHostObj (const CarmaHostObj< T_data > *obj, MemAlloc malloc_type, int nb_streams)
 
 CarmaHostObj (const long *dims_data, const T_data *data, int nb_streams)
 
 CarmaHostObj (const long *dims_data, const T_data *data, MemAlloc malloc_type, int nb_streams)
 
 ~CarmaHostObj ()
 
void get_devpntr (void **pntr_dev)
 
int get_nb_streams ()
 
int add_stream ()
 
int add_stream (int nb)
 
int del_stream ()
 
int del_stream (int nb)
 
cudaStream_t get_cuda_stream (int stream)
 
int wait_stream (int stream)
 
int wait_all_streams ()
 
int cpy_obj (CarmaObj< T_data > *carma_obj, cudaMemcpyKind flag)
 
int cpy_obj (CarmaObj< T_data > *carma_obj, cudaMemcpyKind flag, unsigned int stream)
 
 operator T_data * ()
 
 operator std::string ()
 
char const * c_str ()
 
T_data & operator[] (int index)
 
T_data * get_data ()
 
T_data * get_data_at (int index)
 
const long * get_dims ()
 
long get_dims (int i)
 
int get_nb_elements ()
 
int fill_from (const T_data *data)
 
int fill_into (T_data *data)
 
int fill (T_data value)
 
std::string get_mem_alloc ()
 

Protected Member Functions

void init (const long *dims_data, const T_data *data, MemAlloc malloc_type, int nb_streams)
 

Protected Attributes

T_data * h_data
 Input data. More...
 
T_data * data_UA
 unpadded input dara for generic pinned mem More...
 
long * dims_data
 dimensions of the array More...
 
int nb_elem
 number of elments in the array More...
 
MemAlloc malloc_type
 type of host alloc More...
 
CarmaStreamsstreams
 

Detailed Description

template<class T_data>
class CarmaHostObj< T_data >

this class provides wrappers to the generic carma host object

Author
COMPASS Team https://github.com/ANR-COMPASS
Version
5.0.0
Date
2011/01/28

Definition at line 68 of file carma_host_obj.h.

Constructor & Destructor Documentation

◆ CarmaHostObj() [1/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data)

◆ CarmaHostObj() [2/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data,
MemAlloc  malloc_type 
)

◆ CarmaHostObj() [3/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const CarmaHostObj< T_data > *  obj)

◆ CarmaHostObj() [4/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const CarmaHostObj< T_data > *  obj,
MemAlloc  malloc_type 
)

◆ CarmaHostObj() [5/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data,
const T_data *  data 
)

◆ CarmaHostObj() [6/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data,
const T_data *  data,
MemAlloc  malloc_type 
)

◆ CarmaHostObj() [7/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data,
int  nb_streams 
)

◆ CarmaHostObj() [8/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data,
MemAlloc  malloc_type,
int  nb_streams 
)

◆ CarmaHostObj() [9/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const CarmaHostObj< T_data > *  obj,
int  nb_streams 
)

◆ CarmaHostObj() [10/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const CarmaHostObj< T_data > *  obj,
MemAlloc  malloc_type,
int  nb_streams 
)

◆ CarmaHostObj() [11/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data,
const T_data *  data,
int  nb_streams 
)

◆ CarmaHostObj() [12/12]

template<class T_data >
CarmaHostObj< T_data >::CarmaHostObj ( const long *  dims_data,
const T_data *  data,
MemAlloc  malloc_type,
int  nb_streams 
)

◆ ~CarmaHostObj()

template<class T_data >
CarmaHostObj< T_data >::~CarmaHostObj ( )

Member Function Documentation

◆ add_stream() [1/2]

template<class T_data >
int CarmaHostObj< T_data >::add_stream ( )

◆ add_stream() [2/2]

template<class T_data >
int CarmaHostObj< T_data >::add_stream ( int  nb)

◆ c_str()

template<class T_data >
char const* CarmaHostObj< T_data >::c_str ( )

Definition at line 120 of file carma_host_obj.h.

120 { return std::string(*this).c_str(); }

◆ cpy_obj() [1/2]

template<class T_data >
int CarmaHostObj< T_data >::cpy_obj ( CarmaObj< T_data > *  carma_obj,
cudaMemcpyKind  flag 
)

◆ cpy_obj() [2/2]

template<class T_data >
int CarmaHostObj< T_data >::cpy_obj ( CarmaObj< T_data > *  carma_obj,
cudaMemcpyKind  flag,
unsigned int  stream 
)

General Utilities

◆ del_stream() [1/2]

template<class T_data >
int CarmaHostObj< T_data >::del_stream ( )

◆ del_stream() [2/2]

template<class T_data >
int CarmaHostObj< T_data >::del_stream ( int  nb)

◆ fill()

template<class T_data >
int CarmaHostObj< T_data >::fill ( T_data  value)

◆ fill_from()

template<class T_data >
int CarmaHostObj< T_data >::fill_from ( const T_data *  data)

◆ fill_into()

template<class T_data >
int CarmaHostObj< T_data >::fill_into ( T_data *  data)

◆ get_cuda_stream()

template<class T_data >
cudaStream_t CarmaHostObj< T_data >::get_cuda_stream ( int  stream)

◆ get_data()

template<class T_data >
T_data* CarmaHostObj< T_data >::get_data ( )

Definition at line 122 of file carma_host_obj.h.

122 { return h_data; }

◆ get_data_at()

template<class T_data >
T_data* CarmaHostObj< T_data >::get_data_at ( int  index)

Definition at line 123 of file carma_host_obj.h.

123 { return &h_data[index]; }

◆ get_devpntr()

template<class T_data >
void CarmaHostObj< T_data >::get_devpntr ( void **  pntr_dev)

◆ get_dims() [1/2]

template<class T_data >
const long* CarmaHostObj< T_data >::get_dims ( )

Definition at line 124 of file carma_host_obj.h.

124 { return dims_data; }
Here is the caller graph for this function:

◆ get_dims() [2/2]

template<class T_data >
long CarmaHostObj< T_data >::get_dims ( int  i)

Definition at line 125 of file carma_host_obj.h.

125 { return dims_data[i]; }

◆ get_mem_alloc()

template<class T_data >
std::string CarmaHostObj< T_data >::get_mem_alloc ( )

Definition at line 133 of file carma_host_obj.h.

133  {
134  switch (malloc_type) {
135  case MA_MALLOC:
136  return "MA_MALLOC";
137  case MA_PAGELOCK:
138  return "MA_PAGELOCK";
139  case MA_ZEROCPY:
140  return "MA_ZEROCPY";
141  case MA_PORTABLE:
142  return "MA_PORTABLE";
143  case MA_WRICOMB:
144  return "MA_WRICOMB";
145  case MA_GENEPIN:
146  return "MA_GENEPIN";
147  default:
148  return "MA_UNKNOWN";
149  }
150  }

◆ get_nb_elements()

template<class T_data >
int CarmaHostObj< T_data >::get_nb_elements ( )

Memory transfer

Definition at line 126 of file carma_host_obj.h.

Here is the caller graph for this function:

◆ get_nb_streams()

template<class T_data >
int CarmaHostObj< T_data >::get_nb_streams ( )

◆ init()

template<class T_data >
void CarmaHostObj< T_data >::init ( const long *  dims_data,
const T_data *  data,
MemAlloc  malloc_type,
int  nb_streams 
)
protected

◆ operator std::string()

template<class T_data >
CarmaHostObj< T_data >::operator std::string ( )

Definition at line 115 of file carma_host_obj.h.

115  {
116  std::ostringstream stream;
117  stream << *this;
118  return stream.str();
119  }

◆ operator T_data *()

template<class T_data >
CarmaHostObj< T_data >::operator T_data * ( )

Definition at line 114 of file carma_host_obj.h.

114 { return h_data; }

◆ operator[]()

template<class T_data >
T_data& CarmaHostObj< T_data >::operator[] ( int  index)

Definition at line 121 of file carma_host_obj.h.

121 { return h_data[index]; }

◆ wait_all_streams()

template<class T_data >
int CarmaHostObj< T_data >::wait_all_streams ( )

◆ wait_stream()

template<class T_data >
int CarmaHostObj< T_data >::wait_stream ( int  stream)

Member Data Documentation

◆ data_UA

template<class T_data >
T_data* CarmaHostObj< T_data >::data_UA
protected

unpadded input dara for generic pinned mem

Definition at line 71 of file carma_host_obj.h.

◆ dims_data

template<class T_data >
long* CarmaHostObj< T_data >::dims_data
protected

dimensions of the array

Definition at line 72 of file carma_host_obj.h.

◆ h_data

template<class T_data >
T_data* CarmaHostObj< T_data >::h_data
protected

Input data.

Definition at line 70 of file carma_host_obj.h.

◆ malloc_type

template<class T_data >
MemAlloc CarmaHostObj< T_data >::malloc_type
protected

type of host alloc

Definition at line 74 of file carma_host_obj.h.

◆ nb_elem

template<class T_data >
int CarmaHostObj< T_data >::nb_elem
protected

number of elments in the array

Definition at line 73 of file carma_host_obj.h.

◆ streams

template<class T_data >
CarmaStreams* CarmaHostObj< T_data >::streams
protected

Definition at line 75 of file carma_host_obj.h.


The documentation for this class was generated from the following file:
MA_MALLOC
@ MA_MALLOC
Definition: carma_host_obj.h:53
MA_ZEROCPY
@ MA_ZEROCPY
Definition: carma_host_obj.h:55
MA_WRICOMB
@ MA_WRICOMB
Definition: carma_host_obj.h:57
debug_pyr.index
int index
Definition: debug_pyr.py:78
MA_PORTABLE
@ MA_PORTABLE
Definition: carma_host_obj.h:56
CarmaHostObj::malloc_type
MemAlloc malloc_type
type of host alloc
Definition: carma_host_obj.h:74
MA_PAGELOCK
@ MA_PAGELOCK
Definition: carma_host_obj.h:54
CarmaHostObj::dims_data
long * dims_data
dimensions of the array
Definition: carma_host_obj.h:72
MA_GENEPIN
@ MA_GENEPIN
Definition: carma_host_obj.h:58
CarmaHostObj::h_data
T_data * h_data
Input data.
Definition: carma_host_obj.h:70
layers_test.i
int i
Definition: layers_test.py:43