未验证 提交 31efec53 编写于 作者: Y YuanRisheng 提交者: GitHub

[Pten]Fix bugs of compilation when use pten::add/subtract (#38631)

* change 'math' to 'math_kernel'

* fix compile bugs

* merge develop

* fix compile bugs

* fix compile bugs
上级 4794a44f
......@@ -20,7 +20,7 @@ limitations under the License. */
#include "paddle/fluid/operators/svd_helper.h"
#include "paddle/fluid/operators/triangular_solve_op.h"
#include "paddle/fluid/operators/tril_triu_op.h"
#include "paddle/pten/include/math.h"
#include "paddle/pten/kernels/math_kernel.h"
namespace paddle {
namespace operators {
......@@ -223,7 +223,8 @@ void Tensor_Add(const DeviceContext& dev_ctx, const framework::Tensor& src1,
auto pt_x = paddle::experimental::MakePtenDenseTensor(src1);
auto pt_y = paddle::experimental::MakePtenDenseTensor(src2);
auto pt_z = paddle::experimental::MakePtenDenseTensor(*out);
pten::Add<T>(dev_ctx, *pt_x.get(), *pt_y.get(), -1, pt_z.get());
pten::AddKernel<T, DeviceContext>(dev_ctx, *pt_x.get(), *pt_y.get(), -1,
pt_z.get());
}
template <typename DeviceContext, typename T>
......@@ -234,7 +235,8 @@ void Tensor_Sub(const DeviceContext& dev_ctx, const framework::Tensor& src1,
auto pt_x = paddle::experimental::MakePtenDenseTensor(src1);
auto pt_y = paddle::experimental::MakePtenDenseTensor(src2);
auto pt_z = paddle::experimental::MakePtenDenseTensor(*out);
pten::Subtract<T>(dev_ctx, *pt_x.get(), *pt_y.get(), -1, pt_z.get());
pten::SubtractKernel<T, DeviceContext>(dev_ctx, *pt_x.get(), *pt_y.get(), -1,
pt_z.get());
}
template <typename DeviceContext, typename T, size_t D>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册