Skip to content

Commit 7cf8b65

Browse files
committed
Remove lock in device context
1 parent 86a61c1 commit 7cf8b65

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

paddle/fluid/platform/device_context.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ CUDADeviceContext::~CUDADeviceContext() {
175175
Place CUDADeviceContext::GetPlace() const { return place_; }
176176

177177
void CUDADeviceContext::Wait() const {
178-
std::lock_guard<std::recursive_mutex> guard(mutex_);
179178
PADDLE_ENFORCE(cudaStreamSynchronize(stream_));
180179
PADDLE_ENFORCE(cudaGetLastError());
181180
}

paddle/fluid/platform/device_context.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class CUDADeviceContext : public DeviceContext {
100100

101101
template <typename Callback>
102102
void RecordEvent(cudaEvent_t ev, Callback callback) {
103-
std::lock_guard<std::recursive_mutex> guard(mutex_);
104103
callback();
105104
PADDLE_ENFORCE(cudaEventRecord(ev, stream_));
106105
}
@@ -110,8 +109,6 @@ class CUDADeviceContext : public DeviceContext {
110109

111110
std::unique_ptr<Eigen::GpuDevice> eigen_device_;
112111
std::unique_ptr<EigenCudaStreamDevice> eigen_stream_;
113-
114-
mutable std::recursive_mutex mutex_;
115112
cudaStream_t stream_;
116113
cudnnHandle_t cudnn_handle_;
117114
cublasHandle_t cublas_handle_;

0 commit comments

Comments
 (0)