Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHI]Move elementwise div/mul of XPU kernel to PHI #45581

Merged
merged 5 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions paddle/fluid/operators/elementwise/elementwise_div_op_xpu.cc

This file was deleted.

55 changes: 0 additions & 55 deletions paddle/fluid/operators/elementwise/elementwise_mul_op_xpu.cc

This file was deleted.

23 changes: 1 addition & 22 deletions paddle/phi/kernels/cpu/elementwise_add_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,12 @@ namespace phi {
// Create the definition of Add
DEFINE_CPU_ELEMENTWISE_OP(Add)

template <typename T, typename Context>
void AddKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
DenseTensor* out) {
int axis = -1;
AddRawKernel<T>(dev_ctx, x, y, axis, out);
}

template <typename T, typename Context>
void GradAddKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
DenseTensor* out) {
AddKernel<T>(dev_ctx, x, y, out);
AddRawKernel<T>(dev_ctx, x, y, -1, out);
}

} // namespace phi
Expand All @@ -62,18 +53,6 @@ PD_REGISTER_KERNEL(add_raw,
complex64,
complex128) {}

PD_REGISTER_KERNEL(add,
CPU,
ALL_LAYOUT,
phi::AddKernel,
float,
double,
int16_t,
int,
int64_t,
complex64,
complex128) {}

PD_REGISTER_KERNEL(grad_add,
CPU,
ALL_LAYOUT,
Expand Down
19 changes: 0 additions & 19 deletions paddle/phi/kernels/cpu/elementwise_divide_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ void DivideRawKernel(const Context& dev_ctx,
}
}

template <typename T, typename Context>
void DivideKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
DenseTensor* out) {
int axis = -1;
DivideRawKernel<T>(dev_ctx, x, y, axis, out);
}

} // namespace phi

using complex64 = ::phi::dtype::complex<float>;
Expand All @@ -73,13 +64,3 @@ PD_REGISTER_KERNEL(divide_raw,
int64_t,
complex64,
complex128) {}
PD_REGISTER_KERNEL(divide,
CPU,
ALL_LAYOUT,
phi::DivideKernel,
float,
double,
int,
int64_t,
complex64,
complex128) {}
22 changes: 0 additions & 22 deletions paddle/phi/kernels/cpu/elementwise_multiply_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ namespace phi {
// Create the definition of Multiply
DEFINE_CPU_ELEMENTWISE_OP(Multiply)

template <typename T, typename Context>
void MultiplyKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
DenseTensor* out) {
int axis = -1;
MultiplyRawKernel<T>(dev_ctx, x, y, axis, out);
}

} // namespace phi

using complex64 = ::phi::dtype::complex<float>;
Expand All @@ -54,16 +45,3 @@ PD_REGISTER_KERNEL(multiply_raw,
complex64,
complex128,
phi::dtype::bfloat16) {}

PD_REGISTER_KERNEL(multiply,
CPU,
ALL_LAYOUT,
phi::MultiplyKernel,
float,
double,
int,
int64_t,
bool,
complex64,
complex128,
phi::dtype::bfloat16) {}
21 changes: 0 additions & 21 deletions paddle/phi/kernels/cpu/elementwise_subtract_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ namespace phi {
// Create the definition of Subtract
DEFINE_CPU_ELEMENTWISE_OP(Subtract)

template <typename T, typename Context>
void SubtractKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
DenseTensor* out) {
int axis = -1;
SubtractRawKernel<T>(dev_ctx, x, y, axis, out);
}

} // namespace phi

using complex64 = ::phi::dtype::complex<float>;
Expand All @@ -54,15 +45,3 @@ PD_REGISTER_KERNEL(subtract_raw,
complex64,
complex128,
phi::dtype::bfloat16) {}
PD_REGISTER_KERNEL(subtract,
CPU,
ALL_LAYOUT,
phi::SubtractKernel,
float,
double,
int16_t,
int,
int64_t,
complex64,
complex128,
phi::dtype::bfloat16) {}
Loading