[Openmp-commits] [openmp] b25546a - [AMDGPU][Libomptarget][NFC] Remove bunch of dead structs

Pushpinder Singh via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 2 03:41:02 PDT 2021


Author: Pushpinder Singh
Date: 2021-06-02T10:40:51Z
New Revision: b25546a4b40675b596dcfdbfd491b10fa12d88e6

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

LOG: [AMDGPU][Libomptarget][NFC] Remove bunch of dead structs

Dropped structs are atmi_machine_t, atmi_device_t and atmi_memory_t

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D103509

Added: 
    

Modified: 
    openmp/libomptarget/plugins/amdgpu/impl/atmi.h
    openmp/libomptarget/plugins/amdgpu/impl/system.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins/amdgpu/impl/atmi.h b/openmp/libomptarget/plugins/amdgpu/impl/atmi.h
index 45e64060e645..63c5180dbef6 100644
--- a/openmp/libomptarget/plugins/amdgpu/impl/atmi.h
+++ b/openmp/libomptarget/plugins/amdgpu/impl/atmi.h
@@ -34,70 +34,4 @@ typedef enum atmi_memtype_s {
 } atmi_memtype_t;
 
 /** @} */
-
-/** \defgroup common Common ATMI Structures
- *  @{
- */
-
-/**
- * @brief ATMI Memory Space/region Structure
- */
-typedef struct atmi_memory_s {
-  /**
-   * Memory capacity
-   */
-  unsigned long int capacity;
-  /**
-   * Memory type
-   */
-  atmi_memtype_t type;
-} atmi_memory_t;
-
-/**
- * @brief ATMI Device Structure
- */
-typedef struct atmi_device_s {
-  /**
-   * Device type: CPU, GPU or DSP
-   */
-  atmi_devtype_t type;
-  /**
-   * Array of memory spaces/regions that are accessible
-   * from this device.
-   */
-  atmi_memory_t *memories;
-} atmi_device_t;
-
-/**
- * @brief ATMI Machine Structure
- */
-typedef struct atmi_machine_s {
-  /**
-   * The number of devices categorized by the device type
-   */
-  unsigned int device_count_by_type[ATMI_DEVTYPE_ALL];
-  /**
-   * The device structures categorized by the device type
-   */
-  atmi_device_t *devices_by_type[ATMI_DEVTYPE_ALL];
-} atmi_machine_t;
-
-// Below are some helper macros that can be used to setup
-// some of the ATMI data structures.
-#define ATMI_PLACE_GPU(node, gpu_id)                                           \
-  { .node_id = node, .type = ATMI_DEVTYPE_GPU, .device_id = gpu_id }
-
-#define ATMI_MEM_PLACE_CPU_MEM(node, cpu_id, cpu_mem_id)                       \
-  {                                                                            \
-    .node_id = node, .dev_type = ATMI_DEVTYPE_CPU, .dev_id = cpu_id,           \
-    .mem_id = cpu_mem_id                                                       \
-  }
-#define ATMI_MEM_PLACE_GPU_MEM(node, gpu_id, gpu_mem_id)                       \
-  {                                                                            \
-    .node_id = node, .dev_type = ATMI_DEVTYPE_GPU, .dev_id = gpu_id,           \
-    .mem_id = gpu_mem_id                                                       \
-  }
-#define ATMI_MEM_PLACE(d_type, d_id, m_id)                                     \
-  { .node_id = 0, .dev_type = d_type, .dev_id = d_id, .mem_id = m_id }
-
 #endif // INCLUDE_ATMI_H_

diff  --git a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp
index 14a29b93128a..85e79dc4058f 100644
--- a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp
+++ b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp
@@ -355,8 +355,6 @@ static hsa_status_t init_compute_and_memory() {
   }
 
   size_t num_procs = cpu_procs.size() + gpu_procs.size();
-  atmi_device_t *all_devices = reinterpret_cast<atmi_device_t *>(
-      malloc(num_procs * sizeof(atmi_device_t)));
   int num_iGPUs = 0;
   int num_dGPUs = 0;
   for (uint32_t i = 0; i < gpu_procs.size(); i++) {
@@ -378,8 +376,6 @@ static hsa_status_t init_compute_and_memory() {
   int gpus_end = cpu_procs.size() + gpu_procs.size();
   int proc_index = 0;
   for (int i = cpus_begin; i < cpus_end; i++) {
-    all_devices[i].type = cpu_procs[proc_index].type();
-
     std::vector<ATLMemory> memories = cpu_procs[proc_index].memories();
     int fine_memories_size = 0;
     int coarse_memories_size = 0;
@@ -400,8 +396,6 @@ static hsa_status_t init_compute_and_memory() {
   }
   proc_index = 0;
   for (int i = gpus_begin; i < gpus_end; i++) {
-    all_devices[i].type = gpu_procs[proc_index].type();
-
     std::vector<ATLMemory> memories = gpu_procs[proc_index].memories();
     int fine_memories_size = 0;
     int coarse_memories_size = 0;


        


More information about the Openmp-commits mailing list