Caffe2 - C++ API
A deep learning, cross platform ML framework
Data Structures | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
caffe2::MIOPENWrapper Class Reference

MIOPENWrapper is a class that wraps the miopen handles and miopen workspaces. More...

#include <miopen_wrapper.h>

Data Structures

struct  SyncedMIOPENState
 

Public Member Functions

 MIOPENWrapper (HIPContext *context)
 Creates a miopen wrapper associated with a HIPContext object. More...
 
miopenHandle_t inline_miopen_handle ()
 Returns the inline miopen handle that executes on the current thread's hip_stream.
 
template<typename F >
void with_miopen_state (size_t state_idx, F &&f)
 

Protected Types

using PerGPUMIOPENStates = std::array< std::array< SyncedMIOPENState, CAFFE2_COMPILE_TIME_MAX_MIOPEN_STATES >, C10_COMPILE_TIME_MAX_GPUS >
 

Protected Member Functions

 C10_DISABLE_COPY_AND_ASSIGN (MIOPENWrapper)
 

Static Protected Member Functions

static PerGPUMIOPENStates & miopen_states ()
 

Protected Attributes

HIPContext * context_
 

Static Protected Attributes

static constexpr size_t CAFFE2_COMPILE_TIME_MAX_MIOPEN_STATES = 4
 

Detailed Description

MIOPENWrapper is a class that wraps the miopen handles and miopen workspaces.

The wrapper ensures that for each thread and each gpu, there is one identical miopen handle, which is also associated with the thread-local per-device hip stream. The wrapper also hosts the device-specific miopen workspace (scratch space for some miopen functions).

Definition at line 108 of file miopen_wrapper.h.

Constructor & Destructor Documentation

caffe2::MIOPENWrapper::MIOPENWrapper ( HIPContext *  context)
inlineexplicit

Creates a miopen wrapper associated with a HIPContext object.

Note that the HIPContext object should outlive the MIOPENWrapper.

Definition at line 115 of file miopen_wrapper.h.


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