MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MIOpenHandle

Class MIOpenHandle

tensorflow/stream_executor/rocm/rocm_dnn.cc:97–113  ·  view source on GitHub ↗

RAII wrapper for all calls to MIOpen with a MIOpen handle argument. See MIOpenAccess::GetHandle() for details.

Source from the content-addressed store, hash-verified

95//
96// See MIOpenAccess::GetHandle() for details.
97class MIOpenHandle {
98 public:
99 // Takes ownership of the executor context and the lock to access MIOpen
100 // using handle.
101 MIOpenHandle(gpu::ScopedActivateExecutorContext context,
102 std::unique_ptr<absl::MutexLock> lock, miopenHandle_t handle)
103 : context_(std::move(context)), lock_(std::move(lock)), handle_(handle) {}
104
105 // Returns MIOpen handle. To be passed directly to MIOpen APIs, don't keep
106 // a copy.
107 miopenHandle_t handle() const { return handle_; }
108
109 private:
110 gpu::ScopedActivateExecutorContext context_;
111 std::unique_ptr<absl::MutexLock> lock_;
112 miopenHandle_t handle_; // Not owned.
113};
114
115namespace wrap {
116

Callers 1

GetHandleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected