From 6b9567e0ac6bef93676dabc18a7b9b4463a95d40 Mon Sep 17 00:00:00 2001 From: Yang Yu Date: Thu, 7 Dec 2017 15:44:22 +0800 Subject: [PATCH] Remove DeviceContext::Finish --- paddle/platform/device_context.cc | 4 ---- paddle/platform/device_context.h | 5 ----- 2 files changed, 9 deletions(-) diff --git a/paddle/platform/device_context.cc b/paddle/platform/device_context.cc index 7afcdfce9..ae4f0bf89 100644 --- a/paddle/platform/device_context.cc +++ b/paddle/platform/device_context.cc @@ -122,10 +122,6 @@ Place CUDADeviceContext::GetPlace() const { return place_; } void CUDADeviceContext::Wait() const { PADDLE_ENFORCE(cudaStreamSynchronize(stream_)); -} - -void CUDADeviceContext::Finish() const { - Wait(); PADDLE_ENFORCE(cudaGetLastError()); } diff --git a/paddle/platform/device_context.h b/paddle/platform/device_context.h index 526d089e3..ef5f19214 100644 --- a/paddle/platform/device_context.h +++ b/paddle/platform/device_context.h @@ -46,8 +46,6 @@ class DeviceContext { DeviceType* GetEigenDevice() const; virtual void Wait() const {} - - virtual void Finish() const {} }; class CPUDeviceContext : public DeviceContext { @@ -79,9 +77,6 @@ class CUDADeviceContext : public DeviceContext { /*! \brief Wait for all operations completion in the stream. */ void Wait() const override; - /*! \brief Check potential errors for the cuda kernel calls. */ - void Finish() const override; - /*! \brief Return place in the device context. */ Place GetPlace() const override; -- GitLab