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 |
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.
|
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.