From 5214b314a99bf8f0e77d4594a567c8a59bf3740f Mon Sep 17 00:00:00 2001 From: Aditya Avinash Atluri Date: Mon, 29 Feb 2016 12:49:50 -0600 Subject: [PATCH] H2H Async memcpy fix In this change, the cpu memcpy will wait until all the commands in the current stream are done. Note that, it only waits on current stream. But not on other streams. [ROCm/hip commit: 180bc32db0dd57e3baae828d5ed34e8f3b13e836] --- projects/hip/src/hip_hcc.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/hip/src/hip_hcc.cpp b/projects/hip/src/hip_hcc.cpp index 8df29aadb8..09b4770347 100644 --- a/projects/hip/src/hip_hcc.cpp +++ b/projects/hip/src/hip_hcc.cpp @@ -2405,6 +2405,11 @@ hipError_t hipMemcpyAsync(void* dst, const void* src, size_t sizeBytes, hipMemcp } else if (kind == hipMemcpyHostToHost) { tprintf (TRACE_COPY2, "H2H copy with memcpy"); + /* As this is a CPU op, we need to wait until all + the commands in current stream are finished. + */ + stream->wait(); + memcpy(dst, src, sizeBytes); } else {