From 75e13b9ab17d0ed76cef320ecf4f96dc377e7333 Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Thu, 22 May 2025 11:18:31 +0100 Subject: [PATCH] Remove unnecessary copy stream wait Signed-off-by: JackAKirk --- unified-runtime/source/adapters/cuda/image.cpp | 5 ----- unified-runtime/source/adapters/hip/image.cpp | 5 ----- 2 files changed, 10 deletions(-) diff --git a/unified-runtime/source/adapters/cuda/image.cpp b/unified-runtime/source/adapters/cuda/image.cpp index 0f7f972fc2fb1..f8ea673bf14d1 100644 --- a/unified-runtime/source/adapters/cuda/image.cpp +++ b/unified-runtime/source/adapters/cuda/image.cpp @@ -918,11 +918,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( cpy_desc.Depth = pCopyRegion->copyExtent.depth; UR_CHECK_ERROR(cuMemcpy3DAsync(&cpy_desc, Stream)); } - // Synchronization is required here to handle the case of copying data - // from host to device, then device to device and finally device to host. - // Without it, there is a risk of the copies not being executed in the - // intended order. - cuStreamSynchronize(Stream); } if (phEvent) { diff --git a/unified-runtime/source/adapters/hip/image.cpp b/unified-runtime/source/adapters/hip/image.cpp index de254c75f7f22..7c16ea6bb5cbc 100644 --- a/unified-runtime/source/adapters/hip/image.cpp +++ b/unified-runtime/source/adapters/hip/image.cpp @@ -906,11 +906,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // struct object which adds a little complexity (e.g. 'hipPitchedPtr'). UR_CHECK_ERROR(hipDrvMemcpy3DAsync(&cpy_desc, Stream)); } - // Synchronization is required here to handle the case of copying data - // from host to device, then device to device and finally device to host. - // Without it, there is a risk of the copies not being executed in the - // intended order. - UR_CHECK_ERROR(hipStreamSynchronize(Stream)); } if (phEvent) {