From f43a284b8e3796615b7ba19d92ed2ca3bf6cf075 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 6 Apr 2023 18:59:39 +0000 Subject: [PATCH] Change error reported when receiving code 128 We used to report HSA_STATUS_ERROR_INVALID_ISA when receiving error code 128, but there are several other reasons why we could be exceeding number of VGPRs, so updating the error code. Change-Id: I6a6980d5b07b09c93d00dee5207a0d52399bc77e --- runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp | 2 +- runtime/hsa-runtime/core/runtime/hsa.cpp | 5 +++++ runtime/hsa-runtime/inc/hsa_ext_amd.h | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index b9d49c3c40..2115d6d1d4 100644 --- a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -941,7 +941,7 @@ bool AqlQueue::DynamicScratchHandler(hsa_signal_value_t error_code, void* arg) { errorCode = HSA_STATUS_ERROR_INVALID_ARGUMENT; } else if ((error_code & 128) == 128) { // Out of VGPRs - errorCode = HSA_STATUS_ERROR_INVALID_ISA; + errorCode = hsa_status_t(HSA_STATUS_ERROR_OUT_OF_REGISTERS); } else if ((error_code & 0x20000000) == 0x20000000) { // Memory violation (>48-bit) errorCode = hsa_status_t(HSA_STATUS_ERROR_MEMORY_APERTURE_VIOLATION); diff --git a/runtime/hsa-runtime/core/runtime/hsa.cpp b/runtime/hsa-runtime/core/runtime/hsa.cpp index 3dc854bbd4..bcc1414573 100644 --- a/runtime/hsa-runtime/core/runtime/hsa.cpp +++ b/runtime/hsa-runtime/core/runtime/hsa.cpp @@ -2751,6 +2751,11 @@ hsa_status_t hsa_status_string( "enable a CU which was disabled for the process. CUs disabled for the process remain " "disabled."; break; + case HSA_STATUS_ERROR_OUT_OF_REGISTERS: + *status_string = + "HSA_STATUS_ERROR_OUT_OF_REGISTERS: Kernel has requested more VGPRs than are available " + "on this agent"; + break; default: return HSA_STATUS_ERROR_INVALID_ARGUMENT; } diff --git a/runtime/hsa-runtime/inc/hsa_ext_amd.h b/runtime/hsa-runtime/inc/hsa_ext_amd.h index 669894a173..508a45cf3b 100644 --- a/runtime/hsa-runtime/inc/hsa_ext_amd.h +++ b/runtime/hsa-runtime/inc/hsa_ext_amd.h @@ -202,6 +202,11 @@ enum { * disabled. */ HSA_STATUS_CU_MASK_REDUCED = 44, + + /** + * Exceeded number of VGPRs available on this agent + */ + HSA_STATUS_ERROR_OUT_OF_REGISTERS = 45, }; /**