1919#include " paddle/fluid/framework/op_version_registry.h"
2020#include " paddle/fluid/framework/operator.h"
2121#include " paddle/fluid/framework/var_type.h"
22- #include " paddle/fluid/platform /device_memory_aligment.h"
22+ #include " paddle/phi/backends /device_memory_aligment.h"
2323#include " paddle/phi/kernels/funcs/math_function.h"
2424#ifdef PADDLE_WITH_ASCEND_CL
2525#include " paddle/fluid/platform/device/npu/npu_op_runner.h"
@@ -250,9 +250,9 @@ class CoalesceTensorOpKernel : public framework::OpKernel<T> {
250250 framework::TensorCopy (
251251 *in_tensors[i], context.GetPlace (), dev_ctx, &sub_tensor);
252252
253- offset += use_align ? platform ::Alignment (len * size_of_dtype,
254- context.GetPlace (),
255- align_size) /
253+ offset += use_align ? phi ::Alignment (len * size_of_dtype,
254+ context.GetPlace (),
255+ align_size) /
256256 size_of_dtype
257257 : len;
258258 }
@@ -274,9 +274,9 @@ class CoalesceTensorOpKernel : public framework::OpKernel<T> {
274274 framework::TensorCopy (
275275 *out_tensors[i], context.GetPlace (), dev_ctx, &sub_tensor);
276276 }
277- offset += use_align ? platform ::Alignment (len * size_of_dtype,
278- context.GetPlace (),
279- align_size) /
277+ offset += use_align ? phi ::Alignment (len * size_of_dtype,
278+ context.GetPlace (),
279+ align_size) /
280280 size_of_dtype
281281 : len;
282282 }
@@ -296,7 +296,7 @@ class CoalesceTensorOpKernel : public framework::OpKernel<T> {
296296 static_cast <int64_t >(offset), static_cast <int64_t >(offset + len)))
297297 .Resize (dim);
298298 len = use_align
299- ? platform ::Alignment (
299+ ? phi ::Alignment (
300300 len * size_of_dtype, context.GetPlace (), align_size) /
301301 size_of_dtype
302302 : len;
@@ -342,12 +342,12 @@ class CoalesceTensorOpKernel : public framework::OpKernel<T> {
342342 0 ,
343343 platform::errors::InvalidArgument (
344344 " The number of tensor `%s`'s elements is 0." , var_names[i]));
345- auto len = use_align ? platform::Alignment (
346- static_cast <size_t >(size) * size_of_dtype,
347- place,
348- align_size) /
349- size_of_dtype
350- : static_cast <size_t >(size);
345+ auto len = use_align
346+ ? phi::Alignment ( static_cast <size_t >(size) * size_of_dtype,
347+ place,
348+ align_size) /
349+ size_of_dtype
350+ : static_cast <size_t >(size);
351351 const void *ptr =
352352 lod_tensors[i]->IsInitialized () ? lod_tensors[i]->data () : nullptr ;
353353 VLOG (4 ) << size << " " << len;
0 commit comments