From ad1a3fc9c4267517047b4db72caa126d7fdfae97 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 15 Mar 2023 10:52:16 -0400 Subject: [PATCH] Fix Invalid Engine Offset Check Engine offset that is the maximum number of engines is still valid as offset enum 0 is occupied by blit copies so raise the limit by 1. Change-Id: I6fcab106290e6647702efe297a4281861da4e0b8 [ROCm/ROCR-Runtime commit: fc8f3f9fd59f1e0c23264107a941c2db192bb36f] --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 528beb1eff..7a3bd2eb6a 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -788,7 +788,7 @@ hsa_status_t GpuAgent::DmaCopyOnEngine(void* dst, core::Agent& dst_agent, (dst_agent.device_type() == core::Agent::kAmdGpuDevice)) && ("Both devices are CPU agents which is not expected")); - if (engine_offset >= properties_.NumSdmaEngines + properties_.NumSdmaXgmiEngines) { + if (engine_offset > properties_.NumSdmaEngines + properties_.NumSdmaXgmiEngines) { return HSA_STATUS_ERROR_INVALID_ARGUMENT; }