Skip to content

Commit

Permalink
SWDEV-398166/SWDEV-399104 - Fix hipMemcpy2DAsync_PinnedMemory.tst
Browse files Browse the repository at this point in the history
failure

- As per spec, hipMemset2D is async with respect to host when target memory is device memory
- Hence need to call hipDeviceSynchronize before changing device

Change-Id: I58e6efc9466233d80b8ba2c58c0c691c68827128
  • Loading branch information
rakesroy authored and gargrahul committed May 30, 2023
1 parent 393692b commit 4e9d38d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/src/runtimeApi/memory/hipMemcpy2DAsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ bool Memcpy2DAsync::Memcpy2DAsync_PinnedMemory_MultiGPU() {
HIPCHECK(hipHostMalloc(reinterpret_cast<void**>(&D_h), sizeElements));
AllocateMemory();
HIPCHECK(hipMemset2D(A_d, pitch_A, memsetval, NUM_W, NUM_H));
HIPCHECK(hipDeviceSynchronize());
HIPCHECK(hipSetDevice(1));
hipStream_t p_stream;
HIPCHECK(hipStreamCreate(&p_stream));
Expand Down

0 comments on commit 4e9d38d

Please sign in to comment.