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

Class CudnnHandle

tensorflow/stream_executor/cuda/cuda_dnn.cc:172–188  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

170//
171// See CudnnAccess::GetHandle() for details.
172class CudnnHandle {
173 public:
174 // Takes ownership of the executor context and the lock to access cuDNN
175 // using handle.
176 CudnnHandle(gpu::ScopedActivateExecutorContext context,
177 std::unique_ptr<absl::MutexLock> lock, cudnnHandle_t handle)
178 : context_(std::move(context)), lock_(std::move(lock)), handle_(handle) {}
179
180 // Returns cuDNN handle. To be passed directly to cuDNN APIs, don't keep
181 // a copy.
182 cudnnHandle_t handle() const { return handle_; }
183
184 private:
185 gpu::ScopedActivateExecutorContext context_;
186 std::unique_ptr<absl::MutexLock> lock_;
187 cudnnHandle_t handle_; // Not owned.
188};
189
190} // namespace
191

Callers 1

GetHandleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected