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


[ROCm/ROCR-Runtime commit: 7364a93b98]
이 커밋은 다음에 포함됨:
Jonathan Kim
2023-03-03 16:16:20 -05:00
부모 908a2b1eba
커밋 57064af98d
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
+3 -3
파일 보기
@@ -807,9 +807,9 @@ hsa_status_t GpuAgent::DmaCopyOnEngine(void* dst, core::Agent& dst_agent,
bool limit_h2d_blit = isa_->GetVersion() == core::Isa::Version(9, 0, 10);
// Ensure engine selection is within proper range based on transfer type
if ((is_xgmi && engine_offset < properties_.NumSdmaEngines) ||
(!is_xgmi && engine_offset >= properties_.NumSdmaEngines) ||
(!is_h2d_blit && !is_same_gpu && limit_h2d_blit && !engine_offset)) {
if ((is_xgmi && engine_offset <= properties_.NumSdmaEngines) ||
(!is_xgmi && engine_offset > properties_.NumSdmaEngines) ||
(!is_h2d_blit && !is_same_gpu && limit_h2d_blit && engine_offset == BlitHostToDev)) {
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}
+2 -2
파일 보기
@@ -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;
}