diff --git a/example/matrixAddWithMdspan/src/matrixAddMdSpan.cpp b/example/matrixAddWithMdspan/src/matrixAddMdSpan.cpp index c3894d858e6..5d33435543d 100644 --- a/example/matrixAddWithMdspan/src/matrixAddMdSpan.cpp +++ b/example/matrixAddWithMdspan/src/matrixAddMdSpan.cpp @@ -127,6 +127,7 @@ auto example(TAccTag const&) -> int // Copy data to device, use directly host buffers (not mdspans used to fill the data) alpaka::memcpy(queue, bufDevA, bufHostA); alpaka::memcpy(queue, bufDevB, bufHostB); + alpaka::wait(queue); // Create mdspan views for device buffers using alpaka::experimental::getMdSpan auto mdDevA = alpaka::experimental::getMdSpan(bufDevA); @@ -146,7 +147,6 @@ auto example(TAccTag const&) -> int // Copy result back to host alpaka::memcpy(queue, bufHostC, bufDevC); - // This wait is not necessary if the queue is a blocking queue alpaka::wait(queue); // Verify the result diff --git a/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp b/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp index 28869a5822b..cf9f8f1f67e 100644 --- a/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp +++ b/example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp @@ -138,6 +138,7 @@ auto example(TAccTag const&) -> int // Copy data to device, use directly host buffers (not mdspans used to fill the data) alpaka::memcpy(queue, bufDevA, bufHostA); alpaka::memcpy(queue, bufDevB, bufHostB); + alpaka::wait(queue); // Create mdspan views for device buffers using alpaka::experimental::getMdSpan auto mdDevA = alpaka::experimental::getMdSpan(bufDevA); @@ -157,7 +158,6 @@ auto example(TAccTag const&) -> int // Copy result back to host alpaka::memcpy(queue, bufHostC, bufDevC); - // This wait is not necessary if the queue is a blocking queue alpaka::wait(queue); // Verify the result