Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public 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 ()
 
bool FinishDeviceComputation ()
 
int cuda_gpu_id () const
 
cudaStream_t cuda_stream ()
 
cudaStream_t cuda_stream () const
 
cublasHandle_t cublas_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)
 
void set_stream_id (int stream_id)
 

Static Public Member Functions

static cudaStream_t cuda_stream (int gpu_id, int stream_id)
 
static void * New (size_t nbytes)
 
static void Delete (void *data)
 
static std::mutex & mutex ()
 

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 99 of file context_gpu.h.


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