COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
carma_host_obj.h File Reference
#include <carma.h>
#include <carma_context.h>
#include <carma_streams.h>
#include <carma_utils.h>
#include <iostream>
#include <typeinfo>
Include dependency graph for carma_host_obj.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CarmaObj
 this class provides wrappers to the generic carma object More...
 
class  CarmaHostObj< T_data >
 this class provides wrappers to the generic carma host object More...
 

Macros

#define MEMORY_ALIGNMENT   4096
 
#define ALIGN_UP(x, size)   (((size_t)x + (size - 1)) & (~(size - 1)))
 

Enumerations

enum  MemAlloc {
  MA_MALLOC, MA_PAGELOCK, MA_ZEROCPY, MA_PORTABLE,
  MA_WRICOMB, MA_GENEPIN
}
 

Functions

template<class T_data >
std::ostream & operator<< (std::ostream &os, CarmaHostObj< T_data > &obj)
 

Macro Definition Documentation

◆ ALIGN_UP

#define ALIGN_UP (   x,
  size 
)    (((size_t)x + (size - 1)) & (~(size - 1)))

Definition at line 63 of file carma_host_obj.h.

◆ MEMORY_ALIGNMENT

#define MEMORY_ALIGNMENT   4096

Definition at line 62 of file carma_host_obj.h.

Enumeration Type Documentation

◆ MemAlloc

enum MemAlloc
Enumerator
MA_MALLOC 
MA_PAGELOCK 
MA_ZEROCPY 
MA_PORTABLE 
MA_WRICOMB 
MA_GENEPIN 

Definition at line 52 of file carma_host_obj.h.

52  {
53  MA_MALLOC,
55  MA_ZEROCPY,
57  MA_WRICOMB,
59 };

Function Documentation

◆ operator<<()

template<class T_data >
std::ostream& operator<< ( std::ostream &  os,
CarmaHostObj< T_data > &  obj 
)

Definition at line 154 of file carma_host_obj.h.

154  {
155  os << "-----------------------" << std::endl;
156  os << "CarmaHostObj<" << typeid(T_data).name() << "> object" << std::endl;
157  long ndims = obj.get_dims(0);
158  os << "ndims = " << ndims << std::endl;
159  for (long dim = 0; dim < ndims; dim++) {
160  os << "dim[" << dim << "] = " << obj.get_dims(dim + 1) << std::endl;
161  }
162  os << "nbElem = " << obj.get_nb_elements() << std::endl;
163  os << "sizeof(" << typeid(T_data).name() << ") = " << sizeof(T_data)
164  << std::endl;
165  os << "-----------------------" << std::endl;
166  return os;
167 }
Here is the call graph for this function:
MA_MALLOC
@ MA_MALLOC
Definition: carma_host_obj.h:53
CarmaHostObj::get_nb_elements
int get_nb_elements()
Definition: carma_host_obj.h:126
CarmaHostObj::get_dims
const long * get_dims()
Definition: carma_host_obj.h:124
MA_ZEROCPY
@ MA_ZEROCPY
Definition: carma_host_obj.h:55
MA_WRICOMB
@ MA_WRICOMB
Definition: carma_host_obj.h:57
MA_PORTABLE
@ MA_PORTABLE
Definition: carma_host_obj.h:56
MA_PAGELOCK
@ MA_PAGELOCK
Definition: carma_host_obj.h:54
MA_GENEPIN
@ MA_GENEPIN
Definition: carma_host_obj.h:58
layers_test.name
string name
Definition: layers_test.py:21