[Openmp-commits] [openmp] 7928d9e - [OpenMP][libomptarget][AMDGPU] Add missing declarations to fix non amdgpu builds

Carlo Bertolli via Openmp-commits openmp-commits at lists.llvm.org
Fri Jan 13 13:04:54 PST 2023


Author: Carlo Bertolli
Date: 2023-01-13T15:04:14-06:00
New Revision: 7928d9e12d47fcc226d0c6984e11f5f463670f4a

URL: https://github.com/llvm/llvm-project/commit/7928d9e12d47fcc226d0c6984e11f5f463670f4a
DIFF: https://github.com/llvm/llvm-project/commit/7928d9e12d47fcc226d0c6984e11f5f463670f4a.diff

LOG: [OpenMP][libomptarget][AMDGPU] Add missing declarations to fix non amdgpu builds
Fix after commit of https://reviews.llvm.org/D139208

Added: 
    

Modified: 
    openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
    openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp b/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
index c43db066ae6a..19705bddb1cf 100644
--- a/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
+++ b/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
@@ -66,6 +66,7 @@ DLWRAP(hsa_amd_memory_fill, 3)
 DLWRAP(hsa_amd_register_system_event_handler, 2)
 DLWRAP(hsa_amd_signal_create, 5)
 DLWRAP(hsa_amd_signal_async_handler, 5)
+DLWRAP(hsa_amd_pointer_info, 5)
 
 DLWRAP_FINALIZE()
 

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 619bab471a70..b67e065f77f1 100644
--- a/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h
+++ b/openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa_ext_amd.h
@@ -136,6 +136,26 @@ typedef enum {
   HSA_AMD_MEMORY_FAULT_HANG = 1 << 31
 } hsa_amd_memory_fault_reason_t;
 
+typedef enum {
+  HSA_EXT_POINTER_TYPE_UNKNOWN = 0,
+  HSA_EXT_POINTER_TYPE_HSA = 1,
+  HSA_EXT_POINTER_TYPE_LOCKED = 2
+} hsa_amd_pointer_type_t;
+
+typedef struct hsa_amd_pointer_info_s {
+  uint32_t size;
+  hsa_amd_pointer_type_t type;
+  void* agentBaseAddress;
+  void* hostBaseAddress;
+  size_t sizeInBytes;
+} hsa_amd_pointer_info_t;
+
+hsa_status_t hsa_amd_pointer_info(const void* ptr,
+                                          hsa_amd_pointer_info_t* info,
+                                          void* (*alloc)(size_t),
+                                          uint32_t* num_agents_accessible,
+                                          hsa_agent_t** accessible);
+
 #ifdef __cplusplus
 }
 #endif


        


More information about the Openmp-commits mailing list