Fix Engine Offsetting for Copy on Engine

Forgot SDMA blit engine indices are offset by DevToDev 0-position in
a couple of places.

Change-Id: Ie811d8281bc812738ed0107694f3dffde5e93685
This commit is contained in:
Jonathan Kim
2023-03-03 16:16:20 -05:00
parent 7ed6d73b6d
commit 7364a93b98
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -511,8 +511,8 @@ hsa_status_t Runtime::CopyMemoryOnEngine(void* dst, core::Agent* dst_agent, cons
core::Agent* copy_agent = (src_gpu) ? src_agent : dst_agent;
// engine_id is single bitset unique.
int engine_offset = ffs(engine_id) - 1;
if (!engine_id || !!((engine_id >> (engine_offset + 1)))) {
int engine_offset = ffs(engine_id);
if (!engine_id || !!((engine_id >> engine_offset))) {
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}