Skip to content

Commit ec9d8b6

Browse files
committed
fix bugs
1 parent 54365d8 commit ec9d8b6

File tree

5 files changed

+8
-51
lines changed

5 files changed

+8
-51
lines changed

paddle/fluid/platform/device_context.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,6 @@ void IPUDeviceContext::Wait() const {
145145

146146
IPUDeviceContext::~IPUDeviceContext() {}
147147

148-
#endif
149-
#ifdef PADDLE_WITH_XPU
150-
XPUDeviceContext::XPUDeviceContext() : phi::XPUContext() {
151-
phi::XPUContext::Init();
152-
}
153-
154-
XPUDeviceContext::~XPUDeviceContext() {}
155-
156-
XPUDeviceContext::XPUDeviceContext(XPUPlace place) : phi::XPUContext(place) {
157-
phi::XPUContext::Init();
158-
LOG_FIRST_N(WARNING, 1) << "Please NOTE: xpu device: "
159-
<< static_cast<int>(place.device);
160-
}
161148
#endif
162149

163150
#ifdef PADDLE_WITH_ASCEND_CL

paddle/fluid/platform/device_context.h

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,7 @@ class MLUDeviceContext;
151151

152152
#ifdef PADDLE_WITH_XPU
153153
namespace xpu = baidu::xpu::api;
154-
class XPUDeviceContext : public phi::XPUContext {
155-
public:
156-
XPUDeviceContext();
157-
explicit XPUDeviceContext(XPUPlace place);
158-
virtual ~XPUDeviceContext();
159-
Eigen::DefaultDevice* eigen_device() const { return nullptr; }
160-
xpuStream stream() const { return XPUContext::x_context()->xpu_stream; }
161-
void CreateStream() { XPUContext::CreateStream(); }
162-
};
154+
using XPUDeviceContext = phi::XPUContext;
163155
#endif
164156

165157
#ifdef PADDLE_WITH_ASCEND_CL
@@ -264,23 +256,7 @@ class CUDAPinnedDeviceContext
264256
#endif
265257

266258
#ifdef PADDLE_WITH_CUSTOM_DEVICE
267-
class CustomDeviceContext : public phi::CustomContext {
268-
public:
269-
explicit CustomDeviceContext(CustomPlace place);
270-
virtual ~CustomDeviceContext();
271-
272-
Eigen::DefaultDevice* eigen_device() const { return nullptr; }
273-
274-
template <typename Callback>
275-
void AddStreamCallback(Callback&& callback) const {
276-
return stream_->AddCallback(callback);
277-
}
278-
279-
void WaitStreamCallback() const { return stream_->WaitCallback(); }
280-
281-
private:
282-
std::shared_ptr<phi::stream::Stream> stream_;
283-
};
259+
using CustomDeviceContext = phi::CustomContext;
284260
#endif
285261

286262
void EmplaceExternalContext(

paddle/phi/backends/custom/custom_device.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
#include "paddle/fluid/platform/profiler/trace_event_collector.h"
16-
1716
#include "paddle/phi/backends/all_context.h"
1817
#include "paddle/phi/backends/callback_manager.h"
1918
#include "paddle/phi/backends/custom/enforce_custom.h"

paddle/phi/core/CMakeLists.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,20 @@ if(WITH_GPU)
135135
nv_library(
136136
phi_tensor_utils
137137
SRCS tensor_utils.cc
138-
DEPS phi_backends dense_tensor selected_rows memcpy phi_backends
139-
memory_utils)
138+
DEPS phi_backends dense_tensor selected_rows memcpy memory_utils)
140139
elseif(WITH_ROCM)
141140
hip_library(
142141
phi_tensor_utils
143142
SRCS tensor_utils.cc
144-
DEPS phi_backends dense_tensor selected_rows memcpy phi_backends
145-
memory_utils)
143+
DEPS phi_backends dense_tensor selected_rows memcpy memory_utils)
146144
elseif(WITH_XPU_KP)
147145
xpu_library(
148146
phi_tensor_utils
149147
SRCS tensor_utils.cc
150-
DEPS phi_backends dense_tensor selected_rows memcpy phi_backends
151-
memory_utils)
148+
DEPS phi_backends dense_tensor selected_rows memcpy memory_utils)
152149
else()
153150
cc_library(
154151
phi_tensor_utils
155152
SRCS tensor_utils.cc
156-
DEPS dense_tensor selected_rows memcpy phi_backends phi_backends
157-
memory_utils)
153+
DEPS dense_tensor selected_rows memcpy phi_backends memory_utils)
158154
endif()

paddle/phi/kernels/funcs/gru_compute.cu

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
See the License for the specific language governing permissions and
1010
limitations under the License. */
1111

12-
#include <paddle/phi/backends/all_context.h>
13-
12+
#include "paddle/phi/kernels/funcs/gru_compute.h"
13+
#include "paddle/phi/backends/all_context.h"
1414
#include "paddle/phi/kernels/funcs/blas/blas.h"
1515
#include "paddle/phi/kernels/funcs/detail/gru_gpu_kernel.h"
1616
#include "paddle/phi/kernels/funcs/detail/gru_kernel.h"
17-
#include "paddle/phi/kernels/funcs/gru_compute.h"
1817

1918
namespace phi {
2019
namespace funcs {

0 commit comments

Comments
 (0)