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; }