Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
caffe2::CUDAContext Class Referencefinal

Public Member Functions

 CUDAContext (const int gpu_id=-1)
 CUDAContext (const DeviceOption &option)
void SwitchToDevice (int stream_id)
void SwitchToDevice ()
void WaitEvent (const Event &ev)
void Record (Event *ev, const char *err_msg=nullptr) const
void FinishDeviceComputation ()
int cuda_gpu_id () const
cudaStream_t cuda_stream ()
cudaStream_t cuda_stream () const
cublasHandle_t cublas_handle ()
cudnnHandle_t cudnn_handle ()
curandGenerator_t & curand_generator ()
template<class SrcContext , class DstContext >
void CopyBytes (size_t nbytes, const void *src, void *dst)
template<typename T , class SrcContext , class DstContext >
void Copy (int n, const T *src, T *dst)
template<class SrcContext , class DstContext >
void CopyItems (const TypeMeta &meta, size_t n, const void *src, void *dst)

Static Public Member Functions

static cudaStream_t cuda_stream (int gpu_id, int stream_id)
static std::pair< void *, MemoryDeleter > New (size_t nbytes)
static std::mutex & mutex ()
static std::vector< long > TotalMemoryByGpu ()
static std::vector< long > MaxMemoryByGpu ()
static bool HasAsyncPartDefault ()
static bool SupportsAsyncScheduling ()
static bool IsStreamFree (const DeviceOption &option, int stream_id)

Protected Member Functions

void set_stream_id (int stream_id)

Static Protected Member Functions

static void Delete (void *data)

Protected Attributes

int gpu_id_
int stream_id_ = 0
int random_seed_
curandGenerator_t curand_generator_ {nullptr}

Static Protected Attributes

static thread_local ThreadLocalCUDAObjects cuda_objects_

Detailed Description

Definition at line 136 of file context_gpu.h.

The documentation for this class was generated from the following file: