Class CudaMgr_Namespace::CudaMgr

class CudaMgr

Public Functions

CudaMgr(const int num_gpus, const int start_gpu = 0)
~CudaMgr()
void synchronizeDevices() const
int getDeviceCount() const
int getStartGpu() const
const omnisci::DeviceGroup &getDeviceGroup() const
void copyHostToDevice(int8_t *device_ptr, const int8_t *host_ptr, const size_t num_bytes, const int device_num)
void copyDeviceToHost(int8_t *host_ptr, const int8_t *device_ptr, const size_t num_bytes, const int device_num)
void copyDeviceToDevice(int8_t *dest_ptr, int8_t *src_ptr, const size_t num_bytes, const int dest_device_num, const int src_device_num)
int8_t *allocatePinnedHostMem(const size_t num_bytes)
int8_t *allocateDeviceMem(const size_t num_bytes, const int device_num)
void freePinnedHostMem(int8_t *host_ptr)
void freeDeviceMem(int8_t *device_ptr)
void zeroDeviceMem(int8_t *device_ptr, const size_t num_bytes, const int device_num)
void setDeviceMem(int8_t *device_ptr, const unsigned char uc, const size_t num_bytes, const int device_num)
size_t getMinSharedMemoryPerBlockForAllDevices() const
size_t getMinNumMPsForAllDevices() const
const std::vector<DeviceProperties> &getAllDeviceProperties() const
const DeviceProperties *getDeviceProperties(const size_t device_num) const
bool isArchMaxwell() const
bool isArchMaxwellOrLater() const
bool isArchPascal() const
bool isArchPascalOrLater() const
bool isArchMaxwellOrLaterForAll() const

Returns true if all devices have Maxwell micro-architecture, or later. Returns false, if there is any device with compute capability of < 5.0

bool isArchVoltaOrGreaterForAll() const

Returns true if all devices have Volta micro-architecture Returns false, if there is any non-Volta device available.

NvidiaDeviceArch getDeviceArch() const
void setContext(const int device_num) const

Public Static Functions

static std::string deviceArchToSM(const NvidiaDeviceArch arch)

Private Members

int device_count_
int start_gpu_
size_t min_shared_memory_per_block_for_all_devices
size_t min_num_mps_for_all_devices
std::vector<DeviceProperties> device_properties_
omnisci::DeviceGroup device_group_
std::vector<CUcontext> device_contexts_
std::mutex device_cleanup_mutex_