diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp index ff33788fe2..669402b047 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp @@ -471,6 +471,7 @@ hsa_status_t BlitSdma: wrapped_index += fence_command_size_; BuildTrapCommand(command_addr, out_signal.signal_.event_id); + command_addr += trap_command_size_; bytes_written_[wrapped_index] = post_bytes; wrapped_index += trap_command_size_; } @@ -481,7 +482,7 @@ hsa_status_t BlitSdma: if (pad_size) { memset(command_addr, 0, pad_size); uint32_t *dword_command_addr = reinterpret_cast(command_addr); - dword_command_addr[total_command_size/4] = (pad_size/4 - 1) << 16; + dword_command_addr[0] = (pad_size/4 - 1) << 16; } ReleaseWriteAddress(curr_index, total_command_size + pad_size);