[libomptarget] Add HSA definitions for memory faults to dynamic_hsa
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 16 Dec 2022 13:04:01 +0000 (07:04 -0600)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 16 Dec 2022 13:06:44 +0000 (07:06 -0600)
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

index d27be93..619bab4 100644 (file)
@@ -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