未验证 提交 b922e711 编写于 作者: R ronnywang 提交者: GitHub

[CustomDevice] fix buffered reader exception (#53925)

上级 051add42
......@@ -302,6 +302,8 @@ void BufferedReader::ReadAsync(size_t i) {
#ifdef PADDLE_WITH_CUSTOM_DEVICE
if (platform::is_custom_place(place_)) {
phi::DeviceManager::SetDevice(place_);
TensorVec &custom_device = custom_device_buffer_[i];
if (custom_device.empty()) {
custom_device.resize(cpu.size());
......@@ -325,7 +327,6 @@ void BufferedReader::ReadAsync(size_t i) {
custom_device[i].mutable_data(place_, cpu[i].type()));
}
phi::DeviceManager::SetDevice(place_);
phi::DeviceManager::GetDeviceWithPlace(place_)->RecordEvent(
custom_device_events_[i].get(), custom_device_compute_stream_.get());
phi::DeviceManager::GetDeviceWithPlace(place_)->StreamWaitEvent(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册