Skip to content

Commit

Permalink
add wait
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetyusufoglu committed Jul 22, 2024
1 parent c60ef7a commit cdda967
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/matrixAddWithMdspan/src/matrixAddMdSpan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/matrixMulWithMdspan/src/matrixMulMdSpan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit cdda967

Please sign in to comment.