From d8b0f007cb98ae261b65204f3e9c452937f8b91f Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 16 Dec 2022 07:04:01 -0600 Subject: [PATCH] [libomptarget] Add HSA definitions for memory faults to dynamic_hsa Summary: We use the dynamic HSA file to forward declare needed definitions from the HSA runtime if not present at build time. These definitions were not included so using them caused problems on systems without it if used. Just add them. --- openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h b/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h index d27be93..619bab4 100644 --- a/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h +++ b/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h @@ -125,6 +125,17 @@ hsa_status_t hsa_amd_register_system_event_handler(hsa_amd_system_event_callback_t callback, void *data); +typedef enum { + HSA_AMD_MEMORY_FAULT_PAGE_NOT_PRESENT = 1 << 0, + HSA_AMD_MEMORY_FAULT_READ_ONLY = 1 << 1, + HSA_AMD_MEMORY_FAULT_NX = 1 << 2, + HSA_AMD_MEMORY_FAULT_HOST_ONLY = 1 << 3, + HSA_AMD_MEMORY_FAULT_DRAMECC = 1 << 4, + HSA_AMD_MEMORY_FAULT_IMPRECISE = 1 << 5, + HSA_AMD_MEMORY_FAULT_SRAMECC = 1 << 6, + HSA_AMD_MEMORY_FAULT_HANG = 1 << 31 +} hsa_amd_memory_fault_reason_t; + #ifdef __cplusplus } #endif -- 2.7.4