diff --git a/paddle/phi/backends/custom/custom_device.cc b/paddle/phi/backends/custom/custom_device.cc index 164b425e393d66ab03007c5a139d7ba4df5e67d4..a5a4e9b37721d00e297b768d0f2ccd23953e41ee 100644 --- a/paddle/phi/backends/custom/custom_device.cc +++ b/paddle/phi/backends/custom/custom_device.cc @@ -359,8 +359,7 @@ class CustomDevice : public DeviceInterface { } } else { if (!pimpl_->memory_copy_p2p) { - std::unique_ptr tmp( - reinterpret_cast(new uint8_t[size])); + std::unique_ptr tmp(new uint8_t[size]); MemoryCopyD2H(src_dev_id, tmp.get(), src, size); MemoryCopyH2D(dst_dev_id, dst, tmp.get(), size); } else { @@ -452,8 +451,7 @@ class CustomDevice : public DeviceInterface { PADDLE_ENFORCE_CUSTOM_DEVICE_SUCCESS( pimpl_->device_memory_set(device, ptr, value, size)); } else { - std::unique_ptr tmp( - reinterpret_cast(new uint8_t[size])); + std::unique_ptr tmp(new uint8_t[size]); memset(tmp.get(), value, size); MemoryCopyH2D(dev_id, ptr, tmp.get(), size); }