COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
CarmaDevice Class Reference

#include <carma_context.h>

Collaboration diagram for CarmaDevice:

Public Member Functions

 CarmaDevice (int devid)
 
int set_cublas_math_mode (bool tensor)
 
 ~CarmaDevice ()
 
cudaStream_t get_stream ()
 
int get_id ()
 
cudaDeviceProp get_properties ()
 
float get_compute_perf ()
 
float get_cores_per_sm ()
 
bool is_gpu_capable_p2p ()
 
bool is_p2p_activate ()
 
std::string get_name ()
 
size_t get_total_mem ()
 
size_t get_free_mem ()
 
cublasHandle_t get_cublas_handle ()
 
cusparseHandle_t get_cusparse_handle ()
 

Protected Attributes

int id
 
cudaDeviceProp properties
 
float compute_perf
 
float cores_per_sm
 
bool p2p_activate
 
size_t free_mem
 
size_t total_mem
 
cublasHandle_t cublas_handle
 
cusparseHandle_t cusparse_handle
 
cudaStream_t main_stream
 

Detailed Description

Definition at line 57 of file carma_context.h.

Constructor & Destructor Documentation

◆ CarmaDevice()

CarmaDevice::CarmaDevice ( int  devid)

◆ ~CarmaDevice()

CarmaDevice::~CarmaDevice ( )

Member Function Documentation

◆ get_compute_perf()

float CarmaDevice::get_compute_perf ( )

Definition at line 79 of file carma_context.h.

79 { return compute_perf; }

◆ get_cores_per_sm()

float CarmaDevice::get_cores_per_sm ( )

Definition at line 80 of file carma_context.h.

80 { return cores_per_sm; }

◆ get_cublas_handle()

cublasHandle_t CarmaDevice::get_cublas_handle ( )

Definition at line 93 of file carma_context.h.

93 { return cublas_handle; }

◆ get_cusparse_handle()

cusparseHandle_t CarmaDevice::get_cusparse_handle ( )

Definition at line 94 of file carma_context.h.

94 { return cusparse_handle; }

◆ get_free_mem()

size_t CarmaDevice::get_free_mem ( )

Definition at line 88 of file carma_context.h.

88  {
89  carma_safe_call(cudaMemGetInfo(&total_mem, &total_mem));
90  return total_mem;
91  }

◆ get_id()

int CarmaDevice::get_id ( )

Definition at line 77 of file carma_context.h.

77 { return id; }

◆ get_name()

std::string CarmaDevice::get_name ( )

Definition at line 85 of file carma_context.h.

85 { return properties.name; }

◆ get_properties()

cudaDeviceProp CarmaDevice::get_properties ( )

Definition at line 78 of file carma_context.h.

78 { return properties; }

◆ get_stream()

cudaStream_t CarmaDevice::get_stream ( )

Definition at line 76 of file carma_context.h.

76 { return main_stream; }

◆ get_total_mem()

size_t CarmaDevice::get_total_mem ( )

Definition at line 87 of file carma_context.h.

87 { return total_mem; }

◆ is_gpu_capable_p2p()

bool CarmaDevice::is_gpu_capable_p2p ( )

Definition at line 81 of file carma_context.h.

81 { return (bool)(properties.major >= 2); }

◆ is_p2p_activate()

bool CarmaDevice::is_p2p_activate ( )

Definition at line 83 of file carma_context.h.

83 { return p2p_activate; }

◆ set_cublas_math_mode()

int CarmaDevice::set_cublas_math_mode ( bool  tensor)

Member Data Documentation

◆ compute_perf

float CarmaDevice::compute_perf
protected

Definition at line 61 of file carma_context.h.

◆ cores_per_sm

float CarmaDevice::cores_per_sm
protected

Definition at line 62 of file carma_context.h.

◆ cublas_handle

cublasHandle_t CarmaDevice::cublas_handle
protected

Definition at line 67 of file carma_context.h.

◆ cusparse_handle

cusparseHandle_t CarmaDevice::cusparse_handle
protected

Definition at line 68 of file carma_context.h.

◆ free_mem

size_t CarmaDevice::free_mem
protected

Definition at line 64 of file carma_context.h.

◆ id

int CarmaDevice::id
protected

Definition at line 59 of file carma_context.h.

◆ main_stream

cudaStream_t CarmaDevice::main_stream
protected

Definition at line 69 of file carma_context.h.

◆ p2p_activate

bool CarmaDevice::p2p_activate
protected

Definition at line 63 of file carma_context.h.

◆ properties

cudaDeviceProp CarmaDevice::properties
protected

Definition at line 60 of file carma_context.h.

◆ total_mem

size_t CarmaDevice::total_mem
protected

Definition at line 65 of file carma_context.h.


The documentation for this class was generated from the following file:
CarmaDevice::total_mem
size_t total_mem
Definition: carma_context.h:65
carma_safe_call
#define carma_safe_call(err)
Definition: carma_utils.h:145
CarmaDevice::id
int id
Definition: carma_context.h:59
CarmaDevice::main_stream
cudaStream_t main_stream
Definition: carma_context.h:69
CarmaDevice::compute_perf
float compute_perf
Definition: carma_context.h:61
CarmaDevice::properties
cudaDeviceProp properties
Definition: carma_context.h:60
CarmaDevice::cublas_handle
cublasHandle_t cublas_handle
Definition: carma_context.h:67
CarmaDevice::cusparse_handle
cusparseHandle_t cusparse_handle
Definition: carma_context.h:68
CarmaDevice::p2p_activate
bool p2p_activate
Definition: carma_context.h:63
CarmaDevice::cores_per_sm
float cores_per_sm
Definition: carma_context.h:62