[Openmp-commits] [PATCH] D102598: [AMDGPU][libomptarget] Remove unused global variables

Pushpinder Singh via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon May 17 00:58:02 PDT 2021


pdhaliwal created this revision.
pdhaliwal added reviewers: JonChesterfield, ronlieb, gregrodgers.
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.

Change-Id: Ibbec06ca581ae50534d274e2b49f781ec7ef98fb


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102598

Files:
  openmp/libomptarget/plugins/amdgpu/impl/internal.h
  openmp/libomptarget/plugins/amdgpu/impl/machine.cpp
  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
@@ -143,19 +143,12 @@
 bool g_atmi_initialized = false;
 bool g_atmi_hostcall_required = false;
 
-struct timespec context_init_time;
-int context_init_time_init = 0;
-
 /*
    atlc is all internal global values.
    The structure atl_context_t is defined in atl_internal.h
    Most references will use the global structure prefix atlc.
-   However the pointer value atlc_p-> is equivalent to atlc.
-
 */
-
 atl_context_t atlc = {.struct_initialized = false};
-atl_context_t *atlc_p = NULL;
 
 namespace core {
 /* Machine Info */
@@ -243,7 +236,6 @@
 }
 
 static void atmi_init_context_structs() {
-  atlc_p = &atlc;
   atlc.struct_initialized = true; /* This only gets called one time */
   atlc.g_hsa_initialized = false;
   atlc.g_gpu_initialized = false;
@@ -650,11 +642,6 @@
   if (err != HSA_STATUS_SUCCESS)
     return ATMI_STATUS_ERROR;
 
-  if (context_init_time_init == 0) {
-    clock_gettime(CLOCK_MONOTONIC_RAW, &context_init_time);
-    context_init_time_init = 1;
-  }
-
   err = hsa_amd_register_system_event_handler(callbackEvent, NULL);
   if (err != HSA_STATUS_SUCCESS) {
     printf("[%s:%d] %s failed: %s\n", __FILE__, __LINE__,
Index: openmp/libomptarget/plugins/amdgpu/impl/machine.cpp
===================================================================
--- openmp/libomptarget/plugins/amdgpu/impl/machine.cpp
+++ openmp/libomptarget/plugins/amdgpu/impl/machine.cpp
@@ -14,7 +14,6 @@
 #include <vector>
 
 extern ATLMachine g_atl_machine;
-extern hsa_region_t atl_cpu_kernarg_region;
 
 void ATLProcessor::addMemory(const ATLMemory &mem) {
   for (auto &mem_obj : memories_) {
Index: openmp/libomptarget/plugins/amdgpu/impl/internal.h
===================================================================
--- openmp/libomptarget/plugins/amdgpu/impl/internal.h
+++ openmp/libomptarget/plugins/amdgpu/impl/internal.h
@@ -79,7 +79,6 @@
   bool g_tasks_initialized;
 } atl_context_t;
 extern atl_context_t atlc;
-extern atl_context_t *atlc_p;
 
 #ifdef __cplusplus
 }
@@ -118,8 +117,6 @@
 
 // ---------------------- Kernel End -------------
 
-extern struct timespec context_init_time;
-
 namespace core {
 class TaskgroupImpl;
 class TaskImpl;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102598.345778.patch
Type: text/x-patch
Size: 2400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210517/01de2a66/attachment.bin>


More information about the Openmp-commits mailing list