[Openmp-commits] [PATCH] D104512: [AMDGPU][Libomptarget] Remove redundant functions

Pushpinder Singh via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jun 18 02:36:07 PDT 2021


pdhaliwal created this revision.
pdhaliwal added reviewers: JonChesterfield, ronlieb.
Herald added subscribers: kerbowa, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl.
pdhaliwal requested review of this revision.
Herald added subscribers: openmp-commits, wdng.
Herald added a project: OpenMP.

There does not seem to be any use of these functions. They just
put the value to a local which is never used again.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104512

Files:
  openmp/libomptarget/plugins/amdgpu/impl/system.cpp


Index: openmp/libomptarget/plugins/amdgpu/impl/system.cpp
===================================================================
--- openmp/libomptarget/plugins/amdgpu/impl/system.cpp
+++ openmp/libomptarget/plugins/amdgpu/impl/system.cpp
@@ -241,41 +241,6 @@
   return err;
 }
 
-hsa_status_t get_fine_grained_region(hsa_region_t region, void *data) {
-  hsa_region_segment_t segment;
-  hsa_region_get_info(region, HSA_REGION_INFO_SEGMENT, &segment);
-  if (segment != HSA_REGION_SEGMENT_GLOBAL) {
-    return HSA_STATUS_SUCCESS;
-  }
-  hsa_region_global_flag_t flags;
-  hsa_region_get_info(region, HSA_REGION_INFO_GLOBAL_FLAGS, &flags);
-  if (flags & HSA_REGION_GLOBAL_FLAG_FINE_GRAINED) {
-    hsa_region_t *ret = reinterpret_cast<hsa_region_t *>(data);
-    *ret = region;
-    return HSA_STATUS_INFO_BREAK;
-  }
-  return HSA_STATUS_SUCCESS;
-}
-
-/* Determines if a memory region can be used for kernarg allocations.  */
-static hsa_status_t get_kernarg_memory_region(hsa_region_t region, void *data) {
-  hsa_region_segment_t segment;
-  hsa_region_get_info(region, HSA_REGION_INFO_SEGMENT, &segment);
-  if (HSA_REGION_SEGMENT_GLOBAL != segment) {
-    return HSA_STATUS_SUCCESS;
-  }
-
-  hsa_region_global_flag_t flags;
-  hsa_region_get_info(region, HSA_REGION_INFO_GLOBAL_FLAGS, &flags);
-  if (flags & HSA_REGION_GLOBAL_FLAG_KERNARG) {
-    hsa_region_t *ret = reinterpret_cast<hsa_region_t *>(data);
-    *ret = region;
-    return HSA_STATUS_INFO_BREAK;
-  }
-
-  return HSA_STATUS_SUCCESS;
-}
-
 static hsa_status_t init_compute_and_memory() {
   hsa_status_t err;
 
@@ -394,38 +359,6 @@
     DEBUG_PRINT("\tCoarse Memories : %d\n", coarse_memories_size);
     proc_index++;
   }
-  proc_index = 0;
-  hsa_region_t atl_cpu_kernarg_region;
-  atl_cpu_kernarg_region.handle = (uint64_t)-1;
-  if (cpu_procs.size() > 0) {
-    err = hsa_agent_iterate_regions(
-        cpu_procs[0].agent(), get_fine_grained_region, &atl_cpu_kernarg_region);
-    if (err == HSA_STATUS_INFO_BREAK) {
-      err = HSA_STATUS_SUCCESS;
-    }
-    err = (atl_cpu_kernarg_region.handle == (uint64_t)-1) ? HSA_STATUS_ERROR
-                                                          : HSA_STATUS_SUCCESS;
-    if (err != HSA_STATUS_SUCCESS) {
-      printf("[%s:%d] %s failed: %s\n", __FILE__, __LINE__,
-             "Finding a CPU kernarg memory region handle",
-             get_error_string(err));
-      return err;
-    }
-  }
-  hsa_region_t atl_gpu_kernarg_region;
-  /* Find a memory region that supports kernel arguments.  */
-  atl_gpu_kernarg_region.handle = (uint64_t)-1;
-  if (gpu_procs.size() > 0) {
-    hsa_agent_iterate_regions(gpu_procs[0].agent(), get_kernarg_memory_region,
-                              &atl_gpu_kernarg_region);
-    err = (atl_gpu_kernarg_region.handle == (uint64_t)-1) ? HSA_STATUS_ERROR
-                                                          : HSA_STATUS_SUCCESS;
-    if (err != HSA_STATUS_SUCCESS) {
-      printf("[%s:%d] %s failed: %s\n", __FILE__, __LINE__,
-             "Finding a kernarg memory region", get_error_string(err));
-      return err;
-    }
-  }
   if (num_procs > 0)
     return HSA_STATUS_SUCCESS;
   else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104512.352948.patch
Type: text/x-patch
Size: 3168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210618/f02d3378/attachment-0001.bin>


More information about the Openmp-commits mailing list