Skip to content

Commit b769845

Browse files
author
vlad-nazarov
authored
Add wait to memcpy (#855)
* Add wait and update context * Restore context
1 parent 73d61ec commit b769845

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

onedal/datatypes/data_conversion.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ static dal::array<T> transfer_to_host(const dal::array<T>& array) {
4343
}
4444
if (memory_kind == sycl::usm::alloc::device) {
4545
auto host_array = dal::array<T>::empty(array.get_count());
46-
opt_queue->memcpy(host_array.get_mutable_data(), device_data, array.get_size());
46+
opt_queue->memcpy(host_array.get_mutable_data(), device_data, array.get_size())
47+
.wait_and_throw();
4748
return host_array;
4849
}
4950
}

0 commit comments

Comments
 (0)